[Vm-dev] Event-driven Cog still crashing (more observations)

Igor Stasenko siguctua at gmail.com
Mon Jul 18 13:53:01 UTC 2011


On 18 July 2011 05:55, Dimitry Golubovsky <golubovsky at gmail.com> wrote:
>
> Hi,
>
> My variant of Cog still keeps crashing in GC, but now it seems I made
> those crashes more "consistent". Now I am posting my code to better
> illustrate the problem, maybe this helps.
>
> Fileout of the class which implements my variant of VM.
>
> http://pastebin.com/WJKtXVk5
>
> It overrides few methods of its parent classes to implement the
> event-driven VM. Most important changes are in methods interpret,
> wakeHighestPriority, and transferTo.
>
> The crash log (output of printOop inserted at each entry of markAndTrace)
>
> http://pastebin.com/sHSyHqHE
>
> It shows the debug output from the last entry in the interpreter after
> which GC happens which crashes.
>
> The host program runs the interpreter like this:
>
> ------------------------------------------------------
>  if (runInterpreter) {
>    interpret();
>    while(1) {
>      int rc;
>      if(!aioPoll(1000)) continue;
>      heartbeat();
>      printf("enter interpreter\n");
>      rc = interpret();
>      printf("exit interpreter: %d\n", rc);
>      if(rc == 1) break;
>    }
>  }
> ------------------------------------------------------
>
> and heartbeat() is reduced to
>
> ------------------------------------------------------
> void
> heartbeat()
> {
>        int saved_errno = errno;
> printf("heartbeat\n");
>        updateMicrosecondClock();
>        if (get64(frequencyMeasureStart) == 0) {
>                set64(frequencyMeasureStart,utcMicrosecondClock);
>                heartbeats = 0;
>        }
>        else
>                heartbeats += 1;
>        forceInterruptCheckFromHeartbeat();
>
>        errno = saved_errno;
> }
> ------------------------------------------------------
>
> In order to put the VM into event-driven mode, the following is
> executed in a workspace:
>
> (ProcessorScheduler classPool at: #BackgroundProcess) terminate.
>
> VM continues working, interpreter is entered on any mouse move or
> click, I could open World menu for example. First GC crashes.
>
> It is my understanding that longjmp I use to exit the interpreter
> somehow does not unwind the native stack properly thus corrupting the
> heap which crashes GC. What could it be?
>
> Thanks for any ideas.
>
No idea.
The only thing what i can say that crash in CG usually indicates that
heap is corrupted.
Because it is hard to believe that your changes trigger some bug in GC. :)

> --
> Dimitry Golubovsky
>
> Anywhere on the Web
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list