[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#134262: g++-3.0: Use of dynamic_cast makes compiled program segfault



Daniel Sjölie <deepone@acc.umu.se> writes:

> 0x400a9c59 in osgDB::ReaderWriter::ReadResult::getNode() (this=0xbffff2a0)
>     at /home/source/osg/cvs/include/osgDB/ReaderWriter:64
> 64                      osg::Node* getNode() { return dynamic_cast<osg::Node*>(_object.get()); }
> (gdb) s
> 
> Program received signal SIGSEGV, Segmentation fault.

Can you give a precise specification of the source code you have
compiled to generate this problem?

Are you sure that you are not invoking undefined behaviour? More
specifically, are you sure that 0x808f170 really represents an
osg::Object* to an object that has been allocated but not yet deleted?

If this address was a pointer to some character string, or to
something that is not an osg::Object, or delete was already executed
for the pointer, then the crash would be completely understandable,
and would indicate a bug in the application. A dynamic_cast has
undefined behaviour if the static type of its argument is incorrect.

Regards,
Martin



Reply to: