Re: [PATCH] elf: Release dl_load_lock before running dlopen constructors (BZ 15686)

Alexander Pevzner <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Message-ID <[email protected]>
Hi!

On 7/13/26 8:43 AM, Florian Weimer wrote:

> I believe this results in a data race on l_init_called.  In a
> multi-threaded application, the same ELF constructor may execute with
> itself in parallel on different threads, or dlopen may return before the
> ELF constructor has completed running in another thread.  Some form of
> synchronization is required to deal with these scenarios, perhaps using
> pthread_once or a condition variable.

I don't quite understand how could it happen. Constructors are running 
on a context of the thread that called dlopen, and should all complete 
before dlopen is finished and returned.

> We also likely cannot remove a lock like this for old applications which
> may depend on its existence.  We can deal with this with a different
> mechanism.

What visible change in behavior do you expect?

-- 

	Wishes, Alexander Pevzner ([email protected])
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.