I’ve been running into a weird crash on my new project in UE5.4.2, the project is primarily C++ with minimal blueprint work. The game runs perfectly fine playing in editor, playing the shipping build crashes with this exception & callstack:
Exception thrown at 0x00007FF6621C384F in BinarySiege-Win64-Shipping.exe: 0xC0000005: Access violation reading location 0x0000000000000020.
Playground-Win64-Shipping.exe!UObject::execCallMathFunction(class UObject *,struct FFrame &,void * const) C++
Playground-Win64-Shipping.exe!ProcessLocalScriptFunction(class UObject *,struct FFrame &,void * const) C++
Playground-Win64-Shipping.exe!ProcessScriptFunction<void (*)(class UObject *,struct FFrame &,void *)>(class UObject *,class UFunction *,struct FFrame &,void * const,void (*)(class UObject *,struct FFrame &,void *)) C++
Playground-Win64-Shipping.exe!UObject::execLocalFinalFunction(class UObject *,struct FFrame &,void * const) C++
Playground-Win64-Shipping.exe!ProcessLocalScriptFunction(class UObject *,struct FFrame &,void * const) C++
Playground-Win64-Shipping.exe!UObject::ProcessInternal(class UObject *,struct FFrame &,void * const) C++
Playground-Win64-Shipping.exe!UFunction::Invoke(class UObject *,struct FFrame &,void * const) C++
Playground-Win64-Shipping.exe!UObject::ProcessEvent(class UFunction *,void *) C++
Playground-Win64-Shipping.exe!AActor::ProcessEvent(class UFunction *,void *) C++
Playground-Win64-Shipping.exe!AActor::BeginPlay(void) C++
Playground-Win64-Shipping.exe!AActor::DispatchBeginPlay(bool) C++
Playground-Win64-Shipping.exe!AWorldSettings::NotifyBeginPlay(void) C++
Playground-Win64-Shipping.exe!AGameStateBase::HandleBeginPlay(void) C++
Playground-Win64-Shipping.exe!UWorld::BeginPlay(void) C++
Playground-Win64-Shipping.exe!UEngine::LoadMap(struct FWorldContext &,struct FURL,class UPendingNetGame *,class FString &) C++
Playground-Win64-Shipping.exe!UEngine::Browse(struct FWorldContext &,struct FURL,class FString &) C++
Playground-Win64-Shipping.exe!UGameInstance::StartGameInstance(void) C++
Playground-Win64-Shipping.exe!FEngineLoop::Init(void) C++
Playground-Win64-Shipping.exe!GuardedMain(wchar_t const *) C++
Playground-Win64-Shipping.exe!GuardedMainWrapper(wchar_t const *) C++
Playground-Win64-Shipping.exe!LaunchWindowsStartup(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int,wchar_t const *) C++
Playground-Win64-Shipping.exe!WinMain() C++
> [Inline Frame] Playground-Win64-Shipping.exe!invoke_main() Line 102 C++
Playground-Win64-Shipping.exe!__scrt_common_main_seh() Line 288 C++
I’m struggling to work out where to look next for a cause or solution. Any suggestions/comments welcome.
Some context & testing I’ve done:
- My game uses a custom GameStateBase derived GameState, the crash is the same whether I use this or revert to the standard GameStateBase.
- The world has no actors on startup aside from the defaults Unreal creates and a camera, everything gets spawned by the GameState, which never actually runs.
- The crash is in some kind of Local Script (Blueprint?) Math functions - I do not have any maths I’m aware of happening in blueprints
- Loading into a different Map works fine, then transitioning into this map crashes immediately.
- Creating an empty dummy world and assigning my GameMode (whigh has custom PlayerController and HUD C++ classes) causes the same crash.
- Removing the BeginPlay->SetScalabilityQualityToEpic node I have on the GameMode fixes the crash in my dummy world, and changes the crash in my real world to occur in
Playground-Win64-Shipping.exe!APlayerCameraManager::UpdateViewTarget(struct FTViewTarget &,float) C++
Playground-Win64-Shipping.exe!APlayerCameraManager::DoUpdateCamera(float) C++
Playground-Win64-Shipping.exe!APlayerCameraManager::UpdateCamera(float) C++
Playground-Win64-Shipping.exe!UWorld::Tick(enum ELevelTick,float) C++
Playground-Win64-Shipping.exe!UGameEngine::Tick(float,bool) C++
Playground-Win64-Shipping.exe!FEngineLoop::Tick(void) C++
Playground-Win64-Shipping.exe!GuardedMain(wchar_t const *) C++
Playground-Win64-Shipping.exe!GuardedMainWrapper(wchar_t const *) C++
Playground-Win64-Shipping.exe!LaunchWindowsStartup(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int,wchar_t const *) C++
Playground-Win64-Shipping.exe!WinMain() C++
> [Inline Frame] Playground-Win64-Shipping.exe!invoke_main() Line 102 C++
Removing the Camera’s “Auto Activate For Player” setting fixes this crash and the game now loads, although with no camra so it’s a bit broken!
These two different crashes in engine code make me thing something is rather screwed up in my project, but I have no idea how to tell where. I also have no idea why this would be different in Shipping - PlayInEditor always works absolutely fine.