[Vm-dev] Corrupt Stack When Trying To Simulate Cogged SmallInteger>>#+

Clément Bera bera.clement at gmail.com
Thu Jan 19 11:27:26 UTC 2017

Hi Bastian,

I am not sure and I don't have much time, but usually return instructions
fail in the processor simulator when returning to the interpreter code,
then Cogit>>handleSimulationTrap: is responsible for simulating such
returns which give back the control to the interpreter.

Is that the issue ? Else I can look further later.


On Thu, Jan 19, 2017 at 11:09 AM, Kruck, Bastian <
Bastian.Kruck at student.hpi.de> wrote:

> Hi Folks,
> Do you have a moment to give me a hint on the following error?
> I’m currently trying to get the result of the cogged version of
> SmallInteger>>#+ by simulating it in VMMaker. So I initialise the
> simulator, lookup the method in the loaded image and finally start Bochs by
> calling simulator activateCoggedNewMethod: false.
> Now I can see the primitiveSingleStepInMemoryMinimumAddressReadWrite
> failing when trying trying to return to esp=16r11 which is my receiver. So
> it seems my stack gets corrupted at some point. So I start tracing what the
> processor is doing:
> - starts at ceEnterCogCodePopReceiverReg (pc=16r1128)
> - then it enters the compiled SmallInteger>>#+ (pc= 16r1462, the position
> with HasByteCodePC)
> - then it enters ceSuperSend1Args (pc=16r570)
> - and runs further up to the return (at pc=16r5aa) where it will have the
> esp=16r11
> Can you give me a hint on what’s happening here? I put the notes while
> tracing into a txt file that you can find attached. If you want to try it
> out yourself, I uploaded the image and the VM version here
> https://www.dropbox.com/sh/6sevutlcpx3of42/AAA9ScgmvK5IeLaCxE6yWJ8Ua?dl=0
> The Background: I’m currently working on my master thesis on Multi-Level
> Debugging where I’m building a debugger that is supposed to
> detect erroneous code transformations by redundantly executing the Slang,
> the running vm, the fallback code and also the JIT-compiled fallbacks.
> Thank you so much!
> Basti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170119/f1a899dd/attachment.html>

More information about the Vm-dev mailing list