[Mesa-dev] [Bug 91646] dlopen'ing libudev.so.1 from static library initializer corrupts TLS state

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Aug 16 03:56:00 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=91646

--- Comment #4 from Timo R. <timo at rothenpieler.org> ---
> That's unlikely to work, static local variables are no different to globals
> regarding initialization order,

To my knowledge, static local variables are initialized on the first call to
the function, whereas global variables are initialized in the libraries early
static initializer, which runs during library load.

> and, yeah, it seems like a hack because
> pipe_loader_probe() shouldn't be doing anything that could corrupt the TLS
> state when called at initialization time.

The simple act of calling dlopen on libudev.so.1 from within the early static
initializer is enough to corrupt the TLS state, but only if some later library
also links against libudev.so.1.
So not initializing the structure on library-load, but on first function call
might actualy help.

> It looks like this might be a regression from the series
> de5c2b6f2b53924bceab6f4b8255d8e9dcad21b4..
> cc32d25454c382a971e81ae584a4296fdf492e70(which are indeed not part of any
> released version yet), you may want to bisect which change introduced the
> problem.

Not sure when I'll get to this, but I'll see what i can do.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150816/abdaafc3/attachment.html>


More information about the mesa-dev mailing list