Hi,

I found a deadlock in Scene.cpp. The problem exhibits itself when calling 
std::exit() instead of standard way of terminating of the application.

The deadlock is seen on Windows only. On Linux, I get sigsegv or, at least, 
valgrind gives me info about using already freed memory.

After the investigation, I found that the problem is using of static variables 
in getSceneCache() and getSceneCacheMutex() in Scene.cpp. The destructors of 
these static variables are registered by the compiler (gcc) using atexit() 
approach. (I could not believed it and made additional tests, but all the 
same.) As a result, the mentioned variables are destructed too early and 
before all global variables, resulting sigsegv and deadlocks...

I moved the static variables to global scope and the problem disappeared. Is 
it the correct fix of the problem? Should I submit a patch?

Comments? Ideas?
John
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to