hpi-swa-lab / squeak-tracedebugger

A lightweight and interactive back-in-time debugger for Squeak to trace and retrace past method invocations and state changes. Powered by SimulationStudio.
https://hpi-swa-lab.github.io/squeak-tracedebugger/
MIT License
6 stars 0 forks source link

Range retracing: Simulated code cannot safely access stored contexts after fork #90

Open LinqLover opened 2 years ago

LinqLover commented 2 years ago

The current mechanism for handling with copied contexts after a fork leaks because only simulator-side accesses to the contexts are forwarded to their copies. When the simulation code itself accesses any old contexts, such as via Context>>#methodReturnContext, the accesses are not forwarded. The exact scope of this issue is unclear, but below are some examples.

Possible solutions

Failing examples

c := Object newSubclass.
c compile: 'foo: x

    [^ x factorial]
        "value" "<- works"
        ensure: []'.
o := c new.
(TDBRetracingSimulator forMemory: TDBMemory new atTimes: (1 to: 3))
    evaluate:
        [o foo: thisContext tdbRetracingTimeIndex]

In other cases, a BlockCannotReturn is signaled from the simulated code when attempting a non-local return within an unwind context.

See #rangeRetracingForkAccess for more examples.