Just tried loading with different names for each loader, still same problem.scrawl wrote:Could it be possible that you load the same resource name with both loaders, and it gets double-freed on exit? Just guessing.
Making better use of Ogre's capbilities?
Re: Making better use of Ogre's capbilities?
Re: Making better use of Ogre's capbilities?
Still trying to figure out this crash problem.
Re: Making better use of Ogre's capbilities?
First, here is the gdb crashlog for everyone, just for the sake of completeness
So, the problem is apparently caused by the destructor of member NIFLoader::mSkel;
I've tried a few things without success yet, will keep trying.
Code: Select all
3 Ogre::Skeleton::~Skeleton() /usr/lib/libOgreMain.so.1.8.0 0 0x7ffff7a3db29
4 Ogre::SharedPtr<Ogre::Skeleton>::destroy OgreSharedPtr.h 232 0x84b1aa
5 Ogre::SharedPtr<Ogre::Skeleton>::release OgreSharedPtr.h 218 0x847a1e
6 Ogre::SharedPtr<Ogre::Skeleton>::~SharedPtr OgreSharedPtr.h 155 0x84792f
7 Ogre::SkeletonPtr::~SkeletonPtr OgreSkeleton.h 470 0x85b7c5
8 NifOgre::NIFLoader::~NIFLoader ogre_nif_loader.hpp 121 0x85b574
9 __run_exit_handlers /lib/libc.so.6 0 0x7ffff46b67c1
10 exit /lib/libc.so.6 0 0x7ffff46b6845
11 __libc_start_main /lib/libc.so.6 0 0x7ffff46a045c
12 _start 0 0x7dc2b5
I've tried a few things without success yet, will keep trying.
Re: Making better use of Ogre's capbilities?
I might have an idea.
The NIFLoader destructor is called by _run_exit_handlers (I'm guessing this deletes all static objects). And this is run _after_ the OGRE shutdown procedure. Judging from the Ogre.log produced by the crash, Ogre has already been shutdown completely:
It's not surprising that trying to delete a SkeletonPtr after
So I would say: Either store the SkeletonPtr only temporarily (set it to Null after a NIF was loaded), or destroy the NIF loader before ogre shuts down.
The NIFLoader destructor is called by _run_exit_handlers (I'm guessing this deletes all static objects). And this is run _after_ the OGRE shutdown procedure. Judging from the Ogre.log produced by the crash, Ogre has already been shutdown completely:
Code: Select all
22:46:18: *-*-* OGRE Shutdown
22:46:18: Unregistering ResourceManager for type Compositor
22:46:18: Unregistering ResourceManager for type Font
22:46:18: Unregistering ResourceManager for type Skeleton
22:46:18: Unregistering ResourceManager for type Mesh
22:46:18: Unregistering ResourceManager for type HighLevelGpuProgram
22:46:18: Uninstalling plugin: Cg Program Manager
22:46:18: Plugin successfully uninstalled
22:46:18: Unloading library /usr/lib/OGRE/Plugin_CgProgramManager
22:46:18: Uninstalling plugin: Octree Scene Manager
22:46:18: Plugin successfully uninstalled
22:46:18: Unloading library /usr/lib/OGRE/Plugin_OctreeSceneManager
22:46:18: Uninstalling plugin: ParticleFX
22:46:18: Plugin successfully uninstalled
22:46:18: Unloading library /usr/lib/OGRE/Plugin_ParticleFX
22:46:18: Uninstalling plugin: GL RenderSystem
22:46:18: Unregistering ResourceManager for type GpuProgram
22:46:18: ******************************
*** Stopping GLX Subsystem ***
******************************
22:46:18: Unregistering ResourceManager for type Texture
22:46:18: Plugin successfully uninstalled
22:46:18: Unloading library /usr/lib/OGRE/RenderSystem_GL
22:46:18: Unregistering ResourceManager for type Material
has already happened causes a crash.22:46:18: Unregistering ResourceManager for type Skeleton
So I would say: Either store the SkeletonPtr only temporarily (set it to Null after a NIF was loaded), or destroy the NIF loader before ogre shuts down.
Re: Making better use of Ogre's capbilities?
Thanks , will try it out in a sec. I need to definitely learn how to use gdb, I am poking around with everything trying to solve the problem.
Last edited by jhooks1 on 22 Jun 2012, 21:54, edited 1 time in total.
Re: Making better use of Ogre's capbilities?
putting mSkel.setNull(); at the bottom of NIFLoader::loadResource works, no crash
Re: Making better use of Ogre's capbilities?
Thanks dude
Re: Making better use of Ogre's capbilities?
gdb in a nutshell
Edit: weren't you on win?
Code: Select all
gdb ./openmw
run --debug
(wait until crash)
bt
Re: Making better use of Ogre's capbilities?
I'm on windows yes
Re: Making better use of Ogre's capbilities?
Well then you should probably use the VS Debugger, gdb would be for MinGW