Critter::RenderSystem heap error

lordmonkey

19-04-2011 15:24:10

Hello,
I have a small problem. I was trying to implement some new functionalities into my ogre application and then suddenly i got this heap error :


I removed all the added coded to return to previous version and ... boom ... the error remains.

I have tracked it down and I know that the error comes from the this line :
mRenderSystem = new Critter::RenderSystem(mNxScene, mSceneMgr);

while
Critter::RenderSystem* mRenderSystem;
NxOgre::World* mNxWorld;
NxOgre::Scene* mNxScene;


and this is the small amount of code I use with this (but I think it is not really relevant) (i put this just in case)
mNxWorld = NxOgre::World::createWorld(); //("time-controller:ogre, log:yes");
mNxWorld->getRemoteDebugger()->connect();

NxOgre::SceneDescription sceneDesc;
sceneDesc.mGravity = NxOgre::Constants::MEAN_EARTH_GRAVITY;
sceneDesc.mUseHardware = false;
sceneDesc.mName = "NxScene1";

mNxScene = mNxWorld->createScene(sceneDesc);

mNxScene->getMaterial(0)->setStaticFriction(0.5);
mNxScene->getMaterial(0)->setDynamicFriction(0.5);
mNxScene->getMaterial(0)->setRestitution(0.25);


Any ideas what might be wrong ?

betajaen

19-04-2011 15:42:59

Are the pointers your giving into RenderSystem null or invalid? It sounds like it.

lordmonkey

19-04-2011 16:39:15

I think the pointers are ok. here are screenshots from breakpoints :

and after creating rendersystem


anyway the problem arises after exiting the app not creating the rendersystem.

lordmonkey

19-04-2011 22:53:15

Sorry for double posting but I think that this might be useful for somebody.
I solved the problem by placing the creation of render system after this lines :
// create a floor entity, give it a material, and place it at the origin
Entity* floor = mSceneMgr->createEntity("Floor", "floor");
floor->setMaterialName("ground-from-nxogre.org");
floor->setCastShadows(true);
mSceneMgr->getRootSceneNode()->attachObject(floor);
mNxScene->createSceneGeometry( NxOgre::PlaneGeometryDescription() );

//-------Create the Critter::RenderSystem------------------------------
mRenderSystem = new Critter::RenderSystem(mNxScene, mSceneMgr);


any ideas why it works like this and not in other way ?

hvalola

26-07-2011 10:40:38

hi
I'm getting t he same error. a tried your method but changing the order
of the lines was not successful any help

hvalola

27-07-2011 09:19:35

hi

no reply for the post i tried everything
but i am hopeless

i am pretty sure that it is something to do with critter render system
any help

betajaen

27-07-2011 13:28:56

It really sounds like some uninitialized pointers are being passed into it.

Heap errors are very specific errors, difficult to trace. But since the point of contact between your Application and RenderSystem is the constructor, I'd investigate to see if those pointers given to it, are actually what they say they are.

It is also highly unlikely that Critter is responsible for those errors; as it's been tested thousands of times using stable code. So you should look at your application, and just juggle initialisation/setup code around.

hvalola

02-08-2011 14:30:45

hi
i think it is because of the rendersystem
Im trying to integrate nxogre with hydrax
but hydrax is based on exampleframelistner not sdksamples
I know OGRE3DRenderSystem(in earlier version of nxogre) works perfectly with hydrax
is there a way to use critter rendersystem with exampleframelistner or is it possible to use
OGRE3DRenderSystem with the latest nxogre

betajaen

02-08-2011 14:51:02

It isn't, I assure you. Critter does nothing untowards your application or behaves in un-C++ like manner that would cause a heap error.

Now, if you can prove it's Critter; i.e. find the actual offending line of code that causes the problem, it may be a different story.

And for the record; you can use any framework written by yourself or a third-party with NxOgre or Critter, it doesn't matter.

hvalola

03-08-2011 06:46:04

hi


error that i received fro the debug mode is
- container {mPtr=[...]() mReferences=??? } NxOgre::SharedPointer<std::map<enum NxOgre::Enums::Priority,NxOgre::TimeListenerGroup *,std::less<enum NxOgre::Enums::Priority>,std::allocator<std::pair<enum NxOgre::Enums::Priority const ,NxOgre::TimeListenerGroup *> > > >

any suggestions