[Vm-dev] Event-driven Cog still crashing (more observations)
Dimitry Golubovsky
golubovsky at gmail.com
Mon Jul 18 03:55:33 UTC 2011
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.
--
Dimitry Golubovsky
Anywhere on the Web
More information about the Vm-dev
mailing list