Development packaged build random crashes during gameplay (UE4.27.2)

Hi. I’m working on a small project, and so far I haven’t had any issues myself, neither in editor nor packaged build. Today I’ve sent my friend a new build for testing purposes, and he’s randomly crashing in the first few minutes of playing. I’ve checked 4 of the crash logs he sent me, and it seems that only one brought up any error, the rest just simply closed the game down and that was it. I’m really scratching my head around this one, any help would be greatly appreciated.

Below I’m gonna link some of the last lines of one log with no errors, and one with errors at the very end:

[2022.08.30-14.16.38:220][266]LogStaticMesh: [SM_Energy_1] Mesh is marked for CPU read.
[2022.08.30-14.16.38:446][266]LogAudio: Display: Audio Device (ID: 1) registered with world ‘MainLevel_Level’.
[2022.08.30-14.16.38:449][266]LogAIModule: Creating AISystem for world MainLevel_Level
[2022.08.30-14.16.38:450][266]LogLoad: Game class is ‘MainGame_GameMode_C’
[2022.08.30-14.16.39:191][266]LogWorld: Bringing World /Game/Blueprints_Core/Levels/MainLevel_Level.MainLevel_Level up for play (max tick rate 0) at 2022.08.30-16.16.39
[2022.08.30-14.16.39:192][266]LogWorld: Bringing up level for play took: 0.741731
[2022.08.30-14.16.39:195][266]LogGameMode: FindPlayerStart: PATHS NOT DEFINED or NO PLAYERSTART with positive rating
[2022.08.30-14.16.39:195][266]LogSpawn: Warning: SpawnActor failed because no class was specified
[2022.08.30-14.16.39:200][266]LogLoad: Took 1.218537 seconds to LoadMap(/Game/Blueprints_Core/Levels/MainLevel_Level)
[2022.08.30-14.16.39:337][266]LogSlate: InvalidateAllWidgets triggered. All widgets were invalidated
[2022.08.30-14.16.39:359][266]LogSlate: Took 0.000328 seconds to synchronously load lazily loaded font ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Regular.ttf’ (155K)
[2022.08.30-14.16.41:988][267]LogSlate: Took 0.000429 seconds to synchronously load lazily loaded font ‘…/…/…/DronTesting/Content/Fonts/Russo_One.ufont’ (186K)
[2022.08.30-14.17.01:521][435]LogSlate: Took 0.000495 seconds to synchronously load lazily loaded font ‘…/…/…/Engine/Content/EngineFonts/Faces/RobotoBold.ufont’ (160K)
[2022.08.30-14.17.05:346][665]LogViewport: Display: Viewport MouseLockMode Changed, LockOnCapture → DoNotLock
[2022.08.30-14.17.05:346][665]LogViewport: Display: Viewport MouseCaptureMode Changed, CapturePermanently → CaptureDuringMouseDown
[2022.08.30-14.17.06:728][746]LogViewport: Display: Viewport MouseLockMode Changed, DoNotLock → LockOnCapture
[2022.08.30-14.17.06:729][746]LogViewport: Display: Viewport MouseCaptureMode Changed, CaptureDuringMouseDown → CapturePermanently
[2022.08.30-14.17.47:786][207]LogViewport: Display: Viewport MouseLockMode Changed, LockOnCapture → DoNotLock
[2022.08.30-14.17.47:787][207]LogViewport: Display: Viewport MouseCaptureMode Changed, CapturePermanently → CaptureDuringMouseDown
[2022.08.30-14.17.49:097][279]LogViewport: Display: Viewport MouseLockMode Changed, DoNotLock → LockOnCapture
[2022.08.30-14.17.49:097][279]LogViewport: Display: Viewport MouseCaptureMode Changed, CaptureDuringMouseDown → CapturePermanently
[2022.08.30-14.17.54:504][599]LogSlate: Took 0.000563 seconds to synchronously load lazily loaded font ‘…/…/…/DronTesting/Content/Fonts/BorisBlackBloxx.ufont’ (52K)
[2022.08.30-14.18.07:610][365]LogViewport: Display: Viewport MouseLockMode Changed, LockOnCapture → DoNotLock
[2022.08.30-14.18.07:610][365]LogViewport: Display: Viewport MouseCaptureMode Changed, CapturePermanently → CaptureDuringMouseDown
[2022.08.30-14.18.09:348][447]LogViewport: Display: Viewport MouseLockMode Changed, DoNotLock → LockOnCapture
[2022.08.30-14.18.09:349][447]LogViewport: Display: Viewport MouseCaptureMode Changed, CaptureDuringMouseDown → CapturePermanently


