NVIDIAGameWorks / PhysX

NVIDIA PhysX SDK
Other
3.11k stars 793 forks source link

Crash in Sq::inflateBounds (from updateObjectsAndInflateBounds) #622

Closed msinilo closed 1 year ago

msinilo commented 1 year ago

Some of our users are crashing inside inflateBounds function, when trying to write to &dst.minimum.x We could never repro this in-house, so I only have retail crash dump, but from what I can tell, the problem is poolIndex being INVALID_PRUNERHANDLE in updateObjectsAndInflateBounds. There is an assertion inside and even a commented out check (line 90), so I assume it might be something that happened in the past. Not sure if this is somehow caused by our code, but it seems to be happening quite deep in PhysX code, is not easily reproduceable and it doesn't seem like there is any real pattern to it. One option would be to bring the check back, but I'd like to understand the problem better first. As I said, I only have crash dumps, so not that much info, but if you need more details, I'll try to provide them if possible. A complete PhysX callstack is:

msinilo commented 1 year ago

It seems like it was our fault after all, sorry for the false alarm. We use non-exclusive shapes and due to a bug in our code, it'd sometimes try to attach same shape to an actor that already had it (then remove the 'old' one). It's clearly an API misuse but maybe debug build should complain about it? Exclusive shapes do report a problem, but it's mostly because they can't be attached twice, same actor or not. In our case, when removing it'd remove the "old" shape from some systems (like pruner), but 'new' one from others (actor, bounds manager).