Re: [patch] Re: dlopen() and dlclose() are not MT-safe?



On Thu, Mar 23, 2006 at 12:54:40PM +0200, Kostik Belousov wrote:
On Thu, Mar 23, 2006 at 05:57:24AM +0900, Kazuaki Oda wrote:
BTW do you know the reason why lock is released before calling
objlist_call_fini()? If we don't release the lock, what problem will
occur? deadlock?
The reasoning behind releasing the lock is to allow calls to dl*()
functions from constructors/destructors. This is common practice
and shall be supported. Yes, leaving the lock taken will lead to
deadlock.

Even worse, e.g. access to Thread Locale Storage or possible even lazily
resolved symbols can result in such calls, making it completely
unpredictable.

Please, try the following patch and report results. I can run (modified *)
version of your test for some time without crash with both libpthread
and libthr.

I don't like this patch, give me some time to think of a better
solution.

Joerg
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages