Quantcast

osgEarth::Config copy-ctor crash in release mode before main is reached

classic Classic list List threaded Threaded
5 messages Options
John Larring John Larring
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

osgEarth::Config copy-ctor crash in release mode before main is reached

Hi,

When using including and using osgEarth 2.8 in an application project, we experience crach in osgEarth::Config copy constructor at application start up before main() is reached. However, this only happens when the project  (and osgEarth ) is compiled in release mode. In debug mode, it behaves as expected. Stack trace is pasted below.

Best regards,
John

Context:
* Centos 7, kernel  3.10.0-514.6.1.el7.x86_64, gcc 4.8.5, libstdc++ 4.8.5-11, glibc 2.17-157

1  std::string::basic_string(std::string const&)   0x7fffe4272f4b
2  pair  stl_pair.h      127  0x7ffff60a4085
3  _Rb_tree_node<std::pair<std::string const, osg::ref_ptr<osg::Referenced>> const&> stl_tree.h      140  0x7ffff60a4085
4  construct<std::_Rb_tree_node<std::pair<std::stringconst, osg::ref_ptr<osg::Referenced>>>, std::pair<std::string const, osg::ref_ptr<osg::Referenced>> const&>  new_allocator.h 120  0x7ffff60a4085
5  _S_construct<std::_Rb_tree_node<std::pair<std::stringconst, osg::ref_ptr<osg::Referenced>>>, std::pair<std::string const, osg::ref_ptr<osg::Referenced>> const&> alloc_traits.h  254  0x7ffff60a4085
6  construct<std::_Rb_tree_node<std::pair<std::stringconst, osg::ref_ptr<osg::Referenced>>>, std::pair<std::string const, osg::ref_ptr<osg::Referenced>> const&> alloc_traits.h  393  0x7ffff60a4085
7  std::_Rb_tree<std::string, std::pair<std::string const, osg::ref_ptr<osg::Referenced>>, std::_Select1st<std::pair<std::string const, osg::ref_ptr<osg::Referenced>>>, std::less<std::string>, std::allocator<std::pair<std::string const, osg::ref_ptr<osg::Referenced>>>>::_M_create_node<std::pair<std::string const, osg::ref_ptr<osg::Referenced>> const&> stl_tree.h      406  0x7ffff60a4085
8  _M_clone_node  stl_tree.h      429  0x7ffff60a40ea
9  std::_Rb_tree<std::string, std::pair<std::string const, osg::ref_ptr<osg::Referenced>>, std::_Select1st<std::pair<std::string const, osg::ref_ptr<osg::Referenced>>>, std::less<std::string>, std::allocator<std::pair<std::string const, osg::ref_ptr<osg::Referenced>>>>::_M_copy   stl_tree.h      1087 0x7ffff60a40ea
10 _Rb_tree  stl_tree.h      659  0x7ffff60a431d
11 map  stl_map.h       181  0x7ffff60a431d
12 osgEarth::Config::Config  Config          66   0x7ffff60a431d
13 _GLOBAL__sub_I_MapNodeOptions.cpp  0x7ffff0012c19
14 _dl_init_internal  0x7ffff7dec1e3
15 _dl_start_user  0x7ffff7dde21a
16 ??  0x4            
17 ??  0x7fffffffe4d0
18 ??  0x7fffffffe51b
19 ??  0x7fffffffe51e
20 ??  0x7fffffffe525
21 ??                                                                                                                                                                                                                                                                                                                                                                                                
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: osgEarth::Config copy-ctor crash in release mode before main is reached

John,
Please try something for me:

In MapNodeOptions.cpp, can you find the static global "s_defaultTerrainOptions" variable, and move that to be a class member of MapNodeOptions. Let me know if that works.
Glenn Waldron / Pelican Mapping / @glennwaldron
John Larring John Larring
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: osgEarth::Config copy-ctor crash in release mode before main is reached

Hi Glenn,

Thanks for your reply. Your suggestion sounded promissing, but it unfortunately it did not help. The crash and stack trace in release mode is still the same (debug works). First I tried to make s_defaultTerrainOptions a static member of MapNodeOptions instead of a static global, but it did not help. I also tried to make s_defaultTerrainOptions a static local in MapNodeOptions::getTerrainOptions(), but that did not help either.  I also tried to connect out both the definition and  implementation of the static MapNodeOptions::OPTIONS_TAG since it is not in use, but still no luck.

In release mode the application still crashes before main is reached:
....
10  _Rb_tree stl_tree.h      659  0x7ffff60a431d
11  map  stl_map.h       181  0x7ffff60a431d
12  osgEarth::Config::Config Config          66   0x7ffff60a431d
13  _GLOBAL__sub_I_MapNodeOptions.cpp  0x7ffff0012c19
14  _dl_init_internal 0x7ffff7dec1e3
15  _dl_start_user 0x7ffff7dde21a
...

Best regards,
John
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: osgEarth::Config copy-ctor crash in release mode before main is reached

John,
I was unclear. I wanted you to make it a NON-static class member variable of MapNodeOptions.
Glenn Waldron / Pelican Mapping / @glennwaldron
John Larring John Larring
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: osgEarth::Config copy-ctor crash in release mode before main is reached

gwaldron wrote
I was unclear. I wanted you to make it a NON-static class member variable of MapNodeOptions.
Ok, tried that too, but still no cigar :-(
Loading...