# Ue4 editor crashes when recompiling code, VTable ptr

**URL:** <https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619>\
**Category:** Unreal Engine\
**Created:** [April 5, 2022, 5:18am UTC](https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619 "2022-04-05T05:18:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarfax](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@Tarfax](https://qa.fmod.com/u/Tarfax)\
**Post date:** [April 5, 2022, 5:18am UTC](https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619/1 "2022-04-05T05:18:30Z")

</div>

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?

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/4/4b63efea60c879815775b0e2cb8eb191385eae03.png)

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [April 8, 2022, 5:57am UTC](https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619/2 "2022-04-08T05:57:51Z")

</div>

What version of FMOD and Unreal are you using?

---

<div class="post-metadata">

**Author:** ![Tarfax](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@Tarfax](https://qa.fmod.com/u/Tarfax)\
**Post date:** [April 8, 2022, 11:29am UTC](https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619/3 "2022-04-08T11:29:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Acodeon](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/acodeon/32/4505_2.png) [@Acodeon](https://qa.fmod.com/u/Acodeon)\
**Post date:** [January 20, 2023, 7:59am UTC](https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619/4 "2023-01-20T07:59:57Z")

</div>

I’m getting the same crash, any solutions?

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [January 22, 2023, 9:50pm UTC](https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619/5 "2023-01-22T21:50:51Z")

</div>

What version of FMOD and Unreal are you using?

---

<div class="post-metadata">

**Author:** ![Acodeon](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/acodeon/32/4505_2.png) [@Acodeon](https://qa.fmod.com/u/Acodeon)\
**Post date:** [January 23, 2023, 8:46am UTC](https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619/6 "2023-01-23T08:46:56Z")

</div>

Unreal 4.27 and FMOD plugin 2.02.07

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [January 23, 2023, 11:31pm UTC](https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619/7 "2023-01-23T23:31:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![osome](https://avatars.discourse-cdn.com/v4/letter/o/ee59a6/32.png) [@osome](https://qa.fmod.com/u/osome)\
**Post date:** [February 6, 2023, 9:45am UTC](https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619/8 "2023-02-06T09:45:33Z")

</div>

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

```auto
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

```auto
>	[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](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/4/49edb9cd8f443e6e525587cc12546a918ce374b2.png)

Any progress in your investigation Jeff ?

Best;

Mathieu

---

<div class="post-metadata">

**Author:** ![Tarfax](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@Tarfax](https://qa.fmod.com/u/Tarfax)\
**Post date:** [February 7, 2023, 6:46pm UTC](https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619/9 "2023-02-07T18:46:58Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [February 13, 2023, 1:20am UTC](https://qa.fmod.com/t/ue4-editor-crashes-when-recompiling-code-vtable-ptr/18619/10 "2023-02-13T01:20:21Z")

</div>

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** ”

```diff
//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** ”

```diff
//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** ”

```diff
//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](https://fmod.com/docs/2.02/api/studio-api-eventinstance.html#fmod_studio_event_callback_type) in C++, you just won’t be able to do so with blueprints.
