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

David T. Lewis lewis at mail.msen.com
Mon Jul 18 17:00:41 UTC 2011


On Sun, Jul 17, 2011 at 11:55:33PM -0400, Dimitry Golubovsky wrote:
> 
> 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,

I certainly do not know what the problem is, but here are some ideas:

- I would be inclined to suspect interations between pthreads and
longjmp. I know that you have taken the heartbeat out its separate
thread, but check if there is any other use of pthreads anywhere
in your VM or plugins. My hunch is that longjmp and pthreads are
unlikely to work well together.

- Check if anyone other than you is calling setjmp, either somewhere
in the Cog support code, or perhaps in a support library (pthreads
again? I do not know).

- The man page for longjmp warns about effects on the signal context
and advises to use siglongjmp if this is an issue. I doubt that this
is your problem, but it's worth mentioning.

HTH,
Dave



More information about the Vm-dev mailing list