Skip to content

Unexpected VM behavior after #cannotReturn: abort #143

@isCzech

Description

@isCzech

Hi @eliotmiranda ,

When you doit

[thisContext sender privSender: nil] ensure: [Transcript show: 'unwound ']

the VM correctly returns control to the image via #cannotReturn: but the aborted context's stack values come back changed: in this particular case the complete variable in #ensure: previously set to true returns from the VM reset back to nil (at least this is my interpretation of events). As a result the nil value of the complete variable causes the unwind block to be executed again when abandoning the debugger notification.

If you debug the above doit everything looks fine until the VM resumes to execute the return to nil and then the Debugger of course stops.

In 5.3 this was not happening.

May I ask you to take a look whether the issue is VM related as is my guess?

The reason I was checking such an example was to figure out whether the initial condition in #unwindAndResume:evaluating: checking for nil or dead return is at all necessary. I'm inclined to remove it because otherwise we wouldn't unwind when attempting to return to nil or dead context. I believe they should be unwound first and the let the VM deal with the impossible return. Unless I'm missing something.

Here's the ensure: context before VM resumes and after the abort showing stack positions 2 and 3 nilled:

Image

Thanks,
Jaromir

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