Race condition between nss/dlopen/thread
H . J . Lu
hjl@lucon.org
Wed Mar 13 12:51:00 GMT 2002
There is a race condition between nss/dlopen/thread. The problem is
1. Thread A has called dlopen, and the global static initialiser inside
the shared object that's being dlopened is trying to call getservbyname
It's holding the dlopen lock, and trying to acquire the NSS lock.
2. Thread B also calls getservbyname, so we're holding the NSS lock
(which thread A is trying to acquire), and NSS is trying to dlopen a
shared library.
Now. We're deadlocked, because we're trying to acquire the dlopen lock,
which is held by thread A. This is obviously quite sensitive to timing.
I am enclosing a testcase here.
Since NSS also does dlopen, I think it should share locks with dlopen.
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.tar.gz
Type: application/x-gzip
Size: 1125 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20020313/1da96b22/attachment.bin>
More information about the Libc-alpha
mailing list