[osg-users] Crash when application closes if linking with OSG

David Siñuela david.sinuela at pix4d.com
Fri Oct 2 09:07:28 PDT 2015


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: <david.sinuela at pix4d.com>david.sinuela at pix4d.com
<david.sinuela at gmail.com>*
*Skype: david.sinuela.pix4d*
*www.pix4d.com* <http://www.pix4d.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151002/0f43f67b/attachment-0002.htm>


More information about the osg-users mailing list