discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with exception handling: WAS: no thread-safe +initialize in


From: David Chisnall
Subject: Re: Problem with exception handling: WAS: no thread-safe +initialize in old gnustep runtime?
Date: Mon, 13 Jun 2011 13:30:58 +0100

On 13 Jun 2011, at 13:19, Sebastian Reitenbach wrote:

> I just reread the Linux signal manual, and saw, its not retruning the address 
> of the actual handler, but of the old handler, so  I exchanged the calls 
> later in that function from i.e. signal(SIGSEGV, env->segv) to 
> signal(SIGSEGV, SIG_DFL)
> but without difference in the behaviour observed.


This will break any code that had already set a signal handler (for example, 
anything using GC, since libgc implements dirty bits for its generational 
garbage collection by marking pages as no-access and then catching the 
SIGSEGV).  A better solution would be to stop using the C signal() function and 
use the POSIX sigaction() function.  Since this has been in the standard since 
1990, I'd imagine that it's pretty well supported, although someone should 
check MinGW.  

Even with that change, this code isn't even remotely thread safe, so it would 
be better to replace it with something less fragile.  Is there no port of 
libexecinfo to OpenBSD?  If there is, then it would be a good idea to add that 
as a dependency for the FreeBSD port and use the backtrace() version.

David

-- Sent from my brain




reply via email to

[Prev in Thread] Current Thread [Next in Thread]