[fixed]Occasional exception crash in CDMFLoader

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

[fixed]Occasional exception crash in CDMFLoader

Post by robmar »

I´m getting the crash below but can't track in in VS2010 because it only occurs in the release code!
In debug mode it never crashes.

The crash seems to happen in CDMFLoader, in a call to string, but I don´t know how to locate it more exactly with the information listed.

I added exception handling to getMesh, which calls CDMFLoader, but it still crashes...

Any ideas would be appreciated.

Fatal error: 01:00041060 : Irrlicht.dll

0001:00040fe0 ??$?0D@?$string@DV?$irrAllocator@D@core@irr@@@core@irr@@QAE@QBDI@Z 10041fe0 f i CDMFLoader.obj
0001:00041090 ??$split@V?$array@V?$string@DV?$irrAllocator@D@core@irr@@@core@irr@@V?$irrAllocator@V?$string@DV?$irrAllocator@D@core@irr@@@core@irr@@@23@@core@irr@@@?$string@DV?$irrAllocator@D@core@irr@@@core@irr@@QBEIAAV?$array@V?$string@DV?$irrAllocator@D@core@irr@@@core@irr@@V?$irrAllocator@V?$string@DV?$irrAllocator@D@core@irr@@@core@irr@@@23@@12@QBDI_N2@Z 10042090 f i CDMFLoader.obj
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Occasional exception crash in CDMFLoader

Post by CuteAlien »

Can you post the model somewhere? Might be worth checking in debug if valgrind sees any problems.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Occasional exception crash in CDMFLoader

Post by robmar »

Not sure it is any of the models, as when compiled with the debug setting it never crashes.

I wonder if its a string allocation failing, it happens after about 20 - 30 reload cycles, going from opengl to d3d... and also when set to D3D only.

Only crashes when one particular scene is loaded so it must be something in that scene that causes the crash after so many cycles...
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Occasional exception crash in CDMFLoader

Post by robmar »

Got the bugger!! After hundreds of scene reloads it eventually crashed in a different place, namely getNextToken, from CXMeshFileLoader

I was using a small .x camera, two of them, and converting them to .obj removed the crash event.

The offending .x file is available here:- http://www.sendspace.com/file/rxgdhc
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Occasional exception crash in CDMFLoader

Post by robmar »

Anyone interested in making the .x loader more crash proof?

The obj loader can also be crashed by incorrect obj files... should that be fixed?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Occasional exception crash in CDMFLoader

Post by hybrid »

Works for me. Are you sure there's a problem with that file?
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Occasional exception crash in CDMFLoader

Post by robmar »

Well, if I use the obj version it never crashes, if I use the .x version, a crash occurs about every twenty scene reloads....

maybe there is some weird compiler issue at play, or a timing issue. It never crashes with the debug code... makes it a little complex to debug!

I also have some obj files that crash the obj loader every time. Easy to protect in the obj loader, but adds overhead of course...

will take a look at it and post again when I know more
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Occasional exception crash in CDMFLoader

Post by robmar »

Otaka posted the bug fix to this issue:

Code: Select all

u16 CXMeshFileLoader::readBinWord(){
#ifdef __BIG_ENDIAN__
    const u16 tmp = os::Byteswap::byteswap(*(u16 *)P);
#else
    //START PATCH
    if ( End-P <=0 )   // If pointer at end or passed end of file
        return -1;
    //END PATCH
    const u16 tmp = *(u16 *)P;
#endif
    P += 2;
    return tmp;
}
Post Reply