I’ve had a few rare cases where exiting my game causes my entire machine to lock up, requiring a hard reset to fix. This only happens when exiting the game, and it happens rarely at best (maybe 1/10 times).
It’s also worth noting that my machine has never hit this crash when I set the game to be embedded on play.
How would I go about debugging this?
I’m looking for a recommended place to start - or if anyone knows what might be causing this then that’d be great as well
I’ve monitored my memory usage and there doesn’t seem to be any leaks, especially as I’ve set my scene up to create all necessary objects at startup and never create any objects at runtime.
I noticed I have 9 orphan nodes - which I could see causing an issue if they aren’t deconstructed properly? I’ll check that out a bit more
I’m on Windows 11 - and yeah I haven’t updated any drivers in a while, I can check that out.
The app definitely doesn’t get anywhere close to 100% CPU usage, so it might just be the drivers then?
Looking into this more I did find that my game’s level editor was orphaning a few nodes on construction, which I’m thinking might be causing the game tree to deconstruct in a weird way - currently working to fix that
For Windows, check the Event log. It might have clues about what went wrong.
As for the CPU usage - don’t discount it so easily. It could spike right at the last moment and crash the system. Although, again, you’d need the app to have increased process priority for it to work.
I believe this was happening due to orphaned nodes being created by my level editor.
I’ve run the game 20 times after fixing the orphaned nodes and haven’t hit a crash yet (though I’ll also check my drivers as it sounds like that might have played a role as well)
One of my objects had an Array[Array], which didn’t properly get saved with ResourceSaver.save. I got around this by making a new node that contained an array of data, so I could replace Array[Array] with Array[CustomNode], where CustomNode contained an array of map components
Wait no it just happened again, I just got lucky to avoid the crash in these past few hours.
@Vilx the only error in my event log is The previous system shutdown at 7:40:52 PM on 10/7/2025 was unexpected. (which is somewhat odd as the shutdown & error happened at 10/7/2025 8:06:57 PM)
I updated my driver and yeah Ctrl+Alt+Del or Win+Tab didn’t work either.
I’m also positive it must be related to Godot as I’ve been having this issue for months, but it only happens when running my game and not when I run any other application on my computer.
You can try running Godot from the command line with the --verbose switch and see if it outputs anything.
Of course that is going to be a trick in itself since your system locks right up.
First thing that comes to mind are CPU/GPU temperatures. One thing that sometimes happens to my PC (and other PCs in my house) is that if you don’t clean it for long enough, dust accumulates on the heatsinks and the CPU/GPU starts to overheat. It happens kind of rarely and unpredictably, yet frequently enough that it gets annoying. And usually when doing something more intensive like playing a game…
The symptoms then are exactly this - freeze or bluescreen.
Also, bad PSUs tend to cause the most random crashes.
And RAM, while unlikely to be the culprit, can be easily tested with the Windows’ built-in memory diagnostic tool.
Hardware failures were my first guess - though cleaning my PC a few months ago didn’t stop the issue, and this bug specifically just happens with closing my Godot project - not any other games.
My project is also extremely light weight, so there’s no way its overheating.
I ran Windows’ memory diagnostics and no errors were found, so yeah I’ll just try running the game for a while using the command line to see if there’s any extra outputs I can see during a crash
@Frozen_Fried I’ve never hit the issue on any of my other Godot projects - and even for the same project, I haven’t seen it crash when I exit from the level editor or intermediate menus, only when I exit while in game.
Though actually now that I think about it- my player character tries pathfinding whenever I left click. The break only happens in gameplay, and only happens when I click -X- to close the window, so it could be that Godot is crashing from me trying to close the game while in the middle of a pathfinding equation? I can look more into that
EDIT: no, it can’t be the pathing equation- I’ve hit the crash even with it turned off
Well, the thing is - having your application crash because you’ve done something bad is completely normal. But the whole PC? Now THAT’S unusual.
Windows is pretty much rock solid when it comes to these things. Over the decades Microsoft developers have seen zillions of misbehaving apps and even drivers, and have done an amazing job hardening the OS against them.
So at this point my advice is to get all the updates you can, including but not limited to:
Windows and other Microsoft apps
Drivers (GPU, chipset)
BIOS firmware
Antivirus software
Etc.
Speaking of the latter… Do you have any 3rd party antiviruses running? Maybe see if you can add the game to its exceptions?
Also try to turn off all other apps as much as you can - browsers, instant messaging, steam, whatever.
Btw - when it crashes, is there any activity at all? Does the HDD led blink/shine? Does pressing NumLock or CapsLock toggle the lights on the keyboard?
If you are running a dedicated gpu and have an integrated gpu, try running on the integrated only. Disable the dedicated in the bios or eave it disconnected from the monitor or remove it from the system.
Memory could also be going bad, other then running diagnostics not sure how else you could diagnose.
A full restart is probably related to a hardware failure or kernel panic. You can try and see if there are any logs after it happens.
Or… on the other hand… but this is kind of getting into tinfoil hat territorry - There have been cases where a PC was infected with a particularly nasty rootkit, but that rootkit had a bug which caused the system to crash.
@Vilx I have no 3rd party antivirus and everything seems to be updated
@Frozen_Fried my game is a single-player turn based hex grid strategy game. The most expensive systems right now is the multimesh rendering all the hex cells, high fidelity baked lighting stored in vram, and a raymarched fractal skybox.
It could be the lighting? I don’t have baked lighting in the menus or level editor - so it’d be the one thing that’s loaded in gameplay and not anywhere else.
Notably, audio still plays and I can still move my mouse, but no other inputs are registered (as in I can’t even click with the mouse that’s moving around the screen).
I’ve tried unplugging & plugging back in input devices, but nothing came from it.
Maybe it could be that my project is still eating inputs instead of fully closing?
I’ve been closing the game by X-ing out instead of get_tree().quit()
Though it’s odd that it’d eat mouse clicks and block things like Ctrl-Alt-Del