Skip to content

A debugger-induced crash related to a property #2318

@KubaO

Description

@KubaO

Describe the bug

In the code below, the debugger crashes within FontFamily.New if:

  • a breakpoint is put there, and
  • the Me variable in the variables pane is expanded, and
  • the build is win32.

If Me is not expanded, the crash still happens, a bit later - once New is exited via e.g. F5.

The crash does not happen on a win64 build.

Module MainModule
    Sub Main()
        Dim ff As Any = New FontFamily()
        Stop
    End Sub
End Module

Class FontFamily
    Dim ff As Long
        
    Sub New()
        ff = 0         ' Put a breakpoint here and expand Me in variables pane.
    End Sub

    Protected Property Get Native() As Long
        Return ff
    End Property
End Class

To Reproduce
Scenario A:

  1. Paste the above in a new project, or use the reproducer below.
  2. Set breakpoint on the ff = 0 line.
  3. Press F5 (Run).
  4. Expand Me in the variables pane.
  5. Observe a crash in the diagnostics pane.
  6. Press F5 again.
  7. The program crashes as soon as the breakpoint is reached. It will keep crashing until Me is collapsed in the variables pane.

Scenario B:

  1. Change the property get from protected to Public.
  2. Keep the breakpoint on the ff = 0 line.
  3. Press F5 (Run).
  4. Collapse Me in the variables pane.
  5. Press F5 (Run) to restart the program if needed (i.e. if Me was expanded at the beginning of step 4, causing a crash).
  6. Observe a successful stop at the breakpoint, without a crash.
  7. Press F5 to continue.
  8. The program crashes.

DebugCrash.zip

Expected behavior
No crash :)

Desktop (please complete the following information):

  • OS: Windows 10
  • twinBASIC compiler version: beta 947 and beta 964 both exhibit this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions