Sc::Scene::fireQueuedContactCallback : cannot find actorPair at code --> if(i < (nbActorPairs - 1) [ Ps::prefetchLine(actorPairs[ i+1 ]; }

Hi All,

I am using Unreal Engine 4 c++ as developer, making PhysX racing game made with custom Physx Based Racing Engine

A Few UE4 developers are randomly getting error like this::

Physx3PROFILE_x64 based crash

Physx_3.4/source/SimulationController/src/ScScene.cpp line:4354 at function void Sc::Scene::fireQueuedContactCallback “cannot find actorPair at code” →

if(i < (nbActorPairs - 1) [ Ps::prefetchLine(actorPairs[ i+1 ]; }

it happens very randomly in long periods when we use SetNotifyRigidBodyCollision(true) from physx3.4 version.

What can cause issues like that ? Just want to know if it can be kind of PhysX API internal issue.

Thanks!

Hello!

We are having a very similar issue, where a contact pair has invalid pointer to PxActor and causes a crash.

We are using UE 4.19, PhysX SDK 3.4.1, September 2017.

The callstack and the description is exactly the same like here:

I’m duplicating the callstack here:

0x0000000032628E5C Apex_DestructibleCHECKED_x64.dll!nvidia::destructible::DestructibleUserNotify::onContact() [c:\depot\r4\game\engine\source\thirdparty\physx3\apex_1.4\module\destructible\src\destructiblescene.cpp:231]
0x000000003B693032 APEXFrameworkCHECKED_x64.dll!nvidia::apex::ApexSceneUserNotify::onContact() [c:\depot\r4\game\engine\source\thirdparty\physx3\apex_1.4\framework\src\apexsceneusernotify.cpp:214]
0x000000003B94D714 PhysX3CHECKED_x64.dll!physx::Sc::Scene::fireQueuedContactCallbacks() [c:\depot\r4\game\engine\source\thirdparty\physx3\physx_3.4\source\simulationcontroller\src\scscene.cpp:4387]
0x000000003B82FE60 PhysX3CHECKED_x64.dll!physx::NpScene::fetchResults() [c:\depot\r4\game\engine\source\thirdparty\physx3\physx_3.4\source\physx\src\npscene.cpp:2314]
0x000000003B68914B APEXFrameworkCHECKED_x64.dll!nvidia::apex::ApexScene::fetchResults() [c:\depot\r4\game\engine\source\thirdparty\physx3\apex_1.4\framework\src\apexscene.cpp:1377]
0x000000004B2EAE14 UE4Editor-Engine.dll!FPhysScene::ProcessPhysScene() [c:\depot\r4\game\engine\source\runtime\engine\private\physicsengine\physscene.cpp:1253]
0x000000004B2C85E2 UE4Editor-Engine.dll!TBaseRawMethodDelegateInstance<0,FPhysScene,void __cdecl(enum ENamedThreads::Type,TRefCountPtr const & __ptr64),enum EPhysicsSceneType>::ExecuteIfSafe() [c:\depot\r4\game\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:503]
0x000000004AD1FE0C UE4Editor-Engine.dll!TGraphTask::ExecuteTask() [c:\depot\r4\game\engine\source\runtime\core\public\async\taskgraphinterfaces.h:829]
0x000000004D130A1E UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread() [c:\depot\r4\game\engine\source\runtime\core\private\async\taskgraph.cpp:667]
0x000000004D13126A UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit() [c:\depot\r4\game\engine\source\runtime\core\private\async\taskgraph.cpp:576]
0x000000004D154E6E UE4Editor-Core.dll!FTaskGraphImplementation::WaitUntilTasksComplete() [c:\depot\r4\game\engine\source\runtime\core\private\async\taskgraph.cpp:1387]
0x000000004B7CAB41 UE4Editor-Engine.dll!FTickTaskSequencer::ReleaseTickGroup() [c:\depot\r4\game\engine\source\runtime\engine\private\ticktaskmanager.cpp:553]
0x000000004B7D9473 UE4Editor-Engine.dll!FTickTaskManager::RunTickGroup() [c:\depot\r4\game\engine\source\runtime\engine\private\ticktaskmanager.cpp:1460]
0x000000004AEDF804 UE4Editor-Engine.dll!UWorld::RunTickGroup() [c:\depot\r4\game\engine\source\runtime\engine\private\leveltick.cpp:789]
0x000000004AEECD7C UE4Editor-Engine.dll!UWorld::Tick() [c:\depot\r4\game\engine\source\runtime\engine\private\leveltick.cpp:1502]
0x0000000041EE8FB7 UE4Editor-UnrealEd.dll!UEditorEngine::Tick() [c:\depot\r4\game\engine\source\editor\unrealed\private\editorengine.cpp:1761]
0x00000000427E78F6 UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick() [c:\depot\r4\game\engine\source\editor\unrealed\private\unrealedengine.cpp:401]
0x000000006F1A7CBD UE4Editor.exe!FEngineLoop::Tick() [c:\depot\r4\game\engine\source\runtime\launch\private\launchengineloop.cpp:3421]
0x000000006F1BD590 UE4Editor.exe!GuardedMain() [c:\depot\r4\game\engine\source\runtime\launch\private\launch.cpp:166]
0x000000006F1BD60A UE4Editor.exe!GuardedMainWrapper() [c:\depot\r4\game\engine\source\runtime\launch\private\windows\launchwindows.cpp:144]
0x000000006F1CB807 UE4Editor.exe!WinMain() [c:\depot\r4\game\engine\source\runtime\launch\private\windows\launchwindows.cpp:223]
0x000000006F1CD247 UE4Editor.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
0x00000000A6643034 KERNEL32.DLL!BaseThreadInitThunk()
0x00000000A68C1461 ntdll.dll!UnknownFunction
0x00000000A68C1461 ntdll.dll!UnknownFunction

I’d like to ask for any info if any patch for 3.4 could potentially fix that crash?

I’d greatly appreciate any help.
Thank you!

I’m unsure of this particular crash but there are some fixes in the PhysX 3.4 GitHub release that will be missing from the build that shipped with UE4.19. Are you in a position where you can take the latest 3.4 release from GitHub and replace the version of PhysX used in UE4.19 to see if this resolves the issue?

This should involve replacing the source and headers with the version from our GitHub then rebuilding PhysX using the runUAT.bat script in UE4 following the instructions here:

You shouldn’t need to modify any UE4 source code but you will need to do a full rebuild of UE4 after this because the UE build tool doesn’t reliably pick up on any header file changes in third-party include folders. If the crash still persists after this, we’ll need some assistance to be able to reproduce the issue locally to be able to fix it but, as a first step, it would be good to confirm whether the issue is already fixed first.

Thank you for the fast answer.
I will update PhysX source code to the new versions and see if the crash goes away.

Has anyone had any luck fixing this? Did updating to latest PhysX 3.4 work?