<div dir="ltr"><div>Hi Gareth,<br><br></div><div>Does the crash occur for applications using osgEarth/OSG without Qt?<br><br></div><div>It's a bit hacky but would be worth trying to just scope out the issue further : try loading all the OSG plugins that might be required prior to starting Qt. <br></div><div><br></div><div>Robert.<br></div><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 21 September 2015 at 11:38, Gareth Francis <span dir="ltr"><<a href="mailto:gfrancis.dev@gmail.com" target="_blank">gfrancis.dev@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><div>CentOS 6.5<br></div>OSG 3.4.0<br></div>osgEarth 2.7<br><br><br></div><div>You might be right, I've just got the same crash using RTLD_LOCAL..<br></div>I've been having several problems relating to osgQt/X11 threading, so it's possible that this is another symptom of that.<br></div><br>I can't reproduce this under a debugger, however I have been able to get a core dump/backtrace:<br><br>Program terminated with signal SIGSEGV, Segmentation fault.<br>#0  0x000000371e479bb7 in _int_malloc () from /lib64/libc.so.6<br>(gdb) bt<br>#0  0x000000371e479bb7 in _int_malloc () from /lib64/libc.so.6<br>#1  0x000000371e47b7da in _int_realloc () from /lib64/libc.so.6<br>#2  0x000000371e47baf5 in realloc () from /lib64/libc.so.6<br>#3  0x0000003c9e4a92ab in ?? () from /usr/lib64/libGL.so.1<br>#4  0x0000003c9e4aabd1 in ?? () from /usr/lib64/libGL.so.1<br>#5  0x0000003c9e4b148d in ?? () from /usr/lib64/libGL.so.1<br>#6  0x0000003c9e4aa345 in ?? () from /usr/lib64/libGL.so.1<br>#7  0x000000371e012bc3 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2<br>#8  0x000000371e00e266 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2<br>#9  0x000000371e0125aa in _dl_open () from /lib64/ld-linux-x86-64.so.2<br>#10 0x000000371f000f66 in dlopen_doit () from /lib64/libdl.so.2<br>#11 0x000000371e00e266 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2<br>#12 0x000000371f00129c in _dlerror_run () from /lib64/libdl.so.2<br>#13 0x000000371f000ee1 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2<br>#14 0x00007f48a4c87603 in osgDB::DynamicLibrary::getLibraryHandle(std::string const&) () from /projects/osg/release/lib64/libosgDB.so.130<br>#15 0x00007f48a4c87ba0 in osgDB::DynamicLibrary::loadLibrary(std::string const&) () from /projects/osg/release/lib64/libosgDB.so.130<br>#16 0x00007f48a4cb5137 in osgDB::Registry::loadLibrary(std::string const&) () from /projects/osg/release/lib64/libosgDB.so.130<br>#17 0x00007f48a4cba9c6 in osgDB::Registry::read(osgDB::Registry::ReadFunctor const&) () from /projects/osg/release/lib64/libosgDB.so.130<br>#18 0x00007f48a4cbb631 in osgDB::Registry::readImplementation(osgDB::Registry::ReadFunctor const&, osgDB::Options::CacheHintOptions) ()<br>   from /projects/osg/release/lib64/libosgDB.so.130<br>#19 0x00007f48a4cbbd5a in osgDB::Registry::readObjectImplementation(std::string const&, osgDB::Options const*) () from /projects/osg/release/lib64/libosgDB.so.130<br>#20 0x00007f48a4cac4e8 in osgDB::readRefObjectFile(std::string const&, osgDB::Options const*) () from /projects/osg/release/lib64/libosgDB.so.130<br>#21 0x00007f48a58576a1 in osgText::readRefFontFile(std::string const&, osgDB::Options const*) () from /projects/osg/release/lib64/libosgText.so.130<br>#22 0x00007f48a586ae4a in osgText::TextBase::setFont(std::string const&) () from /projects/osg/release/lib64/libosgText.so.130<br>#23 0x00007f48a7de6397 in osgViewer::StatsHandler::setUpScene(osgViewer::ViewerBase*) () from /projects/osg/release/lib64/libosgViewer.so.130<br>#24 0x00007f48a7deda3f in osgViewer::StatsHandler::handle(osgGA::GUIEventAdapter const&, osgGA::GUIActionAdapter&) () from /projects/osg/release/lib64/libosgViewer.so.130<br>#25 0x00007f48a82f0192 in osgGA::GUIEventHandler::handle(osgGA::Event*, osg::Object*, osg::NodeVisitor*) () from /projects/osg/release/lib64/libosgGA.so.130<br>#26 0x00007f48a7e0af93 in osgViewer::Viewer::eventTraversal() () from /projects/osg/release/lib64/libosgViewer.so.130<br>#27 0x00007f48a7e12979 in osgViewer::ViewerBase::frame(double) () from /projects/osg/release/lib64/libosgViewer.so.130<br>#28 0x00007f48a61e7e6e in QWidget::event(QEvent*) () from /projects/osg/release/lib64/libQtGui.so.4<br>#29 0x00007f48a6ca0d8c in QGLWidget::event(QEvent*) () from /projects/osg/release/lib64/libQtOpenGL.so.4<br>#30 0x00007f48a619949c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /projects/osg/release/lib64/libQtGui.so.4<br>#31 0x00007f48a619f981 in QApplication::notify(QObject*, QEvent*) () from /projects/osg/release/lib64/libQtGui.so.4<br>#32 0x00007f48a5c4122c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /projects/osg/release/lib64/libQtCore.so.4<br>#33 0x00007f48a61ea88c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()<br>   from /projects/osg/release/lib64/libQtGui.so.4<br>#34 0x00007f48a63b2b1c in QWidgetPrivate::repaint_sys(QRegion const&) () from /projects/osg/release/lib64/libQtGui.so.4<br>#35 0x00007f48a61ddf64 in QWidgetPrivate::syncBackingStore() () from /projects/osg/release/lib64/libQtGui.so.4<br>#36 0x00007f48a61e83fc in QWidget::event(QEvent*) () from /projects/osg/release/lib64/libQtGui.so.4<br>#37 0x00007f48a6ca0d8c in QGLWidget::event(QEvent*) () from /projects/osg/release/lib64/libQtOpenGL.so.4<br>#38 0x00007f48a619949c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /projects/osg/release/lib64/libQtGui.so.4<br>#39 0x00007f48a619f981 in QApplication::notify(QObject*, QEvent*) () from /projects/osg/release/lib64/libQtGui.so.4<br>#40 0x00007f48a5c4122c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /projects/osg/release/lib64/libQtCore.so.4<br>#41 0x00007f48a5c4530b in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /projects/osg/release/lib64/libQtCore.so.4<br>#42 0x00007f48a623d471 in ?? () from /projects/osg/release/lib64/libQtGui.so.4<br>#43 0x00007f48a5c3ff12 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /projects/osg/release/lib64/libQtCore.so.4<br>#44 0x00007f48a5c40274 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /projects/osg/release/lib64/libQtCore.so.4<br>#45 0x00007f48a5c456cb in QCoreApplication::exec() () from /projects/osg/release/lib64/libQtCore.so.4<br>#46 0x0000000000412f5f in main (argc=1, argv=0x7ffec6063ec8) at main.cpp:96<br><br><div><div><br></div></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On 21 September 2015 at 11:26, 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>Hi Gareth,<br><br></div>I don't recall this being an issue before.  What hardware, OS and OSG/osgEarth versions are you using?<br><br></div>Robert.<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On 21 September 2015 at 11:15, Gareth Francis <span dir="ltr"><<a href="mailto:gfrancis.dev@gmail.com" target="_blank">gfrancis.dev@gmail.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><div dir="ltr"><div><div><br></div><div>I believe I found a bug in getLibraryHandle.<br><br></div><div>This was encountered when writing an osgEarth application, using the osgEarthQt widgets (Qt 4.8.6).<br></div><div><br></div><div>A segfault was encountered shortly after starting the application, when pressing 's' (To bring up the standard set of rendering stats).<br></div><div><br>I traced this to the dlopen( localLibraryName.c_str(), RTLD_LAZY | RTLD_GLOBAL) call in osg/src/osgDB/DynamicLibrary.cpp<br></div><div><br></div><div>According to the dlopen manpage:<br><pre>As at glibc 2.21, specifying the <b>RTLD_GLOBAL </b>flag when calling
       <b>dlmopen</b>() generates an error.  Furthermore, specifying <b>RTLD_GLOBAL</b>
       when calling <b>dlopen</b>() results in a program crash (<b>SIGSEGV</b>) if the
       call is made from any object loaded in a namespace other than the
       initial namespace.</pre></div><div><br></div><div>Changing osg to use RTLD_LOCAL avoids the crash, and doesn't seem to break anything else as far as I can tell.<br><br></div><div>Is there a specific reason why RTLD_GLOBAL is used? This doesn't make much sense given the plugin architecture..<br><br><br></div><div>I've attached a minimal patch including the fix.<br></div><div><br><br></div>Thanks<span><font color="#888888"><br></font></span></div><span><font color="#888888">Gareth Francis<br></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" 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><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div>--------------------<br>Gareth Francis<br><a href="http://www.gfrancisdev.co.uk" target="_blank">www.gfrancisdev.co.uk</a><br></div>
</font></span></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></div>