-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Exported Version of Game Crashes at Random When Switching Scenes/Levels (slot >= slotmax) #75802
Comments
I have what I suspect is the same crash, though I don't get the message about slots. The only relevant messages are the crash itself: (before that is only my print() statements)
It happens on the very first scene change, but not every time. I can keep launching the game and trying the scene change until it works. Once the scene has changed successfully, there are no further problems. |
Can you try using a debug build of the release export template from https://github.com/Calinou/godot-debug-builds/releases? You can do so by exporting your project as usual, moving the executable and the PDB file1 next to the PCK file, then runningthe project from a command prompt as follows:
Then run the game until it crashes: you should get a proper backtrace now. Debug builds haven't been updated for 4.0.1/4.0.2 yet, but this should still make it possible to reproduce the issue (most likely). Footnotes
|
Should it be the release version rather than debug? It doesn't produce any backtrace:
The only messages (other than the segmentation fault and the first two lines) are my own print statements. If I run |
You may have to run it with gdb in this case (then use |
OK, here's the gdb result:
|
Reopening, because #78987 is getting reverted. |
Duplicate of #70910. |
Godot version
v4.0.2.stable.official.7a0977ce2
System information
Windows 10
Issue description
I started a brand new project last week and I was testing an exported version of the game just to test my scene switcher and to make sure that everything was working as intended (in a previous Godot 4 project I made the exported game would also crash randomly when switching scenes). After exporting the game and running it, the scene switcher worked great for the first few attempts, and then crashed on about the 4th scene switch. I spent hours rewriting and reformatting my code and nothing seemed to work so I deleted the project and started from scratch, rebuilding everything I had made from the ground up. After running the new game in the editor, I then exported it and ran it just to be 100% sure that everything was working. I switched levels about 10 times and it worked flawlessly. I closed the .exe and re-ran it just to make sure that it wasn't a fluke and on the 3rd level change it crashed. I spent more time trying to fix it and nothing worked so I went onto the Godot discord for help and after a few hours of discussion, I finally found the culprit:
The game runs perfectly fine in a debug export version of the game and in Godot itself, it's just the normal .exe export that's causing issues, which isn't good since that's obviously the version used for distributing the game publicly.
When I looked up the error in the Godot GitHub it became apparent that one of my resource IDs was corrupted, which shouldn't be possible considering this project is obviously a completely different project file than the first one. This is super frustrating and is clearly beyond my ability to fix and I can't continue work on my game until the issue is resolved.
Steps to reproduce
1.) Export a normal version of the game (NOT a debug export) and run it.
2.) The game starts in a top-down hub world where you use the arrow keys to move. Move towards
the flag and when you get close to it a "play" button will appear in the top left. Press it to switch scenes from the hub world to level 1.
3.) Once you're in level 1, run towards the right until you see the flag at the end of the level. Run into it to change scenes back to the hub world. (use space to jump and left and right arrow keys to move)
4.) Repeat steps 2 and 3 until you crash. Switch between scenes/levels 10 times. The game should crash before you reach 10 the first time you launch it. If you switch levels/scenes 10 times and nothing happens, close the .exe and re-launch it and try again and it should crash on the 2nd-4th scene switch. On very rare occasions the game will crash when you press the play button in the hub world.
Minimal reproduction project
slotmaxerror.zip
The text was updated successfully, but these errors were encountered: