[Mesa-dev] [Bug 76252] Dynamic loading/unloading of opengl32.dll results in a deadlock

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Mar 27 09:52:48 PDT 2014


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

--- Comment #6 from José Fonseca <jfonseca at vmware.com> ---
(In reply to comment #5)
> Can you explain the problem more? Thread 2's stack trace seems like it is
> waiting on ... something, but it isn't clear what or why. 

> Is this the NT
> subsystem pausing it during thread unload? 

I can only guess, but yes, this is some internal DllMain-related global lock.

> If so, why does this cause a
> problem, i.e. why does lp_rast_destroy() hang instead of proceed if there is
> only one thread that is accessing the lock?

I believe this lock is also held by the main thread.  From what I gather the
dead lock is as follows:

 - the main thread held a lock before entering DllMain(DLL_PROCESS_DETACH), and
is now wait for the llvmpipe worker thread to finish

 - the llvmpipe worker threads are trying to get the lock so it calls
DllMain(DLL_THREAD_DETACH) for all DLLs, so it can never finish

See also:

 -  http://support.microsoft.com/default.aspx?scid=kb;EN-US;142243

  - http://msdn.microsoft.com/en-us/library/ms682583%28VS.85%29.aspx

    "Because DLL notifications are serialized, entry-point functions should not
attempt to communicate with other threads or processes. Deadlocks may occur as
a result."

  -
http://stackoverflow.com/questions/2603583/boost-thread-hanging-on-endthreadex 
  - http://stackoverflow.com/questions/353038/endthreadex0-hangs
  -
http://stackoverflow.com/questions/10441048/exit-thread-upon-deleting-static-object-during-unload-dll-causes-deadlock

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


More information about the mesa-dev mailing list