Hello,
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:
wine monostub.exe.so
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:
Here before after
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, Miguel
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?
The way linking works in winelib is kinda odd with the usage of the *.spec that it seems this is not possible. There was some disscussion on this a while back and certain changes that would be needed to LD but I think those might also have been for PE support. If I remember right this has something to do not only with LD but with alot of the magic wineserver works and hence just linking your application to a winelib library would not include all of the support wineserver provides. The rule seems to be its impossible to just -lwine your application. Wine is approaching 0.9 soon so once we hit 1.x then we should have a stable ABI/API which will make sharing the dlls a lot easyer if you come up with a new loading/linking method for mono rather then the winebuild system and its more interesting "features"
Thanks Steven
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
On Tue, Dec 10, 2002 at 08:41:34PM -0500, Miguel de Icaza wrote:
Hello,
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:
wine monostub.exe.so
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:
Here before after
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.
You currently cannot use the wine libraries together with -lpthread.
WINE already overwrites and reimplements several pthread_ functions which probably leads to internal confusion and the crash above.
Difficult to solve :/
Ciao, Marcus