Hi David, Curious bug. Perhaps another solution would be to call DisplaySettings::instance() at the start of main.
An actual bug fix might be to put in a proxy object into src/osg/DisplauySettings.cpp that forces that DisplaySettings::instance() to be constructed during static initialization, this would obviously require a patch to the core OSG, something I'm happy to do, but won't help you right away. Robert. On 2 October 2015 at 17:07, David Siñuela <[email protected]> wrote: > Hello, > > We have a Qt application that uses OSG for the 3D viewer/editor, but the > OSG viewer may not be used if the user does not open the 3D view tab. We > are in the process of upgrading to OSG 3.4 and we noticed that the > application crashes when the user quits if the 3D view is never open. > > The problem seems to be the order in which the static variables are > destroyed at shutdown. The stacktrace looks like this: > > Program received signal SIGSEGV, Segmentation fault. > 0x0000000001d8a0b0 in > osg::DisplaySettings::getNumOfHttpDatabaseThreadsHint (this=0x0) at > /home/siu/src/pix4dmapper/2.1/external_tmp/build/openscenegraph/include/osg/DisplaySettings:203 > (gdb) bt > #0 0x0000000001d8a0b0 in > osg::DisplaySettings::getNumOfHttpDatabaseThreadsHint (this=0x0) at > /home/siu/src/pix4dmapper/2.1/external_tmp/build/openscenegraph/include/osg/DisplaySettings:203 > #1 0x0000000001d86b47 in osgDB::DatabasePager::DatabasePager > (this=0x3a10fb0) at > /home/siu/src/pix4dmapper/2.1/external_tmp/build/openscenegraph/src/osgDB/DatabasePager.cpp:1111 > #2 0x0000000001d87815 in osgDB::DatabasePager::prototype () at > /home/siu/src/pix4dmapper/2.1/external_tmp/build/openscenegraph/src/osgDB/DatabasePager.cpp:1235 > #3 0x0000000001d1ceef in InitRegistry::~InitRegistry (this=0x32cc6f3 > <s_InitRegistry>, __in_chrg=<optimized out>) at > /home/siu/src/pix4dmapper/2.1/external_tmp/build/openscenegraph/src/osgViewer/ViewerBase.cpp:53 > #4 0x00007fffec82df88 in __run_exit_handlers () from /usr/lib/libc.so.6 > #5 0x00007fffec82dfd5 in exit () from /usr/lib/libc.so.6 > #6 0x00007fffec818617 in __libc_start_main () from /usr/lib/libc.so.6 > #7 0x0000000000ea3709 in _start () > > As shown in the trace calling DatabasePager::prototype() is creating the > static DatabasePager for the first time and this one calls > osg::DisplaySettings::instance() which was released already. It is easily > reproducible on linux with gcc. Removing the > osgDB::DatabasePager::prototype() = 0; line fixes the crash but I am not > sure about the intent of that line. > > Regards, > > -- > David Sinuela Pastor > > > *Pix4D SA* > *EPFL Innovation Park* > *Building D* > *1015 Lausanne - Switzerland* > *Email: <[email protected]>[email protected] > <[email protected]>* > *Skype: david.sinuela.pix4d* > *www.pix4d.com* <http://www.pix4d.com> > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

