[Solved] crash on exit while deleting collisionconfig

serengeor
Posts: 22
Joined: Mon Dec 20, 2010 7:13 pm

[Solved] crash on exit while deleting collisionconfig

Post by serengeor »

My app is crashing at application exit, and it seems to be something with bullet because the last calls on call stack are made by bullet.
Image

I'm using bullet 2.78, on linux.

Any hints on what could be wrong are more than welcome
Last edited by serengeor on Fri Apr 22, 2011 11:56 am, edited 4 times in total.
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm

Re: Help, crash on app exit.

Post by dphil »

Not sure, though perhaps you could double check proper memory management in your program, particularly related to SB info. It seems to be accessing out of bounds memory when getting rid of a btSparseSdf data member.
serengeor
Posts: 22
Joined: Mon Dec 20, 2010 7:13 pm

Re: Help, crash on app exit.

Post by serengeor »

How do I actually use the btSoftBodyWorldInfo?
What do I need to do with it when I Initialize my physics, and when I destroy my physics world?
I can't really tell whats needed to be done with it from SoftBody samples as it is poorly commented, and api doesn't have comments at all on this.

EDIT: Hm, now I think I found what might have been causing these crashes though not sure why would that happen.
I set up my btSoftBodyWorldInfo by using

Code: Select all

m_softBodyWorldInfo=m_world->getWorldInfo();
Is that bad?

Also it sometimes crashes on deleting m_collisionConfiguration. :?
serengeor
Posts: 22
Joined: Mon Dec 20, 2010 7:13 pm

Re: [Help!!!] crash on app exit, while deleting collisioncon

Post by serengeor »

bump.

I need to know whats causing this, because I can't continue working on my project :oops:
The only problem now is that my application sometimes crashes(segfaults) at exit while deleting btSoftBodyRigidBodyCollisionConfiguration.
Maybe its a bug with 2.78 bullet?

Here's my constructor,destructor of physics manager I have, maybe its related to it, though I doubt it:
http://pastebin.com/ALLkpAAh
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm

Re: [Help!!!] crash on app exit, while deleting collisioncon

Post by dphil »

:? Hm, perhaps you could make sure you are cleaning up your memory in the right order. Take a look at the Hello World example as a guide.
serengeor
Posts: 22
Joined: Mon Dec 20, 2010 7:13 pm

Re: [Help!!!] crash on app exit, while deleting collisioncon

Post by serengeor »

dphil wrote::? Hm, perhaps you could make sure you are cleaning up your memory in the right order. Take a look at the Hello World example as a guide.
Yeah, still the same behaviuor:

Code: Select all

    if(m_world)
    delete m_world;

    if(m_solver)
    delete m_solver;

    if(m_collisionConfiguration)
    delete m_collisionConfiguration;

    if(m_dispatcher)
    delete m_dispatcher;

    if(m_broadPhase)
    delete m_broadPhase;

    if(m_ghostPairCallback)
    delete m_ghostPairCallback;
and I don't f***ing understand why its different in other tutorials then..(sorry, but I'm loosing my nerves as I can't fix it the whole day and nobody can help,,)
Taken from soft body tutorial:

Code: Select all

	//delete dynamics world
	delete m_dynamicsWorld;

	//delete solver
	delete m_solver;

	//delete broadphase
	delete m_broadphase;

	//delete dispatcher
	delete m_dispatcher;



	delete m_collisionConfiguration;
serengeor
Posts: 22
Joined: Mon Dec 20, 2010 7:13 pm

Re: [help] crash on exit while deleting collisionconfig

Post by serengeor »

I think I found whats causing it, though I don't really understand why its causing it..
What I had before in my scene was one box rigid body, two sphere rigid bodies and one trimesh rigid body.
Once I removed trimesh rigid body and tested the app it didn't crash as much as I've tried.

Do I need to post my code of how I add/delete the trimesh body?

EDIT: Sorry for spamming the thread a lot, I've fixed my problem. It was my coding error, which resulted in this random behaviour of bullet.

This thread may be closed, if needed.