Steps to Reproduce

There are 2 ways I've seen to trigger this issue:

  1. Edit a blueprint packed actor. Do something to cause the construction script to rerun which can invalidate child components. Exit the level instance. This triggers a GC which ends up destroying the components and eventually invoking UnregisterLevelInstance.
  2. Open up the BPP. Change a property which will cause the PostPropertyChange events on all instances in the world which implicitly runs the construction script. This can end up assigning a bad component to the root component when reregistering the components. When we clean up this level instance it can cause it to crash as a valid root component was never assigned. This will trigger the log in UActorComponent::RegisterCOmponentWithWorld: "RegisterComponentWithWorld: (%s) Trying to register component with IsValid() == false. Aborting.
Callstack

5.4:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION writing address 0x0000000000000280

UnrealEditor_Engine!FLevelInstanceActorImpl::UnregisterLevelInstance() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelInstance\LevelInstanceActorImpl.cpp:56]
UnrealEditor_Engine!AActor::UnregisterAllComponents() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:5352]
UnrealEditor_Engine!AActor::BeginDestroy() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:745]
UnrealEditor_CoreUObject!UObject::ConditionalBeginDestroy() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Obj.cpp:1214]
UnrealEditor_CoreUObject!UnhashUnreachableObjects() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:5949]
UnrealEditor_CoreUObject!UE::GC::PostCollectGarbageImpl<1>() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:5575]
UnrealEditor_CoreUObject!UE::GC::FReachabilityAnalysisState::PerformReachabilityAnalysisAndConditionallyPurgeGarbage() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:5771]
UnrealEditor_CoreUObject!CollectGarbage() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:6007]
UnrealEditor_UnrealEd!UPackageTools::UnloadPackages() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\PackageTools.cpp:594]
UnrealEditor_UnrealEd!UEditorLevelUtils::RemoveLevelsFromWorld() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorLevelUtils.cpp:923]
UnrealEditor_Engine!ULevelInstanceSubsystem::RemoveLevelsFromWorld() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelInstance\LevelInstanceSubsystem.cpp:1718]
UnrealEditor_Engine!ULevelInstanceSubsystem::FLevelInstanceEdit::~FLevelInstanceEdit() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelInstance\LevelInstanceSubsystem.cpp:1881]
UnrealEditor_Engine!ULevelInstanceSubsystem::FLevelInstanceEdit::`scalar deleting destructor'()
UnrealEditor_Engine!ULevelInstanceSubsystem::ResetEdit() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelInstance\LevelInstanceSubsystem.cpp:520]
UnrealEditor_Engine!ULevelInstanceSubsystem::CommitLevelInstanceInternal() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelInstance\LevelInstanceSubsystem.cpp:2353]
UnrealEditor_Engine!ULevelInstanceSubsystem::CommitLevelInstance() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelInstance\LevelInstanceSubsystem.cpp:2270]
UnrealEditor_LevelInstanceEditor!LevelInstanceActorDetailsCallbacks::OnEditCommitButtonClicked() [D:\build\++UE5\Sync\Engine\Source\Editor\LevelInstanceEditor\Private\LevelInstanceActorDetails.cpp:75]
UnrealEditor_LevelInstanceEditor!TBaseStaticDelegateInstance<FReply __cdecl(void),FDefaultDelegateUserPolicy,TWeakInterfacePtr<ILevelInstanceInterface> >::Execute() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:767]
UnrealEditor_Slate!SButton::ExecuteOnClick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:465]
UnrealEditor_Slate!SButton::OnMouseButtonUp() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:390]
UnrealEditor_Slate!TArray<TSharedRef<SWindow,1>,TSizedDefaultAllocator<32> >::RemoveAll<`TArray<TSharedRef<SWindow,1>,TSizedDefaultAllocator<32> >::Remove'::`2'::<lambda_1> >() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:442]
UnrealEditor_Slate!FSlateApplication::RoutePointerUpEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5279]
UnrealEditor_Slate!FSlateApplication::ProcessMouseButtonUpEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5857]
UnrealEditor_Slate!FSlateApplication::OnMouseUp() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5813]
UnrealEditor_ApplicationCore!FWindowsApplication::ProcessDeferredMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2243]
UnrealEditor_ApplicationCore!FWindowsApplication::DeferMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2750]
UnrealEditor_ApplicationCore!FWindowsApplication::ProcessMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:1919]
UnrealEditor_ApplicationCore!FWindowsApplication::AppWndProc() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:929]
user32
user32
UnrealEditor_ApplicationCore!FWindowsPlatformApplicationMisc::PumpMessages() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsPlatformApplicationMisc.cpp:145]
UnrealEditor!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5850]
UnrealEditor!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:180]
UnrealEditor!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:118]
UnrealEditor!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:258]
UnrealEditor!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:298]
UnrealEditor!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

