<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:natanael.copa@gmail.com" title="Natanael Copa <natanael.copa@gmail.com>"> <span class="fn">Natanael Copa</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - initial-exec TLS model breaks dlopen'ed libGL"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=35268">bug 35268</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>RESOLVED
           </td>
           <td>REOPENED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>NOTOURBUG
           </td>
           <td>---
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - initial-exec TLS model breaks dlopen'ed libGL"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=35268#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - initial-exec TLS model breaks dlopen'ed libGL"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=35268">bug 35268</a>
              from <span class="vcard"><a class="email" href="mailto:natanael.copa@gmail.com" title="Natanael Copa <natanael.copa@gmail.com>"> <span class="fn">Natanael Copa</span></a>
</span></b>
        <pre>initial-exec TLS and dlopen'ed libGL is still an issue with musl libc. Here is
a backtrace from a coredump of firefox:

0x664c2c6f5000
Core was generated by `/usr/lib/firefox-26.0/firefox'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000664c1fb519a8 in __glXSetupForCommand (dpy=0xae298156200)
    at glxext.c:917
917    glxext.c: No such file or directory.
(gdb) bt
#0  0x0000664c1fb519a8 in __glXSetupForCommand (dpy=0xae298156200)
    at glxext.c:917
#1  0x0000664c1fb4ffcd in glx_context_init (gc=gc@entry=0xae298165480, 
    psc=psc@entry=0xae298164d60, config=config@entry=0xae29816f3e0)
    at glxcmds.c:258
#2  0x0000664c1fb7b940 in dri2_create_context (base=0xae298164d60, 
    config_base=0xae29816f3e0, shareList=<optimized out>, renderType=32788)
    at dri2_glx.c:228
#3  0x0000664c1fb4f3ed in CreateContext (dpy=dpy@entry=0xae298156200, 
    generic_id=141, config=0xae29816f3e0, 
    shareList_user=shareList_user@entry=0x0, allowDirect=<optimized out>, 
    code=code@entry=3, renderType=32788, screen=0) at glxcmds.c:301
#4  0x0000664c1fb4f6e1 in glXCreateContext (dpy=0xae298156200, 
    vis=0xae2981651e0, shareList=0x0, allowDirect=1) at glxcmds.c:430
#5  0x0000664c28f95774 in ?? () from /usr/lib/firefox-26.0/xulrunner/libxul.so
#6  0x0000664c28f95918 in ?? () from /usr/lib/firefox-26.0/xulrunner/libxul.so
#7  0x0000664c28f8da28 in ?? () from /usr/lib/firefox-26.0/xulrunner/libxul.so
#8  0x0000664c28f90e76 in ?? () from /usr/lib/firefox-26.0/xulrunner/libxul.so
#9  0x0000664c28f91127 in XRE_main ()
   from /usr/lib/firefox-26.0/xulrunner/libxul.so
#10 0x00000ae2946dd30f in do_main (xreDirectory=0x664c2c16e440, 
    argv=0x733c6106a4c8, argc=1)
    at
/home/buildozer/aports/main/firefox/src/mozilla-release/browser/app/nsBrowserApp.cpp:275
#11 main (argc=<optimized out>, argv=<optimized out>)
    at
/home/buildozer/aports/main/firefox/src/mozilla-release/browser/app/nsBrowserApp.cpp:635
(gdb)

It is mesa 9.2.5, so the segfault happens in:
<a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/glxext.c?h=9.2#n917">http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/glxext.c?h=9.2#n917</a>

 gc = __glXGetCurrentContext();

I believe that __glxGetCurrentContext is defined as a macro:
<a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/glxcurrent.c?h=9.2#n82">http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/glxcurrent.c?h=9.2#n82</a>


I believe that it segfaults due to the use of initial-exec use:
__thread void *__glX_tls_Context __attribute__ ((tls_model("initial-exec")))
   = &dummyContext;</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>