OsgBullet __non_rtti_object exception

89 views
Skip to first unread message

David Cofer

unread,
Aug 24, 2013, 6:03:31 PM8/24/13
to osgbull...@googlegroups.com
I have just started trying to get OsgBullet 2.0 up and running on Windows 7 in Visual studio 10. I downloaded the source for the dependencies (OSG 2.8.3, bullet 2.79, and OsgWorks 2.0). I used cmake on each to get them to compile and run some of the samples. I also used Cmake to get OsgBullet to compile and start running. However, when I try and run the example apps within OsgBullet I am getting the exception shown below. It is happening for a variety of method calls, but so far they all appear to be related to creating an osg node from a bullet physics object, like osgbDynamics::generateGroundPlane. I checked and it seems like all the libraries this is dependent on are setting the RTTI info enabled to true. So I am stumped on why I am getting this exception. Has anyone else run into this before?

Unhandled exception at 0x77a915de in hinged.exe: Microsoft C++ exception: std::__non_rtti_object at memory location 0x00e4f1b8..

David Cofer

unread,
Aug 25, 2013, 10:26:31 AM8/25/13
to osgbull...@googlegroups.com
I investigated this a little more and it looks like it is actually getting a access violation first and then is getting the rtti exception. (First-chance exception at 0x101cd5d9 (msvcr100d.dll) in BasicDemod.exe: 0xC0000005: Access violation reading location 0x34000004.). Specifically, I am running the Example Basic Demo and it is dying on this command:

    btCollisionShape * collision = osgbCollision::btConvexTriMeshCollisionShapeFromOSG( node.get() );

I traced into it and when it does the following dynamic conversion is when it blows up.

osg::Node* osgNodeFromBtCollisionShape( const btConvexTriangleMeshShape* btTriMesh, const btTransform& trans )
{
    const btTriangleMesh* mesh = dynamic_cast< const btTriangleMesh* >( btTriMesh->getMeshInterface() );

I would really like to OsgBullet in my project, but I am kind of stumped now as to how to get the basic examples that come with it working. Any ideas on things I could try?

Thanks

David Cofer

unread,
Aug 25, 2013, 5:34:17 PM8/25/13
to osgbull...@googlegroups.com
After much frustrating messing with this I decided to try an older version of bullet (2.76) instead of the 2.79 that the compatability matrix says it will work with. When I did this then the access violations disappeared and the examples compile and run correctly. So it looks like bullet 2.79 is not compatible with OsgBullet 2.0. I am going to get the 2.77, and 2.78 to find the latest version that will run with OsgBullet.

On Saturday, August 24, 2013 5:03:31 PM UTC-5, David Cofer wrote:

Paul Martz

unread,
Aug 25, 2013, 9:00:55 PM8/25/13
to osgbull...@googlegroups.com
Hi David -- I have never encountered the issue you're describing in my work with osgBullet. But clearly, if you built a project with RTTI disabled, then dynamic_cast would fail. This is true of any project, not just osgBullet.

I'm currently using Bullet 2.80, osgBullet trunk, OSG 2.8.5, and VS 2012. I've built Bullet with double precision enabled and also selected MS CRT DLL. I have 64-bit binaries. It's unlikely I'll have any time in the near future to attempt to reproduce your issue with VS 2010, Bullet 2.79, osgBullet 2.0, and OSG 2.8.3, so you're pretty much on your own for this.

You've mentioned only 'd' Debug executables; is the problem specific to Debug builds?

Are you getting any warnings during link?

You say the problem is related to RTTI, but you didn't mention that you verified the link lines of all three projects to ensure /GR was present (or whatever the option is to enable RTTI in Visual Studio), so that's probably worth checking.


--
You received this message because you are subscribed to the Google Groups "osgbullet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osgbullet-use...@googlegroups.com.
To post to this group, send email to osgbull...@googlegroups.com.
Visit this group at http://groups.google.com/group/osgbullet-users.
For more options, visit https://groups.google.com/groups/opt_out.



--
Paul Martz
Skew Matrix Software LLC

David Cofer

unread,
Nov 23, 2013, 8:46:18 AM11/23/13
to osgbull...@googlegroups.com
I needed to move up to the latest code so I decided to look into this a little more and figured out what the problem was. I assume you are using cmake for bullet. I was using the premake scripts to generate my bullet projects for visual studio. Within the premake script it explicitly turns off RTTI compilation. When I fixed this and made sure it compiled with RTTI it resolved this issue and I was able to get all the examples to run. Thanks for your help.

Paul Martz

unread,
Nov 23, 2013, 1:08:35 PM11/23/13
to osgbull...@googlegroups.com
Great! Glad you found a fix.


On Sat, Nov 23, 2013 at 6:46 AM, David Cofer <davidc...@gmail.com> wrote:
I needed to move up to the latest code so I decided to look into this a little more and figured out what the problem was. I assume you are using cmake for bullet. I was using the premake scripts to generate my bullet projects for visual studio. Within the premake script it explicitly turns off RTTI compilation. When I fixed this and made sure it compiled with RTTI it resolved this issue and I was able to get all the examples to run. Thanks for your help.

--
You received this message because you are subscribed to the Google Groups "osgbullet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osgbullet-use...@googlegroups.com.
To post to this group, send email to osgbull...@googlegroups.com.
Visit this group at http://groups.google.com/group/osgbullet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Paul Martz

unread,
Nov 23, 2013, 1:13:26 PM11/23/13
to osgbull...@googlegroups.com
I've made a note on the wiki that Bullet should be built from CMake:
Reply all
Reply to author
Forward
0 new messages