Description

When an actor is spawned with Spawn Parameters that are templated the engine crashes when closing a scene. This wasn't happening when there wasn't a physics constraint on the spawned blueprint.

This is similar to https://jira.it.epicgames.net/browse/UE-45206.

Found in 4.24.3 CL#11590370
Reproduced in 4.23.1 CL#9631420, 4.25.0 P1 CL#11723679, 4.26 Main CL#11724764

Steps to Reproduce

1. Create a C++ project.
2. Create a blueprint(DemoBP) with a static mesh component.
3. Add a physics constraint to DemoBP and set Component Name 1 to the name of the static mesh.
4. Create a C++ actor class (DemoActor).
5. In DemoActor spawn two instances of DemoBP in BeginPlay.
6. When spawning the second actor use the first one as a template in FActorSpawnParameters.
7. Place an instance of DemoActor in the scene.
8. Play the scene.
9. Stop the scene.

Result: The engine crashes.

Expected: The engine doesn't crash.

Callstack
Fatal error!

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION 0x00000008

0xffffffff00000008 UnknownFunction []
0x00007ff95f1f1fd9 UE4Editor-Engine.dll!FPhysicsCommand_PhysX::ExecuteWrite() [d:\build\++ue4\sync\engine\source\runtime\engine\private\physicsengine\physicsinterfacephysx.cpp:639]
0x00007ff95f1c1b37 UE4Editor-Engine.dll!FConstraintInstance::TermConstraint() [d:\build\++ue4\sync\engine\source\runtime\engine\private\physicsengine\constraintinstance.cpp:505]
0x00007ff95e9050cf UE4Editor-Engine.dll!UActorComponent::ExecuteUnregisterEvents() [d:\build\++ue4\sync\engine\source\runtime\engine\private\components\actorcomponent.cpp:1338]
0x00007ff95e952158 UE4Editor-Engine.dll!UActorComponent::UnregisterComponent() [d:\build\++ue4\sync\engine\source\runtime\engine\private\components\actorcomponent.cpp:1122]
0x00007ff95e594063 UE4Editor-Engine.dll!AActor::UnregisterAllComponents() [d:\build\++ue4\sync\engine\source\runtime\engine\private\actor.cpp:4229]
0x00007ff95edea05a UE4Editor-Engine.dll!ULevel::ClearLevelComponents() [d:\build\++ue4\sync\engine\source\runtime\engine\private\level.cpp:683]
0x00007ff95f7688ef UE4Editor-Engine.dll!UWorld::ClearWorldComponents() [d:\build\++ue4\sync\engine\source\runtime\engine\private\world.cpp:1773]
0x00007ff95f767eeb UE4Editor-Engine.dll!UWorld::CleanupWorld() [d:\build\++ue4\sync\engine\source\runtime\engine\private\world.cpp:4146]
0x00007ff95d03f88f UE4Editor-UnrealEd.dll!UEditorEngine::TeardownPlaySession() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\playlevel.cpp:770]
0x00007ff95d00a004 UE4Editor-UnrealEd.dll!UEditorEngine::EndPlayMap() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\playlevel.cpp:314]
0x00007ff95cafef43 UE4Editor-UnrealEd.dll!UEditorEngine::Tick() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\editorengine.cpp:1909]
0x00007ff95d355296 UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:407]
0x00007ff604197b0a UE4Editor.exe!FEngineLoop::Tick() [d:\build\++ue4\sync\engine\source\runtime\launch\private\launchengineloop.cpp:4257]
0x00007ff6041aa91c UE4Editor.exe!GuardedMain() [d:\build\++ue4\sync\engine\source\runtime\launch\private\launch.cpp:173]
0x00007ff6041aa9fa UE4Editor.exe!GuardedMainWrapper() [d:\build\++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:147]
0x00007ff6041bb92c UE4Editor.exe!WinMain() [d:\build\++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:279]
0x00007ff6041be60e UE4Editor.exe!__scrt_common_main_seh() [d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
0x00007ff9e77b7974 KERNEL32.DLL!UnknownFunction []
0x00007ff9e9eba261 ntdll.dll!UnknownFunction []

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-90128 in the post.

6
Login to Vote

Won't Fix
ComponentUE - Simulation - Physics
Affects Versions4.23.14.24.34.254.26
CreatedMar 5, 2020
ResolvedJul 19, 2022
UpdatedJul 19, 2022
View Jira Issue