Skip to content
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 crash on closing a scene #46533

Closed
Reapetitive opened this issue Feb 28, 2021 · 12 comments
Closed

Random crash on closing a scene #46533

Reapetitive opened this issue Feb 28, 2021 · 12 comments

Comments

@Reapetitive
Copy link

Reapetitive commented Feb 28, 2021

It started happening since 3.2.2 if im not mistaken and i honestly have no idea, why i didn't post it earlier.

Windows 10 64 bit, ryzen 7 1700x, rtx 3070, 16 gb ram, m2 ssd, godot 3.2.4 rc3 atm.

Closing a scene in editor or calling queue_free on it while running the project randomly crashes the game and/or editor without any possibility to see any error codes. It happens fairly often, while closing big scenes (almost every scene is big in my project). It is pretty gamebreaking and sometimes it costs me some unsaved effort, if i forget to save some scenes before closing another scene.

@kuruk-mm
Copy link
Contributor

kuruk-mm commented Mar 1, 2021

Can you give steps to reproduce the crash and a minimal reproduction project? You're using tool in some script? It crashes the game or the editor?

If you open Godot from a terminal you can see the logs from Godot even when it crashes.

@Reapetitive
Copy link
Author

@kuruk-mm no, i didn't even know about tool. :D Thanks!

If you open Godot from a terminal you can see the logs from Godot even when it crashes.

Oh, ok, i will give it a try!

@Reapetitive
Copy link
Author

Reapetitive commented Mar 1, 2021

So, i played around and just randomly jumped between levels, and closed scenes while running godot from terminal. Didn't get the editor to crash yet, but my game crashed, without any unusual or critical errors.

@Reapetitive
Copy link
Author

WARNING: cleanup: ObjectDB instances leaked at exit (run with --verbose for details).
At: core/object.cpp:2132
ERROR: clear: Resources still in use at exit (run with --verbose for details).
At: core/resource.cpp:450
ERROR: There are still MemoryPool allocs in use at exit!
At: core/pool_vector.cpp:66

This certainly does not look good though. :D This shows up in terminal on editor closure.

@lawnjelly
Copy link
Member

lawnjelly commented Mar 1, 2021

As it says run with --verbose for details maybe this will provide more information if you run with that on the command line. (I've seen this a few times but it's been because of my own errors in gdscript I think)

@kuruk-mm
Copy link
Contributor

kuruk-mm commented Mar 1, 2021

WARNING: cleanup: ObjectDB instances leaked at exit (run with --verbose for details).
At: core/object.cpp:2132
ERROR: clear: Resources still in use at exit (run with --verbose for details).
At: core/resource.cpp:450
ERROR: There are still MemoryPool allocs in use at exit!
At: core/pool_vector.cpp:66

This certainly does not look good though. :D This shows up in terminal on editor closure.

This happens when to program is closing (this is the reason that says at exit). Sometimes can appear but is not related from a crash while you're using Godot. So if you can give more information to help to found the problem.

@Reapetitive
Copy link
Author

Reapetitive commented Mar 2, 2021

Ok, i tested around, running from terminal, also with --verbose. Sadly, i didn't get any useful information from that.

I tried opening some of my biggest scenes (old, huuuuge levels i built, before i switched to chunk open world system) and i get Godot to crash every time i close one of those in editor, without any error message, even while running from terminal with --verbose. It just freezes for a breef moment and crashes.

@kuruk-mm
Copy link
Contributor

kuruk-mm commented Mar 2, 2021

Ok, i tested around, running from terminal, also with --verbose. Sadly, i didn't get any useful information from that.

I tried opening some of my biggest scenes (old, huuuuge levels i built, before i switched to chunk open world system) and i get Godot to crash every time i close one of those in editor, without any error message, even while running from terminal with --verbose. It just freezes for a breef moment and crashes.

Can you share that scene?

@Reapetitive
Copy link
Author

Reapetitive commented Mar 2, 2021

@kuruk-mm not really. I shared an older version of my project with @akien-mga privately, on confidential conditions. If you still own this copy, it should have a folder with backups of old levels (i might have removed them though, before sharing). You might be able to test this. If it helps resolving issues, i would share my project with someone from the core team, confidentially again.

@Reapetitive
Copy link
Author

Reapetitive commented Mar 5, 2021

Long story short:

crash on freeing/closing many nodes in a short period of time. (closing/freeing many/huge scenes at once)

Full blabla:

Well, ok. :D I implemented a world map system, which allows to view every place the player has visited, and to jump between covered checkpoints through a menu, while changing between chunk scenes and floors, and to be able to fast travel at some point in the game. Got it to constantly crash the game on switching between floors in the map view. (don't even know why it started crashing, it worked, i didn't do a thing, and it started crashing) In this view, many chunks are loaded and unloaded very quickly, so i set a bunch of debug points, just to get sure, where the game is crashing aaaand.... it didn't crash. So, i had to narrow down the exact spot, when the crash accures, by removing the debug points down up one by one and, well, i was right, it crashes if a huge amount of nodes, huge scenes, or many scenes are freed in a short period of time. So i set some delay, between unloading of chunks, and it seems to not crash anymore. Still the editor crashes on closing big scenes though, and if i decided to build a really big chunk (level) in one piece, freeing it would crash the game, which is not ok. :D

@Reapetitive
Copy link
Author

If the tree is set to paused, using queue_free or free on big scenes crashes the game.

@Reapetitive
Copy link
Author

I didn't encounter this problem anymore since 3.3, i guess! Thanks guys!

@akien-mga akien-mga added this to the 3.3 milestone Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants