Ue4 editor crashes when recompiling code, VTable ptr

This wasn’t a problem before, but when I started using programmer instruments with our localization team the editor keeps crashing every time I recompile the code.
It doesn’t matter what code, the same crash report shows up.

Any idea why this happens?

What version of FMOD and Unreal are you using?

Its Ue4 4.27.2 and FMOD 2.02.06 so everything is latest.

For what I can tell, anything that I reference that has to do with FMOD will cause this crash when recompiling the code.

Adding a FmodAudioComponent makes this crash, referencing a bank asset for load or unloading banks causes this crash, just having an event referenced as a function input causes this crash.

I ended up removing every reference to Fmod in c++ and is now doing everything in blueprints instead.

I’m getting the same crash, any solutions?

What version of FMOD and Unreal are you using?

Unreal 4.27 and FMOD plugin 2.02.07

Thank you for the additional information. The trace from the previously posted crash is indicating an issue with the sequencer- are you scripting anything related to FMOD events in the Unreal sequencer?
If not, can you please share the crash you are getting, and provide a little more information on when this crash started occurring?

Hi,
We have same problem here, when we put any UFModEvent* property in any C++ class.

Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/CoreUObject/Private/UObject/Obj.cpp] [Line: 107] We are currently retrieving VTable ptr. Please use FVTableHelper constructor instead.

UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_FMODStudio_0004!Z_Construct_UDelegateFunction_FMODStudio_OnEventStopped__DelegateSignature() [....\Plugins\FMODStudio\Intermediate\Build\Win64\UE4Editor\Inc\FMODStudio\FMODAudioComponent.gen.cpp:143]
UE4Editor_CoreUObject
UE4Editor_FMODStudio_0004!Z_Construct_UPackage__Script_FMODStudio() [....\Plugins\FMODStudio\Intermediate\Build\Win64\UE4Editor\Inc\FMODStudio\FMODStudio.init.gen.cpp:38]
UE4Editor_FMODStudio_0004!StaticEnum<enum EFMODEventControlKey>() [....\Plugins\FMODStudio\Intermediate\Build\Win64\UE4Editor\Inc\FMODStudio\FMODEventControlSection.gen.cpp:35]
UE4Editor_FMODStudio_0004!FFMODEventControlChannel::FFMODEventControlChannel() [....\Plugins\FMODStudio\Source\FMODStudio\Private\Sequencer\FMODEventControlSection.cpp:10]
UE4Editor_FMODStudio_0004!InternalVTableHelperCtorCaller<UFMODEventControlSection>() [C:\Program Files\Epic Games\UE_4.27\Engine\Source\Runtime\CoreUObject\Public\UObject\Class.h:3386]
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_FMODStudio_0004!UFMODEventControlSection::GetPrivateStaticClass() [....\Plugins\FMODStudio\Intermediate\Build\Win64\UE4Editor\Inc\FMODStudio\FMODEventControlSection.gen.cpp:221]
UE4Editor_FMODStudio_0004!TClassCompiledInDefer<UFMODEventControlSection>::Register() [C:\Program Files\Epic Games\UE_4.27\Engine\Source\Runtime\CoreUObject\Public\UObject\UObjectBase.h:301]
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_HotReload
UE4Editor_HotReload
UE4Editor_HotReload
UE4Editor_Core
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

Call stack with engine source code

