[Mono-devel-list] SIGILL on FreeBSD - resolved
Martin Dvorak
mdvorak at ninell.cz
Sun May 18 12:27:43 EDT 2003
Paolo Molaro wrote:
> In this case the issue seems to happen in malloc...
> Two ideas: how big is the default stack space for a thread in freebsd?
> Can you check it's not overflowed (print $esp is useful here)?
> What processor type are you using? At least the stuff in io-layer/atomic.h
> works on 486+ only, if you have a 386 that could explain a SIGILL....
Thanks for ideas. The SIGILL was caused by stack overflow on one of the
threads. FreeBSD gives threads much smaller stack than Linux by default.
Attached patch resolves the problem, however somebody will probably make
a fix which better integrates with wapi, since it seems that the stack
size will be variable in the future.
One thing I've noticed during debugging. The code uses POSIX setjmp.h
functions to save/restore context during pinvoke. Is the intended
behaviour not to save the signal mask or it simply does not matter?
There is a difference in implementation of setjmp/longjmp functions
between Linux and BSD systems - on Linux setjmp does not save signal
mask, on FreeBSD setjmp saves signal mask while _setjmp does not. It
seems logical to me to save signal mask too, but the Linux code does not
do this, so I thought it's better to bring it to your attention.
Martin
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: thread-stack-size.patch
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030518/5646116a/attachment.pl
More information about the Mono-devel-list
mailing list