My understanding is that the TLS model is entirely a performance
optimisation; it does not change the symbol's visibility.   Now, as per
the only non-source documentation of the Linux ELF TLS ABI I can find¹,
the all the thread-local symbols using the initial-exec model are
required to be known at initial execution, as they're allocated in a
static area that's only set up at initial load by the dynamic loader.
This obviously doesn't work if you try to dlopen a binary containing
symbols with the initial-exec TLS model.

Of course, this documentation is out of date, and libc has long had
support for loading some initial-exec TLS symbols after initial program
load - precisely for libGL, which wants both minimum overhead and a
small number of TLS symbols.

We had problems with this in Natty, where Mesa gained a dependency on
libstdc++, which also has some TLS symbols, and was causing crashes with
anything that tried to dlopen libGL and didn't already have a copy of
libstdc++ in the program image.  (That was bug 259219).

Now, this was allegedly an underlying libc bug that's been fixed; I was
under the impression that we'd dropped the tls patch when updating to
mesa 8.0 in Precise.  I'm now investigating whether we still need it.

I don't believe that the TLS patch is to blame for JOGL's issues; I
think it's more likely that it's exposing a race somewhere - a global-
dynamic symbol requires a couple more instructions (and potentially
extra memory accesses) to access, which would change the timing.

¹: http://www.akkadia.org/drepper/tls.pdf

-- 
You received this bug notification because you are a member of Ubuntu-X,
which is subscribed to mesa in Ubuntu.
https://bugs.launchpad.net/bugs/965798

Title:
  Multithreaded tls_model("global-dynamic") glXMakeContextCurrent
  ___tls_get_addr () freeze/deadlock

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/965798/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~ubuntu-x-swat
Post to     : ubuntu-x-swat@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-x-swat
More help   : https://help.launchpad.net/ListHelp

Reply via email to