Hot Reload crashes Editor

Since 4.25 HotReload doesn’t work properly. Everytime when I compile a project in Visual Studio or inside UE4 Editor I’ve got a crash with the following CallStack and Exception

Unhandled exception at 0x00007FF9AC0F0DA8 (UE4Editor-CoreUObject.dll) in UE4Minidump.dmp: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF. occurred

[Inline Frame] UE4Editor-CoreUObject.dll!FField::HasAnyCastFlags(const unsigned __int64) Line 499 C++
[Inline Frame] UE4Editor-CoreUObject.dll!CastField(FField *) Line 796 C++
[Inline Frame] UE4Editor-CoreUObject.dll!TFieldPath::{ctor}(FField * InProperty, TFieldPath::EDummy1) Line 325 C++
UE4Editor-CoreUObject.dll!FPropertyProxyArchive::operator<<(FField * & Value) Line 45 C++
[Inline Frame] UE4Editor-CoreUObject.dll!operator<<(FArchive &) Line 93 C++
UE4Editor-CoreUObject.dll!UStruct::SerializeExpr(int & iCode, FArchive & Ar) Line 222 C++
UE4Editor-CoreUObject.dll!UStruct::SerializeExpr(int & iCode, FArchive & Ar) Line 314 C++
UE4Editor-CoreUObject.dll!UStruct::Serialize(FArchive & Ar) Line 1925 C++
UE4Editor-CoreUObject.dll!UFunction::Serialize(FArchive & Ar) Line 5555 C++
[Inline Frame] UE4Editor-HotReload.dll!FHotReloadModule::ReplaceReferencesToReconstructedCDOs::__l2::FFindRefTask::DoWork() Line 983 C++
UE4Editor-HotReload.dll!FAsyncTask<FHotReloadModule::ReplaceReferencesToReconstructedCDOs'::2’::FFindRefTask>::DoWork() Line 271 C++
UE4Editor-HotReload.dll!FAsyncTask<FHotReloadModule::ReplaceReferencesToReconstructedCDOs'::2’::FFindRefTask>::DoThreadedWork() Line 296 C++
UE4Editor-Core.dll!FQueuedThread::Run() Line 855 C++
UE4Editor-Core.dll!FRunnableThreadWin::Run() Line 86 C++
UE4Editor-Core.dll!FRunnableThreadWin::GuardedRun() Line 35 C++

I am getting the same error since upgrading to 4.25.1 with the same call stack. If you want to try to troubleshoot this with me here’s my company Discord: PARIAH

Did you get anywhere with this? I’m getting the same crash, 4.25, when compiling blueprints in editor…

Same here, I am looking for an answer to this.

Same s*** here

Different callstack but same issue for me. About a third of all hot-reloads from Visual Studio crash the editor. 4.25 has been absolute hell for me, the editor crashes far more often than it did in 4.24.

Exact same error for me, all the time. Don’t know what’s going on…

This started happening on our team when we switched to 4.25 as well.

For our project, this was caused by doing the following in an Actor’s constructor:

FSoftClassPath ClassReference = ...
UClass* MyClass = ClassReference.ResolveClass();
if (!MyClass)
    MyClass = ClassReference.TryLoadClass<AMyClass>();

Protecting this code with

if (!HasAnyFlags(RF_ClassDefaultObject))

solved the hot reloading issue.

1 Like

Same issue in 4.26

The bengoog’s answer really points to the right side. I’d add a more general assumption: any complicated stuff in U- and A- classes’ constructors should be relocated to other functions or protected like in the unswer above. In my case a similar crash was caused by a TArray::SetNum() + elements initializing in a constructor. So the main problem is to keep in mind all your subclasses and go through them all.

1 Like