gwaldron / osgearth

3D Maps for OpenSceneGraph / C++14
https://www.pelicanmapping.com/home-1/opensource
Other
1.51k stars 779 forks source link

Crash during unsuccessful terrain tile loading in copyAsSubImage #576

Closed jklimke closed 9 years ago

jklimke commented 9 years ago

There is a crash happening when a terrain tile is loaded / copied. Are there any poposals how to fix this crash ? we are currently using a master version from December 5th (commit cb7907d44003140b2e9341ef1824b82957f547d8)

The crash backtrace is the following:

#17   Object "", at 0xffffffffffffffff, in
#16   Object "/lib/x86_64-linux-gnu/libc-2.19.so", at 0x7fa27c8d600c, in __clone
#15   Object "/lib/x86_64-linux-gnu/libpthread-2.19.so", at 0x7fa27d769181, in start_thread
#14   Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1", at 0x7fa27d14e232, in
#13   Object "/usr/lib/libOpenThreads.so.3.3.0", at 0x7fa276a71c63, in QtThreadPrivateData::run()
#12   Object "/usr/lib/libosgDB.so.3.3.3", at 0x7fa2720c7801, in osgDB::DatabasePager::DatabaseThread::run()
#11   Object "/usr/lib/libosgDB.so.3.3.3", at 0x7fa2720fa0ce, in osgDB::Registry::readNodeImplementation(std::string const&, osgDB::Options const*)
#10   Object "/usr/lib/libosgDB.so.3.3.3", at 0x7fa2720f9772, in osgDB::Registry::readImplementation(osgDB::Registry::ReadFunctor const&, osgDB::Options::CacheHintOptions)
#9    Object "/usr/lib/libosgDB.so.3.3.3", at 0x7fa2720f89d8, in osgDB::Registry::read(osgDB::Registry::ReadFunctor const&)
#8    Object "/usr/lib/libosgDB.so.3.3.3", at 0x7fa2721010cb, in osgDB::Registry::ReadNodeFunctor::doRead(osgDB::ReaderWriter&) const
#7    Object "/usr/lib/osgPlugins-3.3.3/osgdb_osgearth_engine_mp.so", at 0x7fa25eddac8b, in osgEarth::Drivers::MPTerrainEngine::MPTerrainEngineDriver::readNode(std::string const&, osgDB::Options const*) const
#6    Object "/usr/lib/osgPlugins-3.3.3/osgdb_osgearth_engine_mp.so", at 0x7fa25edd3878, in osgEarth::Drivers::MPTerrainEngine::MPTerrainEngineNode::createNode(osgEarth::TileKey const&, osgEarth::ProgressCallback*)
#5    Object "/usr/lib/osgPlugins-3.3.3/osgdb_osgearth_engine_mp.so", at 0x7fa25eddcbfb, in osgEarth::Drivers::MPTerrainEngine::SingleKeyNodeFactory::createNode(osgEarth::TileKey const&, bool, bool, osgEarth::ProgressCallback*)
#4    Object "/usr/lib/osgPlugins-3.3.3/osgdb_osgearth_engine_mp.so", at 0x7fa25edf56c7, in osgEarth::Drivers::MPTerrainEngine::TileModelFactory::createTileModel(osgEarth::TileKey const&, osgEarth::MapFrame const&, bool, osg::ref_ptr<osgEarth::Drivers::MPTerrainEngine::TileModel>&, osgEarth::ProgressCallback*)
#3    Object "/usr/lib/libosgEarth.so.2.6.0", at 0x7fa27a776d8e, in osgEarth::ImageLayer::createImageInNativeProfile(osgEarth::TileKey const&, osgEarth::ProgressCallback*)
#2    Object "/usr/lib/libosgEarth.so.2.6.0", at 0x7fa27a779848, in osgEarth::ImageMosaic::createImage()
#1    Object "/usr/lib/libosgEarth.so.2.6.0", at 0x7fa27a78088c, in osgEarth::ImageUtils::copyAsSubImage(osg::Image const*, osg::Image*, int, int)
#0    Object "/lib/x86_64-linux-gnu/libc-2.19.so", at 0x7fa27c873b80, in
gwaldron commented 9 years ago

Does this happen with one of the stock earth files?

jklimke commented 9 years ago

I didn't try one of them. Unfortunately it is very hard to reproduce. I just noticed it crashing my application. It could be, that one of the images that should be composed is not available (e.g., http failure or an image file does not exist)

gwaldron commented 9 years ago

I assume you're using a Mercator source?

jklimke commented 9 years ago

Yes, there are two mercator TMS image layers in my earth file. It might happen that there are missing tiles for both of the sources (due a little wonky map generation process).

gwaldron commented 9 years ago

Should be straightforward to debug into the method and see if there's an index out of bounds or something.

gwaldron commented 9 years ago

Any update on this?