<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Dynamic loading/unloading of opengl32.dll results in a deadlock"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=76252">76252</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Dynamic loading/unloading of opengl32.dll results in a deadlock
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cgerlach42@gmail.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.1
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Mesa core
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm using llvmpipe for software rendering under windows. To switch easily
between hardware and software rendering I loaded the opengl32.dll dynamically.
Unloading the hardware OpenGL library works fine, but unloading mesa results in
a deadlock.

Stacktrace:
opengl32.dll!lp_rast_destroy(lp_rasterizer * rast) Line 948    C
opengl32.dll!llvmpipe_destroy_screen(pipe_screen * _screen) Line 439    C
opengl32.dll!stw_cleanup() Line 180    C
opengl32.dll!DllMain(HINSTANCE__ * hinstDLL, unsigned long fdwReason, void *
lpReserved) Line 168    C
opengl32.dll!__DllMainCRTStartup(void * hDllHandle, unsigned long dwReason,
void * lpreserved) Line 508    C
ntdll.dll!LdrpUnloadDll()    Unknown
ntdll.dll!LdrUnloadDll()    Unknown
KernelBase.dll!FreeLibrary()    Unknown
QtCore4.dll!QLibraryPrivate::unload_sys() Line 157    C++
QtCore4.dll!QLibraryPrivate::unload() Line 488    C++

Setting LP_NUM_THREADS=0 workarounds this problem.</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>