You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
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.)
Run the following in the Windows Python command shell:
a. pip install mxnet
b. python
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
The text was updated successfully, but these errors were encountered:
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
a. pip install mxnet
b. python
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
The text was updated successfully, but these errors were encountered: