tech-kern archive

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

Re: pthread_getspecific without prior pthread_setspecific



On Sun, May 17, 2015 at 06:15:00PM +0000, Michael van Elst wrote:
> That's perfectly valid. pthread_getspecific is supposed to return NULL
> until the specific data for the key has been set by a call to
> pthread_setspecific.

As long as the key has been created - which it has not in the case at hand,
or pt_havespecific would be true!

> But why is this a problem only for mips N32 ?

It is not, it happens on all machines I tested so far - but it is not noticed
untill you add the assertion.

So: IMHO there is an undlying bug somewhere (which I don't see right now)
that we can either paper over (return NULL patch) or assert and debug
(other patch).

I encourage anyone interested to add the assert and see gdb (and a lot other
programs) die imediately. On the environment this actually popped up, debugging
is tricky (due to more/other bugs).

Martin


Home | Main Index | Thread Index | Old Index