samskalicky commented on a change in pull request #19016:
URL: https://github.com/apache/incubator-mxnet/pull/19016#discussion_r479800075
##########
File path: src/initialize.cc
##########
@@ -97,9 +97,7 @@ LibraryInitializer::LibraryInitializer()
install_pthread_atfork_handlers();
}
-LibraryInitializer::~LibraryInitializer() {
- close_open_libs();
-}
+LibraryInitializer::~LibraryInitializer() = default;
Review comment:
This was removed since there are cases where (for external ops for
example) an object is registered in an MXNet data structure like the operator
registry and during shutdown the object is attempted to be destructed but its
pointing to an object in the loaded library. This ended up causing a segfault.
Without closing open handles, we let loaded libraries live longer than
libmxnet.so and allow it to shutdown cleanly.
This is why we changed `MXLoadLib` to return the handle to the library and
call `dlclose` on the handle in Python.
However, this still isnt an issue since on process exit the library will be
closed by the OS anyway when it cleans up.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]