Crash at unload library, unregister
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
This crash could be reporoduced on Apple (at least on the latest El Capitan system) and on Windows also.
But note that on Windows you need to start the attached example in Debug mode (i.e. in Visual Studio IDE you need to use F5 key - "Start Debugging") instead of using Ctrl+F5 "Start Without Debugging".
On Linux I was not able to reproduce this crash.
In minimal example to reproduce this crash (attached) we have two C++ projects (in fact I'm using CMake projects): main executable VTKDynamicLinkingCrash and shared library VTKDynamicLinkingCrashLib.
Also, the crash could be reproduced with VTK 6.2.0, VTK 6.3.0 and VTK 7.0.0. The VTK library should be built in shared library mode. If you built VTK in static library mode then this crash is not reproduced.
Only shared library VTKDynamicLinkingCrashLib uses VTK library. Main executable VTKDynamicLinkingCrash doesn't use VTK library directly. Also, VTKDynamicLinkingCrash loads VTKDynamicLinkingCrashLib by using LoadLibrary\dlopen functions, and unload this library respectively (FreeLibrary\dlclose).
When shared library VTKDynamicLinkingCrashLib is being unloaded it's crashing. It seems that the problem that VTK library tries to unregister some factories which were created in some dynamic libraries which are already (too early) unloaded at the crash time. Two classes (vtkCommonInformationKeyManager and vtkFilteringInformationKeyManager) have a similar problem. Their ClassFinalize() method tries to deallocate some objects which were allocated in the modules which are currently unavailable.
P.S.: I'm newbie at VTK matis. What does TBD project means? Should I select another project for this crash?