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

Dimitry Golubovsky golubovsky at gmail.com
Mon Jul 18 03:55:33 UTC 2011


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.


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)


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) {
    while(1) {
      int rc;
      if(!aioPoll(1000)) continue;
      printf("enter interpreter\n");
      rc = interpret();
      printf("exit interpreter: %d\n", rc);
      if(rc == 1) break;

and heartbeat() is reduced to

        int saved_errno = errno;
        if (get64(frequencyMeasureStart) == 0) {
                heartbeats = 0;
                heartbeats += 1;

        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.

Dimitry Golubovsky

Anywhere on the Web

More information about the Vm-dev mailing list