instance_node segfault

Hi everyone,

i try to load a .dae file (let’s call it global.dae) with OpenSceneGraph (v2.6.1). Unfortunately during the load of the .dae file there is a segmentation fault…

After several test I identified that this segfault appears because of the call of instance_node like this : <instance_node url="./objects/external1.dae#car"/>. Indeed my global.dae file load external .dae files.

Of course i try to load the external .dae files and everything is ok.

I simplify the global .dae file to load external geometry with <instance_geometry …> and it works, so i don’t think there is a problem of URIResolver…

Is anyone can help me, because i’m close to get insane…

Thank you in advance,

a common way to narrow problems down would be:


Hi Sebastian and thank you for your answer.

First of all, here is my configuration details : ubuntu Hardy (8.04), collada dom 2.1 and openscenegraph 2.6.1.

I had a little of time to try what you propose. I run the coherencytest and i get some SCHEMA errors because of wrong attributes but and it’s probably more important, i obtain a seg fault when i simply check CIRCULR_REFERENCE.

I run the ConsoleViewer from the NVIDIA SG and i obtain this :

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid

I try also the google earth loader and there is a crash…

I don’t have the time yet for the debug build from osg, i hope for tomorrow.

I try to use “instance_node” with simple dae file found on the net like cow.dae, here is what i write in the <visual_scene> node of the first .dae file :

<node id="id3" name="cow.dae" sid="CO_0" type="NODE">
  <node id="id1631" sid="FileRef" type="NODE">
    <instance_node url="cow.dae#VisualSceneNode"/>

And there is a segfault.
But if i comment the <instance_node> the loading is ok and this the case also with my first .dae file.

Unfortunately i can’t post a link to the erroneous file but here is some lines :

<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="" version="1.4.1">
   <visual_scene id="VisualSceneNode" name="Scene1">
     <node id="id3" name="souf_dae" sid="CO_0" type="NODE">
       <node id="id1631" sid="FileRef" type="NODE">
         <matrix>1 0 -0.000251 -790.708 0 1 0.000068 216.782 0.000251 0 1 50.5316 0 0 0 1</matrix>
         <instance_node url="./objects/souf.dae#VisualSceneNode"/>
   <instance_visual_scene url="#VisualSceneNode"/>

I’m still working on it.
Thank you for your help

There is one error in your first .dae file. In an <instance_node> you have to reference a <node> element, but you are referencing “cow.dae#VisualSceneNode” which is a <visual_scene> element. This might cause NVIDIA SG to crash.

We have just tried to reproduce the crash of the coherency using the precompiled linux version available at sf. Is that the version you are using? We used the cow.dae file found here, but the coherencytest passed without any messages. Is that the cow.dae file you are using? If not, could you send us your cow.dae file and your complete first .dae file, at least a stripped down version that still produces the crash of the coherency test?

That’s IT !!! Thank you very much. The <instance_node> must reference the parent <node> under the <visual_scene>… now it works. The .dae they gave to me was crap…

Thank you again both of you. :smiley: