HoudiniEngineForUnreal icon indicating copy to clipboard operation
HoudiniEngineForUnreal copied to clipboard

plugin crash when engine shutdown

Open mirchd opened this issue 1 year ago • 2 comments

engine version:ue5.5.1 plugin version:the latest version when engine build with Debug config, the plugin crash on engine shutdown; when engine build with Development config, everything is ok. here is the crash log:

LogCrashDebugHelper: GetContextStackTrace() got 28 frames LogCrashDebugHelper: 0: UnrealEditor_ApplicationCore_Win64_Debug!SharedPointerInternals::FSharedReferencer<1>::operator=() [D:\UnrealEngine\Engine\Source\Runtime\Core\Public\Templates\SharedPointerInternals.h:653] LogCrashDebugHelper: 1: UnrealEditor_ApplicationCore_Win64_Debug!FWindowsApplication::ShutDownAfterError() [D:\UnrealEngine\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:337] LogCrashDebugHelper: 2: UnrealEditor_ApplicationCore_Win64_Debug!TBaseRawMethodDelegateInstance<0,FWindowsApplication,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\UnrealEngine\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:535] LogCrashDebugHelper: 3: UnrealEditor_Core_Win64_Debug!TMulticastDelegateBase<FDefaultDelegateUserPolicy>::Broadcast<IBaseDelegateInstance<void __cdecl(void),FDefaultDelegateUserPolicy> >() [D:\UnrealEngine\Engine\Source\Runtime\Core\Public\Delegates\MulticastDelegateBase.h:257] LogCrashDebugHelper: 4: UnrealEditor_Core_Win64_Debug!FWindowsErrorOutputDevice::HandleError() [D:\UnrealEngine\Engine\Source\Runtime\Core\Private\Windows\WindowsErrorOutputDevice.cpp:125] LogCrashDebugHelper: 5: UnrealEditor_Core_Win64_Debug!FWindowsErrorOutputDevice::Serialize() [D:\UnrealEngine\Engine\Source\Runtime\Core\Private\Windows\WindowsErrorOutputDevice.cpp:89] LogCrashDebugHelper: 6: UnrealEditor_Core_Win64_Debug!FOutputDevice::LogfImpl() [D:\UnrealEngine\Engine\Source\Runtime\Core\Private\Misc\OutputDevice.cpp:81] LogCrashDebugHelper: 7: UnrealEditor_Core_Win64_Debug!AssertFailedImplV() [D:\UnrealEngine\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:150] LogCrashDebugHelper: 8: UnrealEditor_Core_Win64_Debug!FDebug::CheckVerifyFailedImpl2() [D:\UnrealEngine\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:650] LogCrashDebugHelper: 9: UnrealEditor_HoudiniEngineRuntime_Win64_Debug!FHoudiniEngineRuntime::UnRegisterHoudiniComponent() [D:\ActionRPG\Plugins\HoudiniEngineForUnreal\Source\HoudiniEngineRuntime\Private\HoudiniEngineRuntime.cpp:204] LogCrashDebugHelper: 10: UnrealEditor_HoudiniEngineRuntime_Win64_Debug!UHoudiniAssetComponent::~UHoudiniAssetComponent() [D:\ActionRPG\Plugins\HoudiniEngineForUnreal\Source\HoudiniEngineRuntime\Private\HoudiniAssetComponent.cpp:287] LogCrashDebugHelper: 11: UnrealEditor_HoudiniEngineRuntime_Win64_Debug!UHoudiniAssetComponent::`vector deleting destructor'() LogCrashDebugHelper: 12: UnrealEditor_CoreUObject_Win64_Debug!FObjectPurge::DestroyObjects() [D:\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:827] LogCrashDebugHelper: 13: UnrealEditor_CoreUObject_Win64_Debug!IncrementalDestroyGarbage() [D:\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:4851] LogCrashDebugHelper: 14: UnrealEditor_CoreUObject_Win64_Debug!IncrementalPurgeGarbage() [D:\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:4525] LogCrashDebugHelper: 15: UnrealEditor_CoreUObject_Win64_Debug!PurgeAllUObjectsOnExit() [D:\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:6103] LogCrashDebugHelper: 16: UnrealEditor_CoreUObject_Win64_Debug!StaticExit() [D:\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\UObject\Obj.cpp:5496] LogCrashDebugHelper: 17: UnrealEditor_CoreUObject_Win64_Debug!TBaseStaticDelegateInstance<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\UnrealEngine\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:779] LogCrashDebugHelper: 18: UnrealEditor_Win64_Debug!TMulticastDelegateBase<FDefaultDelegateUserPolicy>::Broadcast<IBaseDelegateInstance<void __cdecl(void),FDefaultDelegateUserPolicy> >() [D:\UnrealEngine\Engine\Source\Runtime\Core\Public\Delegates\MulticastDelegateBase.h:257] LogCrashDebugHelper: 19: UnrealEditor_Win64_Debug!FEngineLoop::AppPreExit() [D:\UnrealEngine\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:6858] LogCrashDebugHelper: 20: UnrealEditor_Win64_Debug!FEngineLoop::Exit() [D:\UnrealEngine\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5128] LogCrashDebugHelper: 21: UnrealEditor_Win64_Debug!EngineExit() [D:\UnrealEngine\Engine\Source\Runtime\Launch\Private\Launch.cpp:81] LogCrashDebugHelper: 22: UnrealEditor_Win64_Debug!GuardedMain() [D:\UnrealEngine\Engine\Source\Runtime\Launch\Private\Launch.cpp:202] LogCrashDebugHelper: 23: UnrealEditor_Win64_Debug!LaunchWindowsStartup() [D:\UnrealEngine\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:266] LogCrashDebugHelper: 24: UnrealEditor_Win64_Debug!WinMain() [D:\UnrealEngine\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:317] LogCrashDebugHelper: 25: UnrealEditor_Win64_Debug!__scrt_common_main_seh() [D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288] LogCrashDebugHelper: 26: kernel32 LogCrashDebugHelper: 27: ntdll

please help,

mirchd avatar Dec 20 '24 03:12 mirchd

I'm also hitting this issue, it looks like the UHoudiniAssetComponent destructor is getting called multiple times.

EALTapia avatar Jan 27 '25 23:01 EALTapia

Digging further, the problem is that ~UHoudiniAssetComponent() calls FHoudiniEngineRuntime::Get().UnRegisterHoudiniComponent(this) which calls IsValid(HAC) and errors in debug when GetObjectPtr() checks IsValidIndex as UHoudiniAssetComponent has already been unlinked from the asset array.

Our workaround is just to add a check to UHoudiniAssetComponent to see if it was registered prior to calling UnRegisterHoudiniComponent() since it is unregistered in UHoudiniAssetComponent::BeginDestroy() already.

EALTapia avatar Jan 28 '25 18:01 EALTapia

Hi, Thanks for bringing this up - closing as this has been fixed a while ago.

dpernuit avatar Oct 07 '25 20:10 dpernuit