Bug with pthread_getspecific() and signals

Daniel Eischen deischen at freebsd.org
Sun Apr 17 21:34:19 PDT 2005


On Mon, 18 Apr 2005, David Xu wrote:
> Archie Cobbs wrote:
>
> > On FreeBSD 4.9 I'm seeing a bug where pthread_getspecific() sometimes
> > returns the wrong value when invoked from within a signal handler.
> >
> > ISTR this bug was fixed in a later version of FreeBSD. However, I can't
> > seem to find any reference to the bug, any information about when
> > it was fixed, etc. (FreeBSD's mailing list search ability doesn't
> > help much).
> >
> > If anyone knows any more details about this bug I'd appreciate knowing
> > any more details.
>
> 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.

-- 
DE



More information about the freebsd-threads mailing list