PhysX body filter crash

Our main character has a physics rigid body setup with collisions between certain parts disabled. We randomly (2-5% of the time) get an assert related to the filter logic’s DisableTablePtrPtr being null (via the check in PhysXSupport.cpp line 357) and crash in shipping on line 359. Do you know what would cause this and is there a fix or workaround?

We are running 4.4 compiled from source, though this bug has been seen on 4.3 and 4.2. Here is the crash stack:

PhysXSimFilterShader() 0x4024587a + 8 bytes [File= C:\gamedev\Game\ue4\engine\source\runtime\engine\private\physicsengine\physxsupport.cpp:359] [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Game\Binaries\Win64\Game-Win64-Shipping.exe]
Address = 0xecf2ef4f (filename not found) [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Engine\Binaries\ThirdParty\PhysX\PhysX-3.3\Win64\VS2013\PhysX3PROFILE_:64.dll]
Address = 0xecf21c9c (filename not found) [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Engine\Binaries\ThirdParty\PhysX\PhysX-3.3\Win64\VS2013\PhysX3PROFILE_:64.dll]
Address = 0xecf2Odc1 (filename not found) [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Engine\Binaries\ThirdParty\PhysX\PhysX-3.3\Win64\VS2013\PhysX3PROFILE_:64.dll]
Address = 0xecf1f883 (filename not found) [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Engine\Binaries\ThirdParty\PhysX\PhysX-3.3\Win64\VS2013\PhysX3PROFILE_:64.dll]
Address = 0xecf1f006 (filename not found) [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Engine\Binaries\ThirdParty\PhysX\PhysX-3.3\Win64\VS2013\PhysX3PROFILE_:64.dll]
Address = 0xecee043b (filename not found) [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Engine\Binaries\ThirdParty\PhysX\PhysX-3.3\Win64\VS2013\PhysX3PROFILE_:64.dll]
Address = 0xecee7848 (filename not found) [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Engine\Binaries\ThirdParty\PhysX\PhysX-3.3\Win64\VS2013\PhysX3PROFILE_:64.dll]
Address = 0xece26d12 (filename not found) [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Engine\Binaries\ThirdParty\PhysX\PhysX-3.3\Win64\VS2013\PhysX3PROFILE_:64.dll]
TGraphTask< FPhysXTask>::ExecuteTask() 0x40237122 + 0 bytes
[File= c:\gamedev\Game\ue4\engine\source\runtime\core\public\async\taskgraphinterfaces.h:671] [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Game\Binaries\Win64\Game-Win64-Shipping.exe]
FTaskThread::ProcessTasks() 0x3f8da58b + 0 bytes [File= c:\gamedev\Game\ue4\engine\source\runtime\core\private\async\taskgraph.cpp:329] [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Game\Binaries\Win64\Game-Win64-Shipping.exe]
FTaskThread::ProcessTasksUntilQuit0 0x3f8da6cd + 0 bytes [File= c:\gamedev\Game\ue4\engine\source\runtime\core\private\async\taskgraph.cpp:173] [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Game\Binaries\Win64\Game-Win64-Shipping.exe]
FTaskThread::Run() 0x3f8df6bb + 0 bytes [File= c:\gamedev\Game\ue4\engine\source\runtime\core\private\async\taskgraph.cpp:456] [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Game\Binaries\Win64\Game-Win64-Shipping.exe]
FRunnableThreadWin::Run() 0x3f95bfaf + 0 bytes [File= c:\gamedev\Game\ue4\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:66] [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Game\Binaries\Win64\Game-Win64-Shipping.exe]
FRunnableThreadWin::GuardedRun() 0x3f9589e7 + 8 bytes[File= c:\gamedev\Game\ue4\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:24] [in C:\gamedev\Game\GameRelease\WindowsNoEditor\Game\Binaries\Win64\Game-Win64-Shipping.exe]
Address = 0x76d459ed (filename not found) [in C:\Windows\system32\kernel32.dll]
Address = 0x76e7641 (filename not found) [in C:\Wind0ws\SYSTEM32\ntdll.dll]
Address = 0x76e7641 (filename not found) [in C:\Wind0ws\SYSTEM32\ntdll.dll]

Hi Marc,

This is a bug. I’ll take a closer look soon and let you know what I find. Thanks a lot for posting this!

Marc,

Could you tell me if you have sub-stepping turned on? Additionally, are you doing anything that would cause the player’s body to be added/removed from the world at runtime? In theory if you want a quick workaround you could replace the check with an if statement so that if the pointer is NULL it just ignores the code that returns eKill. I wouldn’t expect this to be a valid case though so I’d like to find out if there’s an actual bug, or if it’s a threading case I haven’t considered.

Thanks

I just realized that this crash may be caused by enemies which also have rigid body setups to ragdoll as they die and do get removed from the world a few seconds later. Enemies are removed from the world by calling Destroy() in their Tick() function (in c++), is there a safer way to destroy actors with rigid bodies? We do not have substepping enabled.

This should be safe. Looking at the code the only way I’d expect this crash to be possible is if sub-stepping is turned on. However, it’s possible that there is some subtle case that I’m missing.

I’ve changed the check to an if because it IS a bug in the sub-stepping case, so we need it there anyway. Here’s the change on github https://github.com/EpicGames/UnrealEngine/commit/8ed87ac8ae8fa17d8875d8c3a8d8ec92970f5407

I would still keep an eye out to make sure there isn’t any strange behavior, though I’d expect this to solve your issue. Please let me know if you run into any more trouble.