Crashes inside osgEarth::QtGui::ViewerWidget constructor

classic Classic list List threaded Threaded
3 messages Options
jeladi jeladi
Reply | Threaded
Open this post in threaded view
|

Crashes inside osgEarth::QtGui::ViewerWidget constructor

I am getting crashes when I try to initialize a class derived from osgEarth::QtGui::ViewerWidget in my application.  It seems to be happening inside the base class rather than my own class as far as I can tell.  As a sanity check I ran the osgearth_package_qt application and it also crashed.  

What is interesting is that this only happens in Release mode.  For Debug versions of both my app and osgearth_package_qt it works fine.

I am using Mingw-w64 with Qt 5.5.1, OSG 3.4.0, OSGEarth 2.7 and these have all been compiled with gcc 5.4.0.   Any ideas as to what could be causing it?

Here is the call stack for osgearth_package_qt:

#0  0x0000000003acaf46 in osgEarth::Units::convert(osgEarth::Units const&, osgEarth::Units const&, double, double&) ()
   from C:\Users\jeff\MyPrograms\OSG64-Release\bin\libosgEarthUtil.dll
#1  0x00000000039f4cd9 in osgEarth::Util::EarthManipulator::setViewpointFrame(double) ()
   from C:\Users\jeff\MyPrograms\OSG64-Release\bin\libosgEarthUtil.dll
#2  0x00000000039f82db in osgEarth::Util::EarthManipulator::setViewpoint(osgEarth::Viewpoint const&, double) ()
   from C:\Users\jeff\MyPrograms\OSG64-Release\bin\libosgEarthUtil.dll
#3  0x00000000039f73ab in osgEarth::Util::EarthManipulator::established() ()
   from C:\Users\jeff\MyPrograms\OSG64-Release\bin\libosgEarthUtil.dll
#4  0x000000006e7b25d2 in osgViewer::View::setCameraManipulator(osgGA::CameraManipulator*, bool) ()
   from C:\Users\jeff\MyPrograms\OSG64-Release\bin\libosgViewer.dll
#5  0x00000000004064c8 in PackageQt::SceneController::loadEarthFile(std::__cxx11::basic_string<char, std::char_traits<ch
ar>, std::allocator<char> > const&) ()
#6  0x00000000004082d8 in PackageQt::SceneController::SceneController(osg::Group*, osgViewer::View*, std::__cxx11::basic
_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#7  0x0000000000428a78 in main ()
(gdb)
Philippe Renon Philippe Renon
Reply | Threaded
Open this post in threaded view
|

Re: Crashes inside osgEarth::QtGui::ViewerWidget constructor

I had the same issue. Seems to be an issue with GCC >= 5.3.0 regarding some optimization options.

A workaround can be found here : https://github.com/filnet/MINGW-packages/blob/master/mingw-w64-osgearth-git/0001-Fixed-crash-due-to-probable-GCC-5.3.0-optimizer-bug.patch

Mind that you'll have to adapt it for GCC 5.4.0.
jeladi jeladi
Reply | Threaded
Open this post in threaded view
|

Re: Crashes inside osgEarth::QtGui::ViewerWidget constructor

This workaround took care of the issue.  Thanks for your help Philippe!