Jekteir
23-07-2007 18:32:26
Hi, the Release build of my project (VC++2005) is crashing upon shutdown, but I can't debug that crash because my Debug build is crashing a little bit after load! I went into Debug mode for that crash, and it seems to be crashing after I try to load a sound with OgreAL (a sound which plays fine in the Release version).
Earlier in the code, in Core's constructor, I instantiated my OgreAL soundmanager, after Ogre's root was sorted out:
later, in the game loop, also in Core:
It's at this stage that the program crashes, and the debug stack trace looks like:
Now, at the Ogre code from the above line:
there's a comment in Ogre's code which reads:
Please note, however, that my program is not trying to shut down Ogre -- if any Ogre shutdowns are occurring they're due to OgreAL.
Would you be able to shed any light on which might be going wrong in this trace? The sound file in question is just a standard 44khz 16-bit WAVE file, with no spaces in the filename. It's not meant to be attached to an object -- it's just a test sound for during the flash screens. It's large, though: 63MB. It's a song :)
Thanks,
Jek
Earlier in the code, in Core's constructor, I instantiated my OgreAL soundmanager, after Ogre's root was sorted out:
sndMgr = new OgreAL::SoundManager();
later, in the game loop, also in Core:
ogre->loadResources("sound");
OgreAL::Sound *sound = sndMgr->createSound("Killed", "killedhim.wav", false);
//node->attachObject(sound);
sound->play();
It's at this stage that the program crashes, and the debug stack trace looks like:
Client.exe!_free_dbg_nolock(void * pUserData=0x016cfad8, int nBlockUse=1) Line 1279 + 0x30 bytes C++
Client.exe!_free_dbg(void * pUserData=0x016cfad8, int nBlockUse=1) Line 1220 + 0xd bytes C++
Client.exe!operator delete(void * pUserData=0x016cfad8) Line 54 + 0x10 bytes C++
Client.exe!std::allocator<Ogre::FileInfo>::deallocate(Ogre::FileInfo * _Ptr=0x016cfad8, unsigned int __formal=1) Line 141 + 0x9 bytes C++
Client.exe!std::vector<Ogre::FileInfo,std::allocator<Ogre::FileInfo> >::_Tidy() Line 1098 C++
Client.exe!std::vector<Ogre::FileInfo,std::allocator<Ogre::FileInfo> >::~vector<Ogre::FileInfo,std::allocator<Ogre::FileInfo> >() Line 547 C++
Client.exe!std::vector<Ogre::FileInfo,std::allocator<Ogre::FileInfo> >::`scalar deleting destructor'() + 0x2b bytes C++
Client.exe!Ogre::SharedPtr<std::vector<Ogre::FileInfo,std::allocator<Ogre::FileInfo> > >::destroy() Line 201 + 0x2e bytes C++
Client.exe!Ogre::SharedPtr<std::vector<Ogre::FileInfo,std::allocator<Ogre::FileInfo> > >::release() Line 190 + 0xf bytes C++
Client.exe!Ogre::SharedPtr<std::vector<Ogre::FileInfo,std::allocator<Ogre::FileInfo> > >::~SharedPtr<std::vector<Ogre::FileInfo,std::allocator<Ogre::FileInfo> > >() Line 130 C++
Client.exe!OgreAL::SoundManager::_createSound(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name="Killed", const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & fileName="killedhim.wav", bool loop=false) Line 276 + 0x27 bytes C++
Client.exe!OgreAL::SoundManager::createSound(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name="Killed", const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & fileName="killedhim.wav", bool loop=false, OgreAL::AudioFormat format=DEFAULT) Line 217 C++
Client.exe!Core::initialise() Line 228 + 0x52 bytes C++
Client.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * __formal=0x00000000, char * strCmdLine=0x00152342, HINSTANCE__ * __formal=0x00000000) Line 250 C++
Client.exe!__tmainCRTStartup() Line 324 + 0x35 bytes C
Client.exe!WinMainCRTStartup() Line 196 C
Now, at the Ogre code from the above line:
Client.exe!Ogre::SharedPtr<std::vector<Ogre::FileInfo,std::allocator<Ogre::FileInfo> > >::destroy() Line 201 + 0x2e bytes C++
there's a comment in Ogre's code which reads:
virtual void destroy(void)
{
// IF YOU GET A CRASH HERE, YOU FORGOT TO FREE UP POINTERS
// BEFORE SHUTTING OGRE DOWN
// Use setNull() before shutdown or make sure your pointer goes
// out of scope before OGRE shuts down to avoid this.
delete pRep;
delete pUseCount;
OGRE_DELETE_AUTO_SHARED_MUTEX
}
Please note, however, that my program is not trying to shut down Ogre -- if any Ogre shutdowns are occurring they're due to OgreAL.
Would you be able to shed any light on which might be going wrong in this trace? The sound file in question is just a standard 44khz 16-bit WAVE file, with no spaces in the filename. It's not meant to be attached to an object -- it's just a test sound for during the flash screens. It's large, though: 63MB. It's a song :)
Thanks,
Jek