Problem when running od_main in debug (compiled with Visual Studio 2017)

22 views
Skip to first unread message

Henrique Mageste

unread,
Sep 30, 2019, 3:51:23 PM9/30/19
to OpendTect Developers
Hello,

Trying to run a compiled version of trunk in debug is throwing the following exception at src\external\osgGeo\src\osgGeo\LayeredTexture.cpp (line 3732):

Code:
REGISTER_EMPTY_OBJECT_WRAPPER( LayeredTexture_Wrapper,
                        new osgGeo::LayeredTexture,
                        osgGeo::LayeredTexture,
                        "osg::Object osgGeo::LayeredTexture");

Exception:
Unhandled exception at 0x00007FFA1F1AA839 in od_main.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x000000BA8ADFE6F0

It seems to be a problem in the way custom OpenSceneGraph objects are registered with the OSG macro REGISTER_OBJECT_WRAPPER. Did anyone experience this issue?

Release version is working fine.

Best regards,

-- 
Henrique

Henrique Mageste

unread,
Oct 2, 2019, 3:50:47 AM10/2/19
to OpendTect Developers
Fixed the problem. I made a mistake in the CMake configuration regarding the place to dump the debug files for OpenSceneGraph. At the end, I ended up linking OD debug binaries with OSG release binaries.

The error that I got above was just a side effect of that, probably due to incompatible implementations of types in debug vs release (like mixing STL debug/release libraries which would hurt the ODR rule).

-- 
Henrique
Reply all
Reply to author
Forward
0 new messages