[2022.08.30-14.40.38:280][477]LogAIModule: Creating AISystem for world MainLevel_Level
[2022.08.30-14.40.38:281][477]LogLoad: Game class is ‘MainGame_GameMode_C’
[2022.08.30-14.40.39:001][477]LogWorld: Bringing World /Game/Blueprints_Core/Levels/MainLevel_Level.MainLevel_Level up for play (max tick rate 0) at 2022.08.30-16.40.39
[2022.08.30-14.40.39:002][477]LogWorld: Bringing up level for play took: 0.720228
[2022.08.30-14.40.39:004][477]LogGameMode: FindPlayerStart: PATHS NOT DEFINED or NO PLAYERSTART with positive rating
[2022.08.30-14.40.39:004][477]LogSpawn: Warning: SpawnActor failed because no class was specified
[2022.08.30-14.40.39:009][477]LogLoad: Took 1.281690 seconds to LoadMap(/Game/Blueprints_Core/Levels/MainLevel_Level)
[2022.08.30-14.40.39:040][477]LogOutputDevice: Warning:

Script Stack (0 frames):

[2022.08.30-14.40.39:402][477]LogStats: FPlatformStackWalk::StackWalkAndDump - 0.362 s
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: === Handled ensure: ===
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error:
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: Ensure condition failed: bFoundWidget [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateUser.cpp] [Line: 807]
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: Attempting to LockCursor() to widget but could not find widget SViewport [GameEngine.cpp(222)]
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: Stack:
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff729986dbb DronTesting.exe!DispatchCheckVerify<bool,<lambda_1665cc45d14385f0e4050600a40daa72> >() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff724b08a3d DronTesting.exe!FSlateApplication::ProcessReply() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff724ac133b DronTesting.exe!FLogTrace::OutputLogMessage<int,bool>() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff724b17aed DronTesting.exe!FSlateApplication::RoutePointerDownEvent() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff724b066ca DronTesting.exe!FSlateApplication::ProcessMouseButtonDownEvent() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff724afc508 DronTesting.exe!FSlateApplication::OnMouseDown() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff724955fef DronTesting.exe!FWindowsApplication::ProcessDeferredMessage() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff724943654 DronTesting.exe!FWindowsApplication::DeferMessage() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff724958537 DronTesting.exe!FWindowsApplication::ProcessMessage() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff72493e9b9 DronTesting.exe!FWindowsApplication::AppWndProc() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ffa1ab1e858 USER32.dll!UnknownFunction []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ffa1ab1e299 USER32.dll!UnknownFunction []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff7249599b4 DronTesting.exe!FWindowsPlatformApplicationMisc::PumpMessages() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff72761503c DronTesting.exe!FDefaultGameMoviePlayer::WaitForMovieToFinish() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff722dda0eb DronTesting.exe!FEngineLoop::Tick() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff722df064f DronTesting.exe!GuardedMain() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff722df071a DronTesting.exe!GuardedMainWrapper() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff722df2b1c DronTesting.exe!LaunchWindowsStartup() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff722e04364 DronTesting.exe!WinMain() []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ff7296ee9ce DronTesting.exe!__scrt_common_main_seh() [D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ffa1a347034 KERNEL32.DLL!UnknownFunction []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error: [Callstack] 0x00007ffa1bc62651 ntdll.dll!UnknownFunction []
[2022.08.30-14.40.39:402][477]LogOutputDevice: Error:
[2022.08.30-14.40.39:412][477]LogStats: SubmitErrorReport - 0.000 s

This line is the actual error. Since the crash occurred in a build the error is never usually as simple as a one off response since we don’t have enough information. Based on the crash it looks like you are removing a widget in runtime and the cursor can no longer lock to any widgets?

  1. Play the build yourself and try to figure out what action is actually causing the crash.
  2. Play the build in PIE and make sure there are no errors (including BP errors). Also check the PIE warnings for anything widget related.
  3. Put debug points where you remove or add widgets / lock the cursor.