UserAllocator::malloc (v0.9-34)

jams

22-01-2008 15:28:39

Hi, I'm stuck with a crash happening in the method :
void* UserAllocator::malloc(NxU32 size, NxMemoryType type)
on line void* ptr = (void*)::malloc(size+8);

I could track the crash using PhysixCoreDEBUG dll and attach my process to Visual (I can work only in release mode). Here is the crash dialog I could get :


It seems that problem occurs on first collisions tests (I use many TriangleMeshShape and CubeShape).

The trick is that it does not always happen !
I use Physix v2.7.2 and NxOgre v0.9-34 (I have 2Go RAM PC)

Thanks for help.

betajaen

22-01-2008 16:51:08

There is no PhysXCoreDEBUG.dll (unless your a licensed developer).

Anyway as a quick fix. Go to NxOgrePhysXDriver.cpp

Find this line:

mSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION, mAllocator, mError, desc, 0);

and replace with:

mSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION, NULL, mError, desc, 0);


I've fixed a similar problem with my copy of bleeding.

jams

23-01-2008 00:19:05

I tried the change you suggested, but I still have my app crashing with same message.
My world is made of units (like vehicles->Cubeshape), scenery objects (TriangleMeshShape) and a groundshape.
I don't see what is causing the crash, but I can make it run well if I load a simpler scene, I mean same set of units but much simpler scene.

betajaen

23-01-2008 00:21:34

The thing is; PhysX is crashing there, and with that error message; you probably have access to the full source and the ability to trace it. Something us freeloaders don't have.

See what you get, when click retry.

jams

23-01-2008 10:00:45

Actually I'm not a licenced developper, I found a debug dll in following folder : C:\Program Files\AGEIA Technologies\SDK\v2.7.2\Bin\win32\agperfmon.
So I don't have any source, but this DLL gives more details about errors.

I found that UserAllocator::malloc was involved using "Retry". With last change you advise me I do not jump into UserAllocator anymore, but VC cannot find source (probably because I do not have Physx sources) but I get assembly code, and it seems to be a hardcoded breakpoint like _asm { int 3 }
I really wonder what is responsible for this ? Is it a memory issue or a bad shaped mesh ??

Edit : It seems that error occurs during simulation since if I do not call world->simulate it does not crash, and world->render does not seems to be involded.

jams

23-01-2008 15:22:04

After some more tests I found out that using the debug DLL I mentionned, the HTML log gives exceptions :

NxOgre::Error::reportAssertViolation#89T0 F42
PhysX Assertion! 'getBody2WorldLL().p.isFinite()' in line 669 of g:\scm\release\physx_2.7.2\novodex\sdks\core\common\src\body.cpp

NxOgre::Error::reportAssertViolation#89T0 F42
PhysX Assertion! 'getBody2WorldLL().q.isFinite()' in line 670 of g:\scm\release\physx_2.7.2\novodex\sdks\core\common\src\body.cpp

I guess that without novodex source code it's quite difficult to understand, but it may give a clue :?