This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/14767] gcjlib under FreeBSD does not forward SIGSEGV to SA_SIGINFO handler


------- Additional Comments From andrew dot gray at anu dot edu dot au  2004-04-08 00:31 -------
Hans,

Thanks for your comments, in particular explaining under what
circumstances GC_write_fault_hanlder would be forwarding SIGSEGV.

Regarding your question about the patch:

I have no reason to think FreeBSD needs to be excluded from the #if at
line 124 of os_dep.c (which controls #defining setjmp to be sigsetjmp
and #defining longjmp similarly).

The reason I excluded it in the patch was to restrict the changes to
the signal handling problem.  The original code (from the
gcc-3.4-20040310 snapshot, based on gc6.3alpha1) did not define
SUNOS5SIGS for FreeBSD.  So the original code did not include the
#define for setjmp and longjmp under FreeBSD.  My patch to gcconfig.h
does define SUNOS5SIGS for FreeBSD version 4 or later.  So to keep the
behaviour of the original code my patch changes "defined (SUNOS5SIGS)"
to "(defined SUNOS5SIGS) && !defined(FREEBSD)" at line 124.

Sorry, I do not know if a plain setjmp can be used to jump out of a
signal handler on FreeBSD.  Also, I do not know if sigsetjmp is
appreciably slower than plain setjmp.

In quickly looking at the code, the most information about whether or
not FreeBSD should use sigsetjmp that I found was your comment in the
README.changes for gc6.3alpha4:

 - Made os_dep.c use sigsetjmp and SA_NODEFER for NetBSD.  (Thanks to
   Christian Limpach.)  (I generalized the patch to use sigsetjmp on all
   UNIX_LIKE platforms, admittedly a slightly risky move.  But it may avoid
   similar problems on some other platforms. I also cleaned up the defn
   of UNIX_LIKE a bit. - Hans)

Not knowing anything about how the GCC/GCJ people generally manage
syncing the Boehm GC code in GCC with your upstream source, if my
patch was going to be applied to GCC I would be inclined to leave it
as is.  That way the change to using sigsetjmp would occur when
gc6.3alpha4 was imported into GCC.  What do you think?

Andrew

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14767


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]