You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/06 00:11:58 UTC

[GitHub] eftiquar opened a new issue #11163: Deadlock in LibMxNet.dll during unload due to synchronization call in destructor

eftiquar opened a new issue #11163: Deadlock in LibMxNet.dll during unload due to synchronization call in destructor 
URL: https://github.com/apache/incubator-mxnet/issues/11163
 
 
   Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form.
   
   For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io 
   
   ## Description
   The destructor for "mxnet::Engine" local static instance  calls into STL's condition_variable::notify_all , which in turn calls  NtReleaseKeyedEvent, an undocumented Windows API which results in deadlock, as the call is being run with loader lock acquired, in the context of DLL unload machinery.
   Independent of this hang, having non-trivial destructor for static local variable is recipe for unforeseen problems. These destructors are called in unspecified order, and may call into other DLLs or ( Shared Objects) that are unloaded.   
   
   (Brief description of the problem in no more than 2 sentences.)
   
   ## Environment info (Required)
   Windows 7, any MxNet build  
   
   Compiler (gcc/clang/mingw/visual studio):
   
   ## Error Message:
   No error message, the Python process hangs upon exit
   
   ## Minimum reproducible example
   (If you are using your own code, please provide a short script that reproduces the error. Otherwise, please provide link to the existing example.)
   
   ## Steps to reproduce
   1. Set up a standard Windows 7 system 
   2. Install Python from https://sourceforge.net/projects/winpython/files/WinPython_3.6/3.6.5.1/beta... ... 
   3. Run the following in the Windows Python command shell: 
   a. pip install mxnet 
   b. python 
   4. Run the following in the Python shell: 
   a. import mxnet 
   b. exit() 
   
   ## What have you tried to solve it?
   Proposed solution 
   
   a. Provide explicit API to destroy the "mxnet::Engine" instance that is complement to Engine::Create. 
   b. Have LibMxNet consumers call Destroy API explicitly before exiting. 
   c. Modify the destructor to not perform cleanup, as Destroy will have already done that
   d. If no one calls cleanup, it should not matter. As, after the process is destroyed, all the resources will be reclaimed by the OS 
    
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services