NxOgre crashes every time!

DanielH

30-03-2008 18:13:20

Hello!

I've just started looking at NxOgre which looks great, but unfortunately it doesn't seem work at all for me. I've tried compiling Cakebox and it compiles fine but when I run it the compiler breaks because of an exception and in my output log I can read this.


First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012eafc..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e864..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e864..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e864..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
First-chance exception at 0x7c812a5b in Cakebox_debug.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0012e890..
HEAP[Cakebox_debug.exe]: Invalid Address specified to RtlValidateHeap( 012F0000, 03ABEAA0 )
Windows has triggered a breakpoint in Cakebox_debug.exe.

This may be due to a corruption of the heap, which indicates a bug in Cakebox_debug.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while Cakebox_debug.exe has focus.

The output window may have more diagnostic information.


I've also tried to use NxOgre within an Ogre application I've written before. But every time I try to create a body it crashes. Looking at my call stack it seems that the crash occurs within the standard string classes.

For example when I do this:


body = m_scene->createBody("name", new CubeShape(5, 5, 5),
NxOgre::Pose(m_camera->getPosition(), m_camera->getOrientation()));


The application does crash within createBody at the moment when it tries to free up the memory from the vector created in NxOgreActor.cpp [line 187]:


std::vector<NxString> splitID = Ogre::StringUtil::split(name, ";", 2);


The error I get in this case is

HEAP[PowerBlitz.exe]: Invalid Address specified to RtlValidateHeap( 01260000, 055A3420 )
Windows has triggered a breakpoint in PowerBlitz.exe.


Here is my callstack:

msvcr80d.dll!_free_dbg_nolock(void * pUserData=0x055a3440, int nBlockUse=1) Line 1252 + 0x9 bytes C++
msvcr80d.dll!_free_dbg(void * pUserData=0x055a3440, int nBlockUse=1) Line 1194 + 0xd bytes C++
> msvcr80d.dll!operator delete(void * pUserData=0x055a3440) Line 54 + 0x10 bytes C++
NxOgre_d.dll!std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::deallocate(std::basic_string<char,std::char_traits<char>,std::allocator<char> > * _Ptr="", unsigned int __formal=1) Line 141 + 0x9 bytes C++
NxOgre_d.dll!std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Tidy() Line 1098 C++
NxOgre_d.dll!std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >() Line 547 C++
NxOgre_d.dll!NxOgre::Actor::Actor(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name="name", NxOgre::Scene * scene=0x03cc96f8, NxOgre::ShapeBlueprint * shape=0x055a3228, const NxOgre::Pose & pose={...}, NxOgre::ActorParams params={...}) Line 242 C++
NxOgre_d.dll!NxOgre::Body::Body(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & identifier="name", NxOgre::Scene * scene=0x03cc96f8, NxOgre::ShapeBlueprint * firstShapeDescription=0x055a3228, const NxOgre::Pose & pose={...}, NxOgre::ActorParams params={...}) Line 42 + 0x81 bytes C++
NxOgre_d.dll!NxOgre::Scene::createBody(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & identifier="name", NxOgre::ShapeBlueprint * firstShapeDescription=0x055a3228, const NxOgre::Pose & pose={...}, NxOgre::ActorParams params={...}) Line 765 + 0x58 bytes C++



I've tried using both VC++ 2005 and 2008.

betajaen

30-03-2008 18:25:03

I very much doubt NxOgre is causing STL to go bonkers, and that piece of code is used by me several thousand times a day.

Let's get this out of the way;

- What are the versions? (Ogre, NxOgre and PhysX)
- Are you using Debug/Release
- Are you mixing Debug/Release dll's
- What does the ogre.log and nxogre.log say?
- Are you sure your using the right NxOgre.dll with your application?

DanielH

30-03-2008 19:17:15

Hi betajaen,

- I'm using:
* Ogre 1.4.7 prebuilt (for VC90)
* v2.7.2 PhysX
* 0.9-38 NxOgre (took it from SVN today)

- I've been compiling using Debug
- ogre.log says nothing interesting, it just ends abruptly after showing some information about loaded resources.
- Nxogre log shows no error eighter.
- I compiled NxOgre from the repository and put it together with my application. How could it be wrong?

I recompiled Cake now as released and ran it. Another crash in a place similiar to the one before.


Params::Parameters Params::fromString(const NxString& p) {
Parameters pm;
std::vector<NxString> d = Ogre::StringUtil::split(p,",");

for(std::vector<NxString>::iterator it = d.begin();it != d.end();++it) {
Parameter pa;
toParameter((*it), pa);
pm.push_back(pa);
}
return pm; <------ This is where Windows throws an exception
}


It's just so strange!

betajaen

30-03-2008 20:19:54

The only thing that makes me wonder; is the Visual Studio 2008 bit. Perhaps Microsoft has done something to the STL?

gugus

30-03-2008 20:43:17

I don't think so,it's working perfectly for me with VC9.It must be something else.

DanielH

02-04-2008 12:22:31

It works now. I don't know why it works but this is what I've done:

* Uninstalled old versions of VC++ (2005).
* Checked out the latest HEAD from Ogre and compiled it myself.
* Removed everything of NxOgre I had on my computer and then I checked out the latest version and compiled it.

After that it worked. However I still can't run Cakebox since it has some materials that needs shader programs that doesn't exist in eighter the cakebox nor the ogre media folders. I'm not at home and I don't really really remember what shader but it was "Ogre/DiffuseAndOneTexture" or something similiar. Where do I get it? When I did a checkout of ogrenew I didn't get any media folders...