>	[Inline Frame] UE4Editor-CoreUObject.dll!UObject::EnsureNotRetrievingVTablePtr::__l10::<lambda_1f85876b12194a091a53bae9bfd3e73f>::()::__l6::<lambda_90622c08f21b1b8c7866b3fdab711b59>::operator()() Line 107	C++
 	[Inline Frame] UE4Editor-CoreUObject.dll!UObject::EnsureNotRetrievingVTablePtr::__l10::<lambda_1f85876b12194a091a53bae9bfd3e73f>::operator()(const FLogCategoryLogCore & LCategoryName, const wchar_t[86] &) Line 107	C++
 	UE4Editor-CoreUObject.dll!UObject::EnsureNotRetrievingVTablePtr() Line 107	C++
 	UE4Editor-CoreUObject.dll!UObject::UObject(const FObjectInitializer & ObjectInitializer) Line 2618	C++
 	[Inline Frame] UE4Editor-CoreUObject.dll!UField::{ctor}(const FObjectInitializer &) Line 66	C++
 	[Inline Frame] UE4Editor-CoreUObject.dll!UStruct::{ctor}(const FObjectInitializer &) Line 675	C++
 	UE4Editor-CoreUObject.dll!UFunction::UFunction(const FObjectInitializer & ObjectInitializer, UFunction * InSuperFunction, EFunctionFlags InFunctionFlags, unsigned __int64 ParamsSize) Line 5614	C++
 	UE4Editor-CoreUObject.dll!UDelegateFunction::UDelegateFunction(const FObjectInitializer & ObjectInitializer, UFunction * InSuperFunction, EFunctionFlags InFunctionFlags, unsigned __int64 ParamsSize) Line 6121	C++
 	UE4Editor-CoreUObject.dll!UE4CodeGen_Private::ConstructUFunction(UFunction * & OutFunction, const UE4CodeGen_Private::FFunctionParams & Params) Line 4499	C++
 	UE4Editor-FMODStudio-0001.dll!Z_Construct_UDelegateFunction_FMODStudio_OnEventStopped__DelegateSignature() Line 143	C++
 	UE4Editor-CoreUObject.dll!UE4CodeGen_Private::ConstructUPackage(UPackage * & OutPackage, const UE4CodeGen_Private::FPackageParams & Params) Line 4635	C++
 	UE4Editor-FMODStudio-0001.dll!Z_Construct_UPackage__Script_FMODStudio() Line 38	C++
 	[Inline Frame] UE4Editor-FMODStudio-0001.dll!EFMODEventControlKey_StaticEnum() Line 29	C++
 	UE4Editor-FMODStudio-0001.dll!StaticEnum<enum EFMODEventControlKey>() Line 35	C++
 	UE4Editor-FMODStudio-0001.dll!FFMODEventControlChannel::FFMODEventControlChannel() Line 10	C++
 	[Inline Frame] UE4Editor-FMODStudio-0001.dll!UFMODEventControlSection::{ctor}(FVTableHelper &) Line 227	C++
 	[Inline Frame] UE4Editor-FMODStudio-0001.dll!UFMODEventControlSection::__VTableCtorCaller(FVTableHelper &) Line 52	C++
 	UE4Editor-FMODStudio-0001.dll!InternalVTableHelperCtorCaller<UFMODEventControlSection>(FVTableHelper & Helper) Line 3386	C++
 	UE4Editor-CoreUObject.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) Line 5125	C++
 	UE4Editor-CoreUObject.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) Line 5527	C++
 	UE4Editor-FMODStudio-0001.dll!UFMODEventControlSection::GetPrivateStaticClass() Line 221	C++
 	[Inline Frame] UE4Editor-FMODStudio-0001.dll!UFMODEventControlSection::StaticClass() Line 52	C++
 	UE4Editor-FMODStudio-0001.dll!TClassCompiledInDefer<UFMODEventControlSection>::Register() Line 301	C++
 	UE4Editor-CoreUObject.dll!UClassRegisterAllCompiledInClasses() Line 805	C++
 	UE4Editor-CoreUObject.dll!ProcessNewlyLoadedUObjects(FName Package, bool bCanProcessNewlyLoadedObjects) Line 989	C++
 	[Inline Frame] UE4Editor-CoreUObject.dll!Invoke(void(*)(FName, bool) &) Line 51	C++
 	[Inline Frame] UE4Editor-CoreUObject.dll!UE4Tuple_Private::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(*)(FName, bool) &) Line 306	C++
 	UE4Editor-CoreUObject.dll!TBaseStaticDelegateInstance<void __cdecl(FName,bool),FDefaultDelegateUserPolicy>::ExecuteIfSafe(FName <Params_0>, bool <Params_1>) Line 731	C++
 	UE4Editor-Core.dll!TMulticastDelegate<void __cdecl(FName,bool),FDefaultDelegateUserPolicy>::Broadcast(FName <Params_0>, bool <Params_1>) Line 955	C++
 	UE4Editor-Core.dll!FModuleManager::LoadModuleWithFailureReason(const FName InModuleName, EModuleLoadResult & OutFailureReason) Line 519	C++
 	UE4Editor-Core.dll!FModuleManager::LoadModule(const FName InModuleName) Line 353	C++
 	UE4Editor-HotReload.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) Line 799	C++
 	[Inline Frame] UE4Editor-HotReload.dll!FHotReloadModule::RebindPackagesInternal::__l2::<lambda_d85446a946c3f6776c68ebfeb93e5785>::operator()(const TMap<FName,FString,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<FName,FString,0>> &) Line 1161	C++
 	[Inline Frame] UE4Editor-HotReload.dll!Invoke(FHotReloadModule::RebindPackagesInternal::__l2::<lambda_d85446a946c3f6776c68ebfeb93e5785> &) Line 51	C++
 	UE4Editor-HotReload.dll!UE4Function_Private::TFunctionRefCaller<<lambda_d85446a946c3f6776c68ebfeb93e5785>,void __cdecl(TMap<FName,FString,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<FName,FString,0>> const &,bool,enum ECompilationResult::Type)>::Call(void * Obj, const TMap<FName,FString,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<FName,FString,0>> & <Params_0>, bool & <Params_1>, ECompilationResult::Type & <Params_2>) Line 549	C++
 	[Inline Frame] UE4Editor-HotReload.dll!UE4Function_Private::TFunctionRefBase<UE4Function_Private::TFunctionStorage<0>,void __cdecl(TMap<FName,FString,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<FName,FString,0>> const &,bool,enum ECompilationResult::Type)>::operator()(const TMap<FName,FString,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<FName,FString,0>> & <Params_1>, bool <Params_2>, ECompilationResult::Type) Line 676	C++
 	UE4Editor-HotReload.dll!FHotReloadModule::CheckForFinishedModuleDLLCompile(EHotReloadFlags Flags, bool & bCompileStillInProgress, bool & bCompileSucceeded, FOutputDevice & Ar, bool bFireEvents) Line 1863	C++
 	UE4Editor-HotReload.dll!FHotReloadModule::Tick(float DeltaTime) Line 1415	C++
 	[Inline Frame] UE4Editor-Core.dll!TDelegate<bool __cdecl(float),FDefaultDelegateUserPolicy>::Execute(float) Line 580	C++
 	[Inline Frame] UE4Editor-Core.dll!FTicker::FElement::Fire(float) Line 127	C++
 	UE4Editor-Core.dll!FTicker::Tick(float DeltaTime) Line 95	C++
 	UE4Editor.exe!FEngineLoop::Tick() Line 5132	C++
 	[Inline Frame] UE4Editor.exe!EngineTick() Line 62	C++
 	UE4Editor.exe!GuardedMain(const wchar_t * CmdLine) Line 178	C++
 	UE4Editor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 262	C++
 	UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 320	C++
 	[Inline Frame] UE4Editor.exe!invoke_main() Line 102	C++
 	UE4Editor.exe!__scrt_common_main_seh() Line 288	C++

