UE4 Crashes due to FMODAmbient hot reload

Hello guys, recently I encountered a really weird problem that I dont know how to fix it :frowning:
I’m using UE 4.17.2 and the latest FMOD Integration for it. Everything works fine, event is played, I have packaged the games a couple of times and no problems found. But then just lately, I usually get engine crashes after compiling the game codes for a couple of times. After the crash, restarting the engine and this is the error :
///////////////////////////////////////////////////////////////////////////////
Assertion failed: GIsHotReload [File:D:\Build++UE4+Release-4.17+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectBase.cpp] [Line: 608] Trying to recreate class ‘AFMODAmbientSound’ outside of hot reload!

UE4Editor_CoreUObject!UObject::ConditionalBeginDestroy() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\coreuobject\private\uobject\obj.cpp:878]
UE4Editor_CoreUObject!StaticExit() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\coreuobject\private\uobject\obj.cpp:4194]
UE4Editor_CoreUObject!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:1027]
UE4Editor!TBaseMulticastDelegate::Broadcast() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:937]
UE4Editor!FEngineLoop::AppPreExit() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3858]
UE4Editor!FEngineLoop::Exit() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2808]
UE4Editor!GuardedMain() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launch.cpp:177]
UE4Editor!GuardedMainWrapper() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UE4Editor!WinMain() [d:\build++ue4+release-4.17+compile\sync\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]
///////////////////////////////////////////////////////////////////////////////
Before this message pops up, it said that my game module cannot be loaded. This error is fixed by recompiling the game code. Also I dont use any FMODAmbientSound in the game. Please help me :frowning: I’m really desperate right now. Thank you guys

I’m not sure what would cause this to happen, but it sounds like the crash left the game in a bad state.

Do you know the cause of the crash?
Did the crash logs mention anything about FMOD?

This page can tell you where to find them:
https://wiki.unrealengine.com/Locating_Project_Logs#Crash_Logs

Yes it did. It said AFMODAmbientSound cannot be created outside hot reload even though I dont even use fmodambiensound

Are you able to send us the crash log?
You can email it if you would like: support@fmod.com

I just uploaded to 4.19.2 and this problem seems to be gone. I believe this issue belongs to the engine hot reload itself rather than fmod. But I still sometimes receive the error that the UE4Editor-FMODStudio.dll hasnt been built and I need to rebuild it in order to open the engine

This usually occurs when the plugin source code is modified, because the UE4-FMOD libs are now out of date.
Are you using source control at all?

This is happening to me in UE 4.26 with FMod 2.01.09 and I am using GIt for my project

Are you able to share your output log file at all?

I am using UE 4.26.2 engine source from git with FMod 2.01.05.

Below is the call stack. hope you can solve it.

