-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random crashes with no errors logged, related to memory access violations #68602
Comments
Such problems often happens if Godot running on the dying HDD, systems with corrupted USB-ports, memory, drivers, installed malware programs (or even good one like MSI Afterburner). I suggest checking your system up. |
I'm reasonably confident this isn't a hardware problem, I upgraded by machine a few months ago and as part of that, put it through some stress tests to make sure it was all working. Additionally, this windows install is only 4 months old, in line with that hardware upgrade, so I don't have any conflicting or stale drivers. I've sent the files off to some other people as well to see if they find crashes. I've compiled godot with asan, and it looks like there's a few things happening.
I don't think this is what was causing the crash, but it is worth noting. Disabling the native icon lets me move on and get to the main menu screen, which (with asan) crashes every time after a few seconds.
or, heap use-after-frees:
Both of these types of errors mention group tasks, and occasionally I also get printed to the console the following error:
Not sure why this only prints on the ASAN build but I'm sure there's a compile flag somewhere responsible. I had enabled "Run on separate thread" for 3D physics, and disabling this stops ASAN from immediately killing the game on the main menu, but ASAN immediately kills the game as soon as it tries to compile fog material shaders:
Removing the fog volumes from my game lets me play through the whole thing without being killed by ASAN, so I'm reasonably confident the problem lies in that "Run on separate thread" option. I'll leave it disabled for a while, and see if I notice fewer crashes. |
I'll also open separate issues for the native icon and fog volumes, since those only crash the game when using ASAN and are unrelated. |
I've just heard back from a friend who had a crash on their machine as well, so even more sure it isn't a hardware issue. I've managed to reproduce (sorta) the physics thread asan crash in a minimal project with only a Camera3D and the "Run on separate thread" issue checked. It reliably crashes within ~10 seconds, except this time the heap use-after-free has alternated between GodotStep2D and GodotStep3D, which I find weird because it's a 3D scene, and 2D physics isn't set to run on a separate thread. Haven't seen a crash outside of asan in the minimal project either way, so I'm gonna start EDIT: Just as I posted this comment, the instance running from the editor (i.e. no asan) crashed as well. Same thing, no error message, just suddenly died, with an access violation logged in EventViewer If it's useful here's the minimal project: |
I have similar problems with a 2D game using beta 10. The crashes are seemingly random without any output anywhere (except in the Windows Event Viewer saying the app has crashed). I see the crashes on both my desktop PC with Win11, and on my Macbook Air M2. The game is build using the C# version of Godot 4, and the crashes occur both in the Godot editor and when in Jetbrains Rider. I'm gonna setup a different project to see if the crashes also occur there, but just as a heads up that it most likely isn't hardware related. |
Edit: |
Can you still reproduce this in 4.0.3 and 4.1-beta3 or later? |
I left both the MRP running on 4.0.3 (two instances, one ASAN one normal), and an instance of the project I was initially working on when I noticed this, with the 3d run in separate thread enabled, for an hour, and did not experience any crashes. |
Awesome, thanks! Closing as fixed. |
Godot version
4.0 beta 4 official
System information
Windows 10
Issue description
I've been experiencing a lot of random crashes today, more so than usual, and the behavior is completely unpredictable.
I've seen crashes from running my game from the editor, running with the official export templates, and running with my own compiled export templates. Sometimes it crashes after being on the main menu for half a second, sometimes it crashes a few minutes into the game. Sometimes it crashes immediately five or six times in a row, and other times I can play through the entire game five or six times in a row without crash. Annoyingly, since I've been poking around with this, I haven't been changing the actual project, so there isn't a node or a script that I'm adding/removing that's correlating to it crashing or not.
There's no logs output to the console or to file, even with the
--verbose
flag, the entire log is justAdditionally, I've built and ran in visual studio, trying to catch whatever might be causing it, but I haven't even been able to get breakpoints working so that hasn't been fruitful.
The windows Event Viewer logs show the following:
Unlike #68443, I'm not using C#, or mono builds of the engine, and I don't have a pop up dialog with an error code. The game freezes, the audio stutters, and then it quits to desktop.
Finally, loading up AppCrashView shows 21 crashes since I started working this afternoon, most of them with an access violation. Given that I've only had 7 other crashes since the 4th of november, I'm pretty sure it's something I added to my project today. Interestingly, the faulting module seems to alternate between the editor exe and "StackHash_{digits}", as seen below:
If there's anything I can collect or send to help track down where this is crashing and why, please let me know.
Steps to reproduce
I'm not sure I'm able to replicate this in a second minimal example project, I don't know what specifically is causing the issue. The huge uptick in crashes started around 3PM. I've looked at my git commit history around that time, and besides renaming a scene, and adding some AudioStreamPlayer3Ds, I haven't done anything I didn't do yesterday or the days or weeks before, yet the crashes really only started at 3 PM. Additionally, none of the work I did at that time affected the main menu scene, so I'm not sure how that would have caused the game to crash within seconds of launching. None of the changed files would even have been loaded yet.
This has been happening regardless of how I start my game. I've ran from the editor, from the project manager, from exports with the official templates, custom compiled exports. The only step is running my game, and then there's about a 50% chance that either it will crash immediately several times in a row, or it will be fine.
Given the lack of any logs, and visual studio not actually setting breakpoints, I'm at a loss as to where to continue trying to figure out where this is breaking.
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: