Wine, Windows.Forms on Linux, GC and segfaults.

Miguel de Icaza miguel at
Tue Dec 10 19:41:34 CST 2002


    With the help of Hans Boehm, I have been tracking the problems we
have to run the Windows.Forms code with GC enabled.  Turns out that the
problem is not the Boehm code at all, it just exposes a problem that
might be happening elsewhere.

    The problem is that by the time that Wine has been initialized,
using setjmp/longjmp will always lead to a crash.  The code in pthreads
that performs the longjmp will first try to invoke the pthread cleanup
routines, and then invoke longjmp.  This never happens.

    In the particular case of Mono, I added a small bit of code before
calling into Boehm's GC, and then I run my app like this:


     The code snippet is:

	jmp_buf buf;
	printf ("Here\n");
	if (setjmp (buf) == 0){
		printf ("before\n");
		longjmp (buf, 1);
	} else {
		printf ("after\n");		

     The code should display:


      But with Wine, I get a crash inside longjmp, after the "before" is
printed out.  I get the Wine Console with the stack trace, but I can not
copy/paste from it, so I have included a screenshot of it.

      I can not run Wine with Valgrind because it calls modify_ldt(),
but I suspect memory corruption.

      I was wondering if it would be possible to just "link" against the
Wine library instead of having to create a stub application to run from?

Best wishes,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-crash.png
Type: image/png
Size: 22067 bytes
Desc: not available
Url :

More information about the wine-devel mailing list