> UE4Editor-CoreUObject-Win64-Debug.dll!UObject::EnsureNotRetrievingVTablePtr() 줄 106 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UObject::UObject(const FObjectInitializer & ObjectInitializer) 줄 2581 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UStruct::UStruct(const FObjectInitializer & ObjectInitializer, UStruct * InSuperStruct, unsigned __int64 ParamsSize, unsigned __int64 Alignment) 줄 673 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UFunction::UFunction(const FObjectInitializer & ObjectInitializer, UFunction * InSuperFunction, EFunctionFlags InFunctionFlags, unsigned __int64 ParamsSize) 줄 5532 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UDelegateFunction::UDelegateFunction(const FObjectInitializer & ObjectInitializer, UFunction * InSuperFunction, EFunctionFlags InFunctionFlags, unsigned __int64 ParamsSize) 줄 6024 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UE4CodeGen_Private::ConstructUFunction(UFunction * & OutFunction, const UE4CodeGen_Private::FFunctionParams & Params) 줄 4459 C++
UE4Editor-FMODStudio-0002-Win64-Debug.dll!Z_Construct_UDelegateFunction_FMODStudio_OnEventStopped__DelegateSignature() 줄 143 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UE4CodeGen_Private::ConstructUPackage(UPackage * & OutPackage, const UE4CodeGen_Private::FPackageParams & Params) 줄 4596 C++
UE4Editor-FMODStudio-0002-Win64-Debug.dll!Z_Construct_UPackage__Script_FMODStudio() 줄 38 C++
UE4Editor-FMODStudio-0002-Win64-Debug.dll!EFMODEventControlKey_StaticEnum() 줄 29 C++
UE4Editor-FMODStudio-0002-Win64-Debug.dll!StaticEnum() 줄 36 C++
UE4Editor-FMODStudio-0002-Win64-Debug.dll!FFMODEventControlChannel::FFMODEventControlChannel() 줄 10 C++
UE4Editor-FMODStudio-0002-Win64-Debug.dll!UFMODEventControlSection::UFMODEventControlSection(FVTableHelper & Helper) 줄 227 C++
UE4Editor-FMODStudio-0002-Win64-Debug.dll!UFMODEventControlSection::__VTableCtorCaller(FVTableHelper & Helper) 줄 52 C++
UE4Editor-FMODStudio-0002-Win64-Debug.dll!InternalVTableHelperCtorCaller(FVTableHelper & Helper) 줄 3318 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UClass::HotReloadPrivateStaticClass(unsigned int InSize, EClassFlags InClassFlags, EClassCastFlags InClassCastFlags, const wchar_t * InConfigName, void()(const FObjectInitializer &) InClassConstructor, UObject ()(FVTableHelper &) InClassVTableHelperCtorCaller, void()(UObject *, FReferenceCollector &) InClassAddReferencedObjects, UClass * TClass_Super_StaticClass, UClass * TClass_WithinClass_StaticClass) 줄 5041 C++
UE4Editor-CoreUObject-Win64-Debug.dll!GetPrivateStaticClassBody(const wchar_t * PackageName, const wchar_t * Name, UClass * & ReturnClass, void()() RegisterNativeFunc, unsigned int InSize, unsigned int InAlignment, EClassFlags InClassFlags, EClassCastFlags InClassCastFlags, const wchar_t * InConfigName, void()(const FObjectInitializer &) InClassConstructor, UObject ()(FVTableHelper &) InClassVTableHelperCtorCaller, void(*)(UObject , FReferenceCollector &) InClassAddReferencedObjects, UClass ()() InSuperClassFn, UClass ()() InWithinClassFn, bool bIsDynamic, void()(UDynamicClass *) InDynamicClassInitializerFn) 줄 5436 C++
UE4Editor-FMODStudio-0002-Win64-Debug.dll!UFMODEventControlSection::GetPrivateStaticClass() 줄 221 C++
UE4Editor-FMODStudio-0002-Win64-Debug.dll!TClassCompiledInDefer::Register() 줄 301 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UClassRegisterAllCompiledInClasses() 줄 802 C++
UE4Editor-CoreUObject-Win64-Debug.dll!ProcessNewlyLoadedUObjects(FName Package, bool bCanProcessNewlyLoadedObjects) 줄 986 C++
UE4Editor-CoreUObject-Win64-Debug.dll!TBaseStaticDelegateInstance<void __cdecl(FName,bool),FDefaultDelegateUserPolicy>::ExecuteIfSafe(FName <Params_0>, bool <Params_1>) 줄 731 C++
UE4Editor-Core-Win64-Debug.dll!TMulticastDelegate<void __cdecl(FName,bool),FDefaultDelegateUserPolicy>::Broadcast(FName <Params_0>, bool <Params_1>) 줄 955 C++
UE4Editor-Core-Win64-Debug.dll!FModuleManager::LoadModuleWithFailureReason(const FName InModuleName, EModuleLoadResult & OutFailureReason) 줄 519 C++
UE4Editor-Core-Win64-Debug.dll!FModuleManager::LoadModule(const FName InModuleName) 줄 347 C++
UE4Editor-HotReload-Win64-Debug.dll!FHotReloadModule::DoHotReloadInternal(const TMap<FName,FString,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<FName,FString,0>> & ChangedModules, const TArray<UPackage *,TSizedDefaultAllocator<32>> & Packages, const TArray<FName,TSizedDefaultAllocator<32>> & InDependentModules, FOutputDevice & HotReloadAr) 줄 799 C++
UE4Editor-HotReload-Win64-Debug.dll!FHotReloadModule::DoHotReloadFromIDE(const TMap<FName,FString,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<FName,FString,0>> & NewModules) 줄 1526 C++
UE4Editor-HotReload-Win64-Debug.dll!FHotReloadModule::Tick(float DeltaTime) 줄 1467 C++

==== Watch ====

- this 0x0000025bd5972c00 (Name=OnEventStopped__DelegateSignature) UObject *
- UObjectBaseUtility (Name=OnEventStopped__DelegateSignature) UObjectBaseUtility
- UObjectBase (Name=OnEventStopped__DelegateSignature) UObjectBase
- __vfptr 0x00007ffc63a529d0 {UE4Editor-CoreUObject-Win64-Debug.dll!void(* UObject::vftable'[101])()} {0x00007ffc6345c1d0 {UE4Editor-CoreUObject-Win64-Debug.dll!UObject::vector deleting destructor’(unsigned int)}, …} void * *
[0] 0x00007ffc6345c1d0 {UE4Editor-CoreUObject-Win64-Debug.dll!UObject::`vector deleting destructor’(unsigned int)} void *
[1] 0x00007ffc62d9af68 {UE4Editor-CoreUObject-Win64-Debug.dll!UObjectBase::RegisterDependencies(void)} void *
[2] 0x00007ffc6365c330 {UE4Editor-CoreUObject-Win64-Debug.dll!UObjectBase::DeferredRegister(UClass *, const wchar_t *, const wchar_t *)} void *
ObjectFlags RF_Public RF_Transient
InternalIndex 21102 int
+ ClassPrivate 0x0000025b940aae80 (Name=DelegateFunction) UClass *
+ NamePrivate OnEventStopped__DelegateSignature FName
+ OuterPrivate 0x0000025bd5941c20 (Name=/Script/FMODStudio) UObject * {UPackage}

Are you able to update to 2.01.10, which is available on our Downloads page, as there have been a number of changes and updates to the 4.26 integration.