Bug with pthread_getspecific() and signals

Archie Cobbs archie at dellroad.org
Mon Apr 18 07:00:06 PDT 2005


Daniel Eischen wrote:
>>Does POSIX say that pthread_getspecific can be used in signal handler ?
> 
> I don't think using it in a signal handler should cause a problem
> for our implementation though.  Probably the real problem is that
> the signal handler is not running in the expected thread.  I'd
> double check the signal masks and make sure there is only one
> thread that could possibly handle the signal.

This is a synchronous signal (SIGSEGV) and it's occurring in
application code. So it should be delivered to the thread that
caused it, right? That's what almost always happens.

Also, the this occurs on the second SIGSEGV. When the first one
is delivered, pthread_getspecific() and pthread_self() return the
correct values.

Other random notes: most of the time this bug doesn't happen.
However with this particular application, it happens 100% of the
time.

Still working on a simple test case... if you want a large and complex
test case I have that already... :-)

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com


More information about the freebsd-threads mailing list