UE5 Version: Version: 5.3.2-29314046+++UE5+Release-5.3
Background: Making a snake game for my first game, got a snake head that I can move around with Up-Down-Left-Right with keyboard input events, on starting the game, the snake head by default remains stationary until one of the four arrow keys is pressed.
Behavior: On starting the game, directly press 1, it adds an actor(a cube with a box collision, no event, logic at all), randomly on the map, and UE5 will reliably crash.
However, if I choose to move the snake head first THEN press 1 to generate random snake food to the game, it’s work just fine, I tried to bind the Exec to Begin Play and it does NOT crash on starting the game.
This is my first post ever in this forum, not sure what log you’d need to collect.
my question is could it be that I’m doing something wrong that’s causing UE5 to crash?
Thanks in advance.
Hey there @XYZ_po_tato! Welcome to the community! This is a bit of an odd one! When the crash occurs, you could grab the crash context from the window that appears, that would assist us in understanding the error. Though you can also retrieve logs from your project folder saved/logs
and crash logs from saved/crashes
and they have significantly more information about the crash than just the basic context window.
Does the spawning blueprint take into account anything to do with the snake head, such as setting a reference after it starts moving?
@SupportiveEntity Hi Thanks for your reply!
Here’s the crash log,
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000000001d0
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_EnhancedInput
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Core
UnrealEditor_Core
UnrealEditor_Core
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll
Unfortunately it doesn’t let me upload files as a new user, any other way that I can share my crash log here? could a google drive share work?
For snake head, the BeginPlay event hooks up with enable input → disable mouse look
Then I have 4 keyboard input events set up(Up, Down, Left, Right to control the snake head). Other than these I have a OnBeginOverlap → cast to snakeFood(which contains a cube and a box collision, no event, no logic at all) → destroy actor(AS snakeBody) → print message
I tried to un-link the CAST-TO part of the onOnBeginOverlap, and tried to spawn the snakeFood on starting the game without moving the snakehead, it does NOT crash in the case. So I’m inclined to believe CAST-TO required some sort of initialization that apparently didn’t happen after BeginPlay was called, it was only able to spawn the snake food after I move the snake head.
Here’s the project including the crash log folder Let me know if you need more information!
Ahh doesn’t look like you have editor symbols installed, I would recommend adding them for future debugging for sure, I’ll leave a video that goes over it and some other helpful things!
Apologies, that feature of the forums blocks new users from posting files to block spam bots. You could post the logs to google drive or pastebin.
Edit: missed your original edits, will formulate a reply based on them in a bit.
Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.
There likely lies your problem. Casting to a null value could be the case, as well as operating before initialization can often cause issues.
hmm maybe I need to add the actor at the beginning of the game, I hope this is the bug cause. Still downloading the debugging utils so gonna find out in just a bit. Thanks!
I tried to add actor at OnBeginPlay, the crash still happens with the same workflow. I was able to get a detailed error stack here:
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000000001d0
UnrealEditor_Engine!UE::CoreUObject::Private::ResolveObjectHandle() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\ObjectHandle.h:217]
UnrealEditor_Engine!UChildActorComponent::CreateChildActor() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\ChildActorComponent.cpp:833]
UnrealEditor_Engine!UChildActorComponent::OnRegister() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\ChildActorComponent.cpp:105]
UnrealEditor_Engine!UActorComponent::ExecuteRegisterEvents() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\ActorComponent.cpp:1674]
UnrealEditor_Engine!UActorComponent::RegisterComponentWithWorld() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\ActorComponent.cpp:1346]
UnrealEditor_Engine!AActor::FinishAddComponent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\ActorConstruction.cpp:1326]
UnrealEditor_Engine!AActor::AddComponent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\ActorConstruction.cpp:1250]
UnrealEditor_Engine!AActor::execAddComponent() [D:\build\++UE5\Sync\Engine\Intermediate\Build\Win64\UnrealEditor\Inc\Engine\UHT\Actor.gen.cpp:1662]
UnrealEditor_CoreUObject!UFunction::Invoke() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:6665]
UnrealEditor_CoreUObject!UObject::CallFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1139]
UnrealEditor_CoreUObject!UObject::execLetObj() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2884]
UnrealEditor_CoreUObject!ProcessLocalScriptFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1209]
UnrealEditor_CoreUObject!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1039]
UnrealEditor_CoreUObject!ProcessLocalFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1279]
UnrealEditor_CoreUObject!ProcessLocalScriptFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1209]
UnrealEditor_CoreUObject!UObject::ProcessInternal() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1306]
UnrealEditor_CoreUObject!UFunction::Invoke() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:6665]
UnrealEditor_CoreUObject!UObject::ProcessEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2145]
UnrealEditor_Engine!AActor::ProcessEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:1122]
UnrealEditor_Engine!TScriptDelegate<FNotThreadSafeDelegateMode>::ProcessDelegate<UObject>() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\UObject\ScriptDelegates.h:448]
UnrealEditor_Engine!FInputActionHandlerDynamicSignature_DelegateWrapper() [D:\build\++UE5\Sync\Engine\Intermediate\Build\Win64\UnrealEditor\Inc\Engine\UHT\InputComponent.gen.cpp:73]
UnrealEditor_Engine!FInputActionUnifiedDelegate::Execute() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Classes\Components\InputComponent.h:302]
UnrealEditor_Engine!UPlayerInput::EvaluateInputDelegates() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\UserInterface\PlayerInput.cpp:1492]
UnrealEditor_EnhancedInput!UEnhancedPlayerInput::EvaluateInputDelegates() [D:\build\++UE5\Sync\Engine\Plugins\EnhancedInput\Source\EnhancedInput\Private\EnhancedPlayerInput.cpp:735]
UnrealEditor_Engine!UPlayerInput::ProcessInputStack() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\UserInterface\PlayerInput.cpp:1125]
UnrealEditor_Engine!APlayerController::ProcessPlayerInput() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:2687]
UnrealEditor_Engine!APlayerController::TickPlayerInput() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:4966]
UnrealEditor_Engine!APlayerController::PlayerTick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:2291]
UnrealEditor_Engine!APlayerController::TickActor() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:5123]
UnrealEditor_Engine!FActorTickFunction::ExecuteTick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:251]
UnrealEditor_Engine!FTickFunctionTask::DoTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:278]
UnrealEditor_Engine!TGraphTask<FTickFunctionTask>::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:1265]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksNamedThread() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:758]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:649]
UnrealEditor_Core!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:2125]
UnrealEditor_Engine!FTickTaskSequencer::ReleaseTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:556]
UnrealEditor_Engine!FTickTaskManager::RunTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:1583]
UnrealEditor_Engine!UWorld::RunTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:771]
UnrealEditor_Engine!UWorld::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1515]
UnrealEditor_UnrealEd!UEditorEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1924]
UnrealEditor_UnrealEd!UUnrealEdEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:531]
UnrealEditor!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5825]
UnrealEditor!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:188]
UnrealEditor!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:118]
UnrealEditor!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:258]
UnrealEditor!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:298]
UnrealEditor!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll
Any idea?