<div dir="ltr"><div><div>Hello,<br><br></div>Thanks for your input. We can wait for an upstream fix, in the meanwhile we will patch it in our development branch.<br><br></div><div>I tried your proposed solution, calling DisplaySettings::instance() from main(), and it didn't work, when s_InitRegistry is destroyed the DisplaySettings::s_displaySettings has been destroyed already. It can be fixed by defining a static initializer like InitRegistry that simply calls DisplaySettings::instance() in our program. If I understood it correctly this works because the compiler/linker will see this static member and DisplaySettings::s_displaySettings before InitRegistry, changing the order of initialization so that DisplaySettings::s_displaySettings is allocated before s_InitRegistry and deallocated after.<br><br></div><div>It can also be fixed by calling "osgDB::DatabasePager::prototype()" or "osg::DisplaySettings::instance()" from InitRegistry's constructor.<br><br></div><div>Regards,<br></div><div>David<br></div><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 2, 2015 at 6:28 PM, Robert Osfield <span dir="ltr"><<a href="mailto:robert.osfield@gmail.com" target="_blank">robert.osfield@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi David,<br><br></div>Curious bug. Perhaps another solution would be to call DisplaySettings::instance() at the start of main.<br><br></div>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.<br><br></div>Robert.<br><div><div><br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 2 October 2015 at 17:07, David Siñuela <span dir="ltr"><<a href="mailto:david.sinuela@pix4d.com" target="_blank">david.sinuela@pix4d.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div>Hello,<br><br></div>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.<br><br></div>The problem seems to be the order in which the static variables are destroyed at shutdown. The stacktrace looks like this:<br><br>Program received signal SIGSEGV, Segmentation fault.<br>0x0000000001d8a0b0 in osg::DisplaySettings::getNumOfHttpDatabaseThreadsHint (this=0x0) at /home/siu/src/pix4dmapper/2.1/external_tmp/build/openscenegraph/include/osg/DisplaySettings:203<br>(gdb) bt<br>#0 0x0000000001d8a0b0 in osg::DisplaySettings::getNumOfHttpDatabaseThreadsHint (this=0x0) at /home/siu/src/pix4dmapper/2.1/external_tmp/build/openscenegraph/include/osg/DisplaySettings:203<br>#1 0x0000000001d86b47 in osgDB::DatabasePager::DatabasePager (this=0x3a10fb0) at /home/siu/src/pix4dmapper/2.1/external_tmp/build/openscenegraph/src/osgDB/DatabasePager.cpp:1111<br>#2 0x0000000001d87815 in osgDB::DatabasePager::prototype () at /home/siu/src/pix4dmapper/2.1/external_tmp/build/openscenegraph/src/osgDB/DatabasePager.cpp:1235<br>#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<br>#4 0x00007fffec82df88 in __run_exit_handlers () from /usr/lib/libc.so.6<br>#5 0x00007fffec82dfd5 in exit () from /usr/lib/libc.so.6<br>#6 0x00007fffec818617 in __libc_start_main () from /usr/lib/libc.so.6<br>#7 0x0000000000ea3709 in _start ()<br><br></div><div>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.<br><br></div><div>Regards,<span><font color="#888888"><br clear="all"></font></span></div><span><font color="#888888"><div><div><div><div><br>-- <br><div><div dir="ltr"><div><div dir="ltr">David Sinuela Pastor<br><br><div><br></div><div><font size="1"><b>Pix4D SA</b></font></div><div><font size="1"><b>EPFL Innovation Park</b></font></div><div><font size="1"><b>Building D</b></font></div>
<div><font size="1"><b>1015 Lausanne - Switzerland</b></font></div><div><font size="1"><b>Email: <a href="mailto:david.sinuela@pix4d.com" target="_blank"></a><a href="mailto:david.sinuela@gmail.com" target="_blank">david.sinuela@pix4d.com</a></b></font></div>
<div><b style="font-size:x-small">Skype: david.sinuela.pix4d</b><br></div><div><font size="1"><a href="http://www.pix4d.com" target="_blank"><b>www.pix4d.com</b></a></font></div></div></div></div></div>
</div></div></div></div></font></span></div>
<br></div></div>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">David Sinuela Pastor<br><br><div><br></div><div><font size="1"><b>Pix4D SA</b></font></div><div><font size="1"><b>EPFL Innovation Park</b></font></div><div><font size="1"><b>Building D</b></font></div>
<div><font size="1"><b>1015 Lausanne - Switzerland</b></font></div><div><font size="1"><b>Email: <a href="mailto:david.sinuela@pix4d.com" target="_blank"></a><a href="mailto:david.sinuela@gmail.com" target="_blank">david.sinuela@pix4d.com</a></b></font></div>
<div><b style="font-size:x-small">Skype: david.sinuela.pix4d</b><br></div><div><font size="1"><a href="http://www.pix4d.com" target="_blank"><b>www.pix4d.com</b></a></font></div></div></div></div></div>
</div>