Note : It happens when hitting “Compile” for the 2nd time.
image

Any progress in your investigation Jeff ?

Best;

Mathieu

If its any help, I suspect it has to do with multi-threading.

Also, you get the crash if you’re using Rider. Visual Studio seems to handle this?

Thank you for the additional information, I have reproduced this issue now. There appears to be an issue with the OnEventStopped, OnTimelineMarker and OnTimelineBeat callback delegates. I have found that removing them from the FMODStudio plugin allows hot reloading to succeed without issue.
I have passed this onto the Dev team to fix in a future release. In the meantime, presuming you won’t be needing those callbacks in the immediate future, you can do the following to get back to a working state:

  1. Delete the “Plugins\FMODStudio\Intermediate” directory
  2. Comment out OnEventStopped, OnTimelineMarker and OnTimelineBeat from “Plugins\FMODStudio\Source\FMODStudio\Classes\FMODStudioComponent.h
//FMODAudioComponent.h ~Line 103
    /** Called when an event stops, either because it played to completion or because a Stop() call turned it off early. */
+   //UPROPERTY(BlueprintAssignable)
+   //FOnEventStopped OnEventStopped;

    /** Called when we reach a named marker (if bEnableTimelineCallbacks is true). */
+   //UPROPERTY(BlueprintAssignable)
+   //FOnTimelineMarker OnTimelineMarker;

    /** Called when we reach a beat of a tempo (if bEnableTimelineCallbacks is true). */
+   //UPROPERTY(BlueprintAssignable)
+   //FOnTimelineBeat OnTimelineBeat;
  1. Comment out references to OnEventStopped, OnTimelineMarker and OnTimelineBeat in “Plugins\FMODStudio\Source\FMODStudio\Private\FMODAudioComponent.cpp
//FMODAudioComponent.cpp ~Line 335
void UFMODAudioComponent::EndPlay(const EEndPlayReason::Type EndPlayReason){
...
    if (shouldStop)
    {
        Stop();
+       //OnEventStopped.Broadcast();
    }
    Release();
}
...
//~Line 366
void UFMODAudioComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
{
...
    for (const FTimelineMarkerProperties &EachProps : LocalMarkerQueue)
    {
+       //OnTimelineMarker.Broadcast(EachProps.Name, EachProps.Position);
    }
    for (const FTimelineBeatProperties &EachProps : LocalBeatQueue)
    {
+       //OnTimelineBeat.Broadcast(EachProps.Bar, EachProps.Beat, EachProps.Position, EachProps.Tempo, EachProps.TimeSignatureUpper, EachProps.TimeSignatureLower);
    }
}

...

//~Line 793
void UFMODAudioComponent::OnPlaybackCompleted()
{
...
    if (StudioInstance)
    {
        UE_LOG(LogFMOD, Verbose, TEXT("UFMODAudioComponent %p PlaybackCompleted"), this);
        Release();

        // Fire callback after we have cleaned up our instance
+       //OnEventStopped.Broadcast();
    }
...
}
  1. Comment out references to OnEventStopped, OnTimelineMarker and OnTimelineBeat in “Plugins\FMODStudio\Source\FMODStudio\Classes\FMODAudioComponent.h
//FMODAudioComponent.h ~Line 170
    /** Called when an event stops, either because it played to completion or because a Stop() call turned it off early. */
+   //UPROPERTY(BlueprintAssignable)
+   //FOnEventStopped OnEventStopped;

    /** Called when we reach a named marker (if bEnableTimelineCallbacks is true). */
+   //UPROPERTY(BlueprintAssignable)
+   //FOnTimelineMarker OnTimelineMarker;

    /** Called when we reach a beat of a tempo (if bEnableTimelineCallbacks is true). */
+   //UPROPERTY(BlueprintAssignable)
+   //FOnTimelineBeat OnTimelineBeat;
  1. Build your project from Visual Studio

After that, hot reloading should behave as expected. With these changes, you can still implement your own event callbacks in C++, you just won’t be able to do so with blueprints.