UE5-Main

>    [Inline Frame] UnrealEditor-Core.dll!PureCallHandler::__l2::<lambda>() Line 741    C++
     UnrealEditor-Core.dll!PureCallHandler() Line 741    C++
     vcruntime140.dll!_purecall() Line 29    C++
     [Inline Frame] UnrealEditor-Engine.dll!ILevelInstanceInterface::GetWorldAssetPackage() Line 70    C++
     UnrealEditor-Engine.dll!ULevelInstanceSubsystem::GetLevelInstances(const FString & WorldAssetPackage) Line 2875    C++
     UnrealEditor-Engine.dll!ULevelInstanceSubsystem::CommitLevelInstanceInternal(TUniquePtr<ULevelInstanceSubsystem::FLevelInstanceEdit,TDefaultDelete<ULevelInstanceSubsystem::FLevelInstanceEdit>> & InLevelInstanceEdit, bool bDiscardEdits, bool bDiscardOnFailure, TSet<FName,DefaultKeyFuncs<FName,0>,FDefaultSetAllocator> * DirtyPackages) Line 2691    C++
     UnrealEditor-Engine.dll!ULevelInstanceSubsystem::CommitLevelInstance(ILevelInstanceInterface * LevelInstance, bool bDiscardEdits, TSet<FName,DefaultKeyFuncs<FName,0>,FDefaultSetAllocator> * DirtyPackages) Line 2577    C++
     UnrealEditor-LevelInstanceEditor.dll!LevelInstanceActorDetailsCallbacks::OnSaveCancelButtonClicked(TWeakInterfacePtr<ILevelInstanceInterface> LevelInstancePtr, bool bDiscard) Line 227    C++
     [Inline Frame] UnrealEditor-LevelInstanceEditor.dll!Invoke(FReply(*)(TWeakInterfacePtr<ILevelInstanceInterface>, bool) &) Line 47    C++
     [Inline Frame] UnrealEditor-LevelInstanceEditor.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int,0,1>,TWeakInterfacePtr<ILevelInstanceInterface>,bool>::ApplyAfter(FReply(*)(TWeakInterfacePtr<ILevelInstanceInterface>, bool) &) Line 317    C++
     UnrealEditor-LevelInstanceEditor.dll!TBaseStaticDelegateInstance<FReply __cdecl(void),FDefaultDelegateUserPolicy,TWeakInterfacePtr<ILevelInstanceInterface>,bool>::Execute() Line 789    C++
     [Inline Frame] UnrealEditor-Slate.dll!TDelegate<FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() Line 613    C++
     UnrealEditor-Slate.dll!SButton::ExecuteOnClick() Line 467    C++
     UnrealEditor-Slate.dll!SButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 392    C++
     UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda_2>::operator()(const FArrangedWidget & TargetWidget, const FPointerEvent & Event) Line 5365    C++
     UnrealEditor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,`FSlateApplication::RoutePointerUpEvent'::`8'::<lambda_2>>(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::<lambda_2> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) Line 456    C++
     UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) Line 5351    C++
     UnrealEditor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) Line 5936    C++
     UnrealEditor-Slate.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button, const UE::Math::TVector2<double> CursorPos) Line 5892    C++
     UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 2776    C++
     UnrealEditor-ApplicationCore.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,1> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 3289    C++
     UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 1627    C++
     [Inline Frame] UnrealEditor-ApplicationCore.dll!WindowsApplication_WndProc(HWND__ *) Line 1444    C++
     UnrealEditor-ApplicationCore.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 1450    C++
     user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT *,__int64 (*)(struct tagWND *,unsigned int,unsigned __int64,__int64),struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,void *,int)    Unknown
     user32.dll!DispatchMessageWorker()    Unknown
     [Inline Frame] UnrealEditor-ApplicationCore.dll!WinPumpMessages() Line 116    C++
     UnrealEditor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 145    C++
     UnrealEditor.exe!FEngineLoop::Tick() Line 5826    C++
     [Inline Frame] UnrealEditor.exe!EngineTick() Line 60    C++
     UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 187    C++
     UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 267    C++
     UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 335    C++
     [Inline Frame] UnrealEditor.exe!invoke_main() Line 102    C++
     UnrealEditor.exe!__scrt_common_main_seh() Line 288    C++
     kernel32.dll!00007ff961417374()    Unknown
     ntdll.dll!00007ff96267cc91()    Unknown

Have Comments or More Details?

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

0
Login to Vote

Unresolved
CreatedDec 4, 2024
UpdatedDec 9, 2024
View Jira Issue