[Mesa-dev] [Bug 35268] New: initial-exec TLS model breaks dlopen'ed libGL

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Mar 13 04:46:46 PDT 2011


           Summary: initial-exec TLS model breaks dlopen'ed libGL
           Product: Mesa
           Version: git
          Platform: Other
        OS/Version: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
        AssignedTo: mesa-dev at lists.freedesktop.org
        ReportedBy: chalserogers at gmail.com

Created an attachment (id=44411)
 --> (https://bugs.freedesktop.org/attachment.cgi?id=44411)
Source and Makefile for trivial SIGSEGV reproducer.

Mesa's use of the initial-exec TLS model unpredictably breaks usage of libGL by
programs for which the executable isn't directly linked to libGL (so, python
apps, mono apps, C apps which use dlopen, etc).

This manifests as a SIGSEGV in libstdc++ when certain conditions are met
(stream output and exception handling seem to be examples of this).

Attached is a trivial example program which demonstrates the crash.  (Thanks to
Ulrich von Zadow on the associated Ubuntu bug²).

According to the linux TLS ABI reference¹ I could find, initial-exec implies a
the static TLS model, which doesn't work for dynamically loaded modules. 
However, checking out the dl-tls.c code in eglibc there seems to be some
attempt to handle this.  Also, the TLS ABI reference suggests that
__tls_get_addr receives its parameter in %eax, but this doesn't appear to be
the case in dl-tls.c.

¹: http://www.akkadia.org/drepper/tls.pdf 
²: https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/259219

Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the mesa-dev mailing list