Page 1 of 1
[UNSOLVED] Possible bug in Root destruction
Posted: Mon Feb 14, 2005 2:01 pm
by Navarre.it
I'm having a crash happening for no apparent reason:
1. Open Demo_Gui sample;
2. Paste these lines at the end of GuiApplication::createScene():
Code: Select all
Ogre::SceneManager *pSceneMgr = mSceneMgr;
Ogre::Entity *pkEntity = pSceneMgr->createEntity( "Test278y3b23gh", "ninja.mesh" );
Ogre::SceneNode *pkNode = pSceneMgr->getRootSceneNode()->createChildSceneNode( "TestNode" );
pkNode->attachObject( pkEntity );
Ogre::AnimationState *pkState = pkEntity->getAnimationState("Walk");
pkState->setEnabled(true);
3. Compile & execute;
4. Quit & Crash.
Why is this
@Administrator: I think my former account (Navarre) is considered inactive: can you reactivate it?
Posted: Mon Feb 14, 2005 2:23 pm
by monster
Where exactly (use the debugger) does it crash?
My money's on pkEntity not having a "Walk" animation state, so pkState is null when you try to call setEnabled(true) on it.
Posted: Mon Feb 14, 2005 2:38 pm
by Navarre.it
Hi Monster,
I'm now recompiling the whole lib with STLport to make sure nothing strange is happening. Thanks for the prompt reply, too.
However, I had crashes during the destruction of Root, in particular the destruction of Vertex Buffers. Moreover, the mesh has a Walk state (it's the ninja or robot); and I had crashes even without the animstate code (just entity attachment seems to cause this.
However I invite you to follow the steps I detailed above to see if you have this crash too: can it possibly be a bug?
Posted: Mon Feb 14, 2005 2:40 pm
by monster
can it possibly be a bug?
Possibly. However
I invite
you to use your debugger and obtain us a precise location of the crash and a call stack at that point, together with the values of any relevant variables.

Posted: Mon Feb 14, 2005 2:45 pm
by Navarre.it
Yes I forgot to say that upon rebuilding completion I would have posted those informations, sorry

Posted: Mon Feb 14, 2005 4:14 pm
by Navarre.it
I have deleted the whole ogrenew folder, rebuilt stlport anew, rebuilt ogre anew; all the samples run correctly except demo_gui which say that it can't find the right entry point in OgreMain_d.dll (all other samples does). Does CEGUI has something to set up when STLport is included?
#Edit: Forgot to mention that I'm using OgreRC1.
Posted: Mon Feb 14, 2005 5:27 pm
by Navarre.it
I reverted to OgreRC1 built without STLport, with VC7.1.
The crashOnExit issue continues showing up.
Here follows a detailed description:
To cause the error, open the Gui sample in Samples directory and paste these lines at the end of GuiApplication::createScene():
Code: Select all
Ogre::SceneManager *pSceneMgr = mSceneMgr;
Ogre::Entity *pkEntity = pSceneMgr->createEntity("TestEntity", "robot.mesh");
Ogre::SceneNode *pkNode = pSceneMgr->getRootSceneNode()->createChildSceneNode("TestNode");
pkNode->attachObject(pkEntity);
Run & close the application, I have a crash:
Code: Select all
Eccezione non gestita a 0x10419beb (OgreMain_d.dll) in Demo_Gui.exe: 0xC0000005: Violazione di accesso nella lettura del percorso 0x00000004.
which in english sounds like:
Code: Select all
Unmanaged exception a 0x10419beb (OgreMain_d.dll) in Demo_Gui.exe: 0xC0000005: Access violation in reading path 0x00000004.
Call stack is:
Code: Select all
> OgreMain_d.dll!std::_Tree<std::_Tset_traits<Ogre::HardwareVertexBuffer *,std::less<Ogre::HardwareVertexBuffer *>,std::allocator<Ogre::HardwareVertexBuffer *>,0> >::_Lbound(Ogre::HardwareVertexBuffer * const & _Keyval=0x0364a178) Riga 988 + 0x8 C++
OgreMain_d.dll!std::_Tree<std::_Tset_traits<Ogre::HardwareVertexBuffer *,std::less<Ogre::HardwareVertexBuffer *>,std::allocator<Ogre::HardwareVertexBuffer *>,0> >::lower_bound(Ogre::HardwareVertexBuffer * const & _Keyval=0x0364a178) Riga 810 + 0xc C++
OgreMain_d.dll!std::_Tree<std::_Tset_traits<Ogre::HardwareVertexBuffer *,std::less<Ogre::HardwareVertexBuffer *>,std::allocator<Ogre::HardwareVertexBuffer *>,0> >::find(Ogre::HardwareVertexBuffer * const & _Keyval=0x0364a178) Riga 790 C++
OgreMain_d.dll!Ogre::HardwareBufferManager::_notifyVertexBufferDestroyed(Ogre::HardwareVertexBuffer * buf=0x0364a178) Riga 279 C++
OgreMain_d.dll!Ogre::HardwareVertexBuffer::~HardwareVertexBuffer() Riga 62 C++
RenderSystem_Direct3D9.dll!Ogre::D3D9HardwareVertexBuffer::~D3D9HardwareVertexBuffer() Riga 66 + 0x12 C++
RenderSystem_Direct3D9.dll!Ogre::D3D9HardwareVertexBuffer::`scalar deleting destructor'() + 0x2b C++
OgreMain_d.dll!Ogre::SharedPtr<Ogre::HardwareVertexBuffer>::destroy() Riga 149 + 0x6b C++
OgreMain_d.dll!Ogre::SharedPtr<Ogre::HardwareVertexBuffer>::release() Riga 140 + 0xd C++
OgreMain_d.dll!Ogre::SharedPtr<Ogre::HardwareVertexBuffer>::~SharedPtr<Ogre::HardwareVertexBuffer>() Riga 89 C++
OgreMain_d.dll!Ogre::HardwareVertexBufferSharedPtr::~HardwareVertexBufferSharedPtr() + 0x2b C++
OgreMain_d.dll!Ogre::HardwareBufferManager::VertexBufferLicense::~VertexBufferLicense() + 0x2e C++
OgreMain_d.dll!Ogre::HardwareBufferManager::VertexBufferLicense::`scalar deleting destructor'() + 0x2b C++
OgreMain_d.dll!std::_Destroy<Ogre::HardwareBufferManager::VertexBufferLicense>(Ogre::HardwareBufferManager::VertexBufferLicense * _Ptr=0x0360f6e0) Riga 50 C++
OgreMain_d.dll!std::allocator<Ogre::HardwareBufferManager::VertexBufferLicense>::destroy(Ogre::HardwareBufferManager::VertexBufferLicense * _Ptr=0x0360f6e0) Riga 152 + 0x9 C++
OgreMain_d.dll!std::_Destroy_range<Ogre::HardwareBufferManager::VertexBufferLicense,std::allocator<Ogre::HardwareBufferManager::VertexBufferLicense> >(Ogre::HardwareBufferManager::VertexBufferLicense * _First=0x0360f6e0, Ogre::HardwareBufferManager::VertexBufferLicense * _Last=0x0360f6f8, std::allocator<Ogre::HardwareBufferManager::VertexBufferLicense> & _Al={...}, std::_Nonscalar_ptr_iterator_tag __formal={...}) Riga 226 + 0xc C++
OgreMain_d.dll!std::_Destroy_range<Ogre::HardwareBufferManager::VertexBufferLicense,std::allocator<Ogre::HardwareBufferManager::VertexBufferLicense> >(Ogre::HardwareBufferManager::VertexBufferLicense * _First=0x0360f6e0, Ogre::HardwareBufferManager::VertexBufferLicense * _Last=0x0360f6f8, std::allocator<Ogre::HardwareBufferManager::VertexBufferLicense> & _Al={...}) Riga 217 + 0x2e C++
OgreMain_d.dll!std::vector<Ogre::HardwareBufferManager::VertexBufferLicense,std::allocator<Ogre::HardwareBufferManager::VertexBufferLicense> >::_Destroy(Ogre::HardwareBufferManager::VertexBufferLicense * _First=0x0360f6e0, Ogre::HardwareBufferManager::VertexBufferLicense * _Last=0x0360f6f8) Riga 787 + 0x11 C++
OgreMain_d.dll!std::vector<Ogre::HardwareBufferManager::VertexBufferLicense,std::allocator<Ogre::HardwareBufferManager::VertexBufferLicense> >::_Tidy() Riga 795 C++
OgreMain_d.dll!std::vector<Ogre::HardwareBufferManager::VertexBufferLicense,std::allocator<Ogre::HardwareBufferManager::VertexBufferLicense> >::~vector<Ogre::HardwareBufferManager::VertexBufferLicense,std::allocator<Ogre::HardwareBufferManager::VertexBufferLicense> >() Riga 389 C++
OgreMain_d.dll!Ogre::HardwareBufferManager::~HardwareBufferManager() Riga 61 + 0x2d C++
RenderSystem_Direct3D9.dll!Ogre::D3D9HardwareBufferManager::~D3D9HardwareBufferManager() Riga 41 + 0x12 C++
RenderSystem_Direct3D9.dll!Ogre::D3D9HardwareBufferManager::`scalar deleting destructor'() + 0x2b C++
RenderSystem_Direct3D9.dll!Ogre::D3D9RenderSystem::~D3D9RenderSystem() Riga 128 + 0x98 C++
RenderSystem_Direct3D9.dll!Ogre::D3D9RenderSystem::`scalar deleting destructor'() + 0x2b C++
RenderSystem_Direct3D9.dll!dllStopPlugin() Riga 50 + 0x84 C++
OgreMain_d.dll!Ogre::Root::unloadPlugins() Riga 693 + 0x5 C++
OgreMain_d.dll!Ogre::Root::~Root() Riga 264 C++
Demo_Gui.exe!Ogre::Root::`scalar deleting destructor'() + 0x2e C++
Demo_Gui.exe!ExampleApplication::~ExampleApplication() Riga 49 + 0x76 C++
Demo_Gui.exe!GuiApplication::~GuiApplication() Riga 197 + 0x1e C++
Demo_Gui.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * __formal=0x00000000, char * strCmdLine=0x00141f1d, HINSTANCE__ * __formal=0x00000000) Riga 588 + 0x19 C++
Demo_Gui.exe!WinMainCRTStartup() Riga 390 + 0x39 C
kernel32.dll!7c816d4f()
ntdll.dll!7c925b4f()
kernel32.dll!7c8399f3()
I can reproduce this bug at will, so please ask for further informations if you need them! Isn't it very strange?
Posted: Mon Feb 14, 2005 8:47 pm
by Navarre.it
I still couldn't figure out what's wrong in these 4 lines of code. If they're correct, this can be a really serious issue! Anyone?
Posted: Mon Feb 14, 2005 11:17 pm
by sinbad
Those 4 lines work perfectly for me, sorry. No-one else is reporting any issues at this stage.
Posted: Mon Feb 14, 2005 11:34 pm
by Navarre.it
I tried my binary on another PC (different HW) and it still crashes on exit, so it can't even be some driver issue. These 4 lines work for Sinbad (and for anyone else I suppose) so it *must* be something with my libs/windows installation/overall setup.
I'll keep you posted...
Posted: Tue Feb 15, 2005 10:29 am
by spookyboo
Which stlport version do you use? I was using 4.5.3 but this doesn't work with the GUI demo (it only complained about the .dll though, I didn't have the problems you are describing). Maybe you should build Ogre with the 4.6.2 version.
Posted: Tue Feb 15, 2005 1:37 pm
by Robomaniac
GUI demo works fine for me!
Posted: Tue Feb 15, 2005 3:14 pm
by Navarre.it
I tried to compile OGRE with STLPort 4.6.2 and everything BUT the GUIDemo compiled fine.
Now I'm without STLPort (GUIDemo compiles), and the above results refer to this case. Even if compiling, it crashes on exit. By now I can't reinstall my whole system, so I'll have to wait to solve this issue! Thanks anyway

Posted: Tue Feb 15, 2005 5:06 pm
by _lkoikm
it crashes all the times?
if it is so try to disable some lines of code to trace if some sub part causes the problem ... that would be handy.
Posted: Tue Feb 15, 2005 6:10 pm
by Navarre.it
Poorly, it crashes all the times; moreover, the crash does not happen on those lines but just when I shutdown the application. Specifically, it's the entity attachment the reason of these crashes (if I don't attach the entity to the node, no crash happens on exit).
Posted: Tue Feb 15, 2005 10:41 pm
by sinbad
Argh, I'm a fool. The reason the people here aren't seeing this is because this was a bug I fixed very soon after RC1 - I don't think it manifested itself quite like this, but I'm pretty sure it's the same thing. If you update to the latest CVS version you probably won't have the problem anymore.
Posted: Wed Feb 16, 2005 2:31 am
by Navarre.it
I'll let you know as soon as I can get my hands on it. Thank your very much for the support!

Posted: Wed Feb 16, 2005 3:03 pm
by sinbad
Make sure you update to the 'v1-0' branch which contains all the bugfixes, I haven't merged to HEAD yet.