I get this crash, apparently at random, usually within a few minutes of starting the game:
APEX_DestructiblePROFILE_x64!nvidia::destructible::DestructibleUserNotify::onContact() [d:\build\++ue4+release-4.16+physx_compile\sync\engine\source hirdparty\physx\apex_1.4\module\destructible\src\destructiblescene.cpp:231]
APEXFrameworkPROFILE_x64!nvidia::apex::ApexSceneUserNotify::onContact() [d:\build\++ue4+release-4.16+physx_compile\sync\engine\source hirdparty\physx\apex_1.4\framework\src\apexsceneusernotify.cpp:214]
PhysX3PROFILE_x64!physx::Sc::Scene::fireQueuedContactCallbacks() [d:\build\++ue4+release-4.16+physx_compile\sync\engine\source hirdparty\physx\physx_3.4\source\simulationcontroller\src\scscene.cpp:4354]
PhysX3PROFILE_x64!physx::NpScene::fetchResults() [d:\build\++ue4+release-4.16+physx_compile\sync\engine\source hirdparty\physx\physx_3.4\source\physx\src
pscene.cpp:2309]
APEXFrameworkPROFILE_x64!nvidia::apex::ApexScene::fetchResults() [d:\build\++ue4+release-4.16+physx_compile\sync\engine\source hirdparty\physx\apex_1.4\framework\src\apexscene.cpp:1377]
UE4Editor_Engine!FPhysScene::ProcessPhysScene() [c:\repositories\unrealengine\engine\source\runtime\engine\private\physicsengine\physscene.cpp:1149]
UE4Editor_Engine!TBaseRawMethodDelegateInstance<0,FPhysScene,void __cdecl(enum ENamedThreads::Type,TRefCountPtr<FGraphEvent> const & __ptr64),enum EPhysicsSceneType>::ExecuteIfSafe() [c:\repositories\unrealengine\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:648]
UE4Editor_Engine!TGraphTask<FDelegateGraphTask>::ExecuteTask() [c:\repositories\unrealengine\engine\source\runtime\core\public\async askgraphinterfaces.h:883]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [c:\repositories\unrealengine\engine\source\runtime\core\private\async askgraph.cpp:954]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [c:\repositories\unrealengine\engine\source\runtime\core\private\async askgraph.cpp:701]
UE4Editor_Core!FTaskGraphImplementation::WaitUntilTasksComplete() [c:\repositories\unrealengine\engine\source\runtime\core\private\async askgraph.cpp:1809]
UE4Editor_Engine!FTickTaskSequencer::ReleaseTickGroup() [c:\repositories\unrealengine\engine\source\runtime\engine\private icktaskmanager.cpp:538]
UE4Editor_Engine!FTickTaskManager::RunTickGroup() [c:\repositories\unrealengine\engine\source\runtime\engine\private icktaskmanager.cpp:1450]
UE4Editor_Engine!UWorld::RunTickGroup() [c:\repositories\unrealengine\engine\source\runtime\engine\private\leveltick.cpp:758]
UE4Editor_Engine!UWorld::Tick() [c:\repositories\unrealengine\engine\source\runtime\engine\private\leveltick.cpp:1389]
UE4Editor_UnrealEd!UEditorEngine::Tick() [c:\repositories\unrealengine\engine\source\editor\unrealed\private\editorengine.cpp:1633]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [c:\repositories\unrealengine\engine\source\editor\unrealed\private\unrealedengine.cpp:386]
UE4Editor!FEngineLoop::Tick() [c:\repositories\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:3119]
UE4Editor!GuardedMain() [c:\repositories\unrealengine\engine\source\runtime\launch\private\launch.cpp:166]
UE4Editor!GuardedMainWrapper() [c:\repositories\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UE4Editor!WinMain() [c:\repositories\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
kernel32
ntdll
Weird things about this:
- None of our game code appears in the callstack
- To the best of my knowledge we have no destructible meshes in the scene, just plain ol’ static meshes with standard physics enabled
This started happening when I added a custom component for playing impact audio/vfx when physics objects collide with things (e.g. if you throw or drop something). That component does this on startup:
void UPhysicsImpactComponent::BeginPlay()
{
Super::BeginPlay();
GetOwner()->OnActorHit.AddDynamic(this, &UPhysicsImpactComponent::OnActorHit);
UPrimitiveComponent* root = Cast<UPrimitiveComponent>(GetOwner()->GetRootComponent());
root->SetNotifyRigidBodyCollision(true);
}
…and this on shutdown:
void UPhysicsImpactComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
GetOwner()->OnActorHit.RemoveDynamic(this, &UPhysicsImpactComponent::OnActorHit);
Super::EndPlay(EndPlayReason);
}
My best guess is some UPhysicsImpactComponent instance had subscribed to an OnActorHit, then became invalid and somehow (?) failed to unsubscribe, and then that event later got called. But if that’s correct, I don’t understand how we’d have missed the EndPlay. Otherwise… I don’t even know WTF.
We’re on UE 4.16.2 on Windows FWIW.