Sometimes some of actors are destroyed after the destruction of the solver through the garbage collector. In this case, the app crash in FChaosScene::RemoveActorFromAccelerationStructureImp because the FBodyInstance::TermBody return a dangling pointer of the physic scene (previously destroyed).
Ideally we would detect this case and report an error with the actor name so that the user can track down the problem asset.
Example callstack:
FChaosScene::RemoveActorFromAccelerationStructureImpFChaosScene::RemoveActorFromAccelerationStructure
FChaosEngineInterface::ReleaseActorFBodyInstance::TermBody
UPrimitiveComponent::OnDestroyPhysicsState
UStaticMeshComponent::OnDestroyPhysicsState
UActorComponent::DestroyPhysicsState
UActorComponent::ExecuteUnregisterEvents
UActorComponent::UnregisterComponent
AActor::UnregisterAllComponents
AActor::BeginDestroy
UObject::ConditionalBeginDestroy
UnhashUnreachableObjects
IncrementalPurgeGarbage
StaticExit
Invoke(UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int> >::ApplyAfter(TBaseStaticDelegateInstance<void (void),FDefaultDelegateUserPolicy>::ExecuteIfSafeTMulticastDelegateBase<FDefaultDelegateUserPolicy>::BroadcastTMulticastDelegate<void (void),FDefaultDelegateUserPolicy>::Broadcast
FEngineLoop::AppPreExitFEngineLoop::ExitEngineExit
No known repro.
Rare cooker crashes during shutdown, possibly because an actor is being garbage collected and has not been unregistered. Crash is while attempting to unregister the body instance after the physics system has been shut down.
If this happens there is no useful log data to help track down the issue.
Desired: The cooker does not crash and instead reports some useful information about which Actors/Components are still registered when the solver is shut down.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-182925 in the post.
3 |
Component | UE - Simulation - Physics |
---|---|
Affects Versions | 5.1 |
Target Fix | 5.6 |
Created | Apr 11, 2023 |
---|---|
Updated | Oct 25, 2024 |