[krbdev.mit.edu #5130] Race condition in utils/support/threads.c if one thread calls exit....

Ezra Peisach via RT rt-comment at krbdev.mit.edu
Tue Dec 19 07:10:57 EST 2006


I have another idea...

In addition to destructor_set - add an array destructor_was_set.
When a key is deleted, the was_set is then registered.  Then in the
getspecific/setspecific code, the handler can determine if the shutdown
code is execting as the _set will be zero - and the was_set will be one.

This would be an indication that the proper code had been followed so an
assertion could be tested.

In addition - instead of a simple assertion when testing the global
thread lock - a modification in which the value is tested - if one would
abort - gain the mutex and retest the value...  Minimizes the
performance hit...

Ezra



More information about the krb5-bugs mailing list