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

Godot freezes when trying to close project after first open #91520

Closed
chrisl8 opened this issue May 3, 2024 · 17 comments · Fixed by #91725
Closed

Godot freezes when trying to close project after first open #91520

chrisl8 opened this issue May 3, 2024 · 17 comments · Fixed by #91725

Comments

@chrisl8
Copy link
Contributor

chrisl8 commented May 3, 2024

Tested versions

Reproducible In

  • v4.3.dev.custom_build [03e6fbb]
  • v4.3.dev.custom_build [55b8724] (Latest build from Master)

Not Reproducible In

System information

  • Godot v4.3.dev (55b8724) - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 Ti (NVIDIA; 31.0.15.5222) - AMD Ryzen 9 5900X 12-Core Processor (24 Threads)
  • Godot v4.3.dev (55b8724) - macOS 14.4.1 - Vulkan (Forward+) - integrated Apple M2 - Apple M2 (8 Threads)
  • Godot v4.3.dev (55b8724) - Manjaro Linux #1 SMP PREEMPT_DYNAMIC Wed Apr 10 20:11:08 UTC 2024 - X11 - Vulkan (Forward+) - integrated Intel(R) UHD Graphics 620 (KBL GT2) () - Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 Threads)

Issue description

After opening the project for the first time (no .godot folder exists and no imports done), attempting to close the editor fails with the Godot engine freezing.

Subsequent opening and closing of the project work.

Steps to reproduce

Clone the GDQuest Third-Person Shooter demo

Ensure there is no .godot folder.

Run the editor with the --import flag.
or
Open it in the editor
Wait for it to finish importing
Attempt to close the editor

The game is playable, but closing the editor just freezes.

The --import option is quicker to test.

The only way I can make this crash/freeze consistently is to delete the folder and clone the project again.
Just deleting the .godot folder isn't enough, it usually does not crash on subsequent runs even if I do.

Minimal reproduction project (MRP)

Use the GDQuest Third-Person Shooter demo

@akien-mga
Copy link
Member

akien-mga commented May 3, 2024

Thanks for the report.

Confirmed on Linux. Stacktrace:

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.dev.custom_build (03e6fbb010c3546593bd91a0dabc045a9882705a)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib64/libc.so.6(+0x40710) [0x7fb6ceee7710] (??:0)
[2] EditorInspector::edit(Object*) (/home/akien/Godot/godot/./editor/editor_inspector.cpp:3527)
[3] EditorInspector::_notification(int) (/home/akien/Godot/godot/./editor/editor_inspector.cpp:4055)
[4] EditorInspector::_notificationv(int, bool) (/home/akien/Godot/godot/./editor/editor_inspector.h:473 (discriminator 14))
[5] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[6] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[7] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[8] void memdelete<Node>(Node*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[9] Node::_notification(int) (/home/akien/Godot/godot/./scene/main/node.cpp:241)
[10] Node::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/node.h:49 (discriminator 14))
[11] CanvasItem::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/canvas_item.h:45)
[12] Control::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/control.h:48)
[13] Container::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/container.h:37)
[14] BoxContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/box_container.h:37)
[15] VBoxContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/box_container.h:90)
[16] InspectorDock::_notificationv(int, bool) (/home/akien/Godot/godot/./editor/inspector_dock.h:48)
[17] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[18] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[19] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[20] void memdelete<Node>(Node*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[21] Node::_notification(int) (/home/akien/Godot/godot/./scene/main/node.cpp:241)
[22] Node::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/node.h:49 (discriminator 14))
[23] CanvasItem::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/canvas_item.h:45)
[24] Control::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/control.h:48)
[25] Container::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/container.h:37)
[26] TabContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/tab_container.h:39)
[27] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[28] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[29] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[30] void memdelete<Node>(Node*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[31] Node::_notification(int) (/home/akien/Godot/godot/./scene/main/node.cpp:241)
[32] Node::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/node.h:49 (discriminator 14))
[33] CanvasItem::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/canvas_item.h:45)
[34] Control::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/control.h:48)
[35] Container::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/container.h:37)
[36] SplitContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/split_container.h:54)
[37] DockSplitContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./editor/editor_dock_manager.h:46)
[38] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[39] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[40] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[41] void memdelete<Node>(Node*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[42] Node::_notification(int) (/home/akien/Godot/godot/./scene/main/node.cpp:241)
[43] Node::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/node.h:49 (discriminator 14))
[44] CanvasItem::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/canvas_item.h:45)
[45] Control::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/control.h:48)
[46] Container::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/container.h:37)
[47] SplitContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/split_container.h:54)
[48] DockSplitContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./editor/editor_dock_manager.h:46)
[49] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[50] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[51] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[52] void memdelete<Node>(Node*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[53] Node::_notification(int) (/home/akien/Godot/godot/./scene/main/node.cpp:241)
[54] Node::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/node.h:49 (discriminator 14))
[55] CanvasItem::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/canvas_item.h:45)
[56] Control::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/control.h:48)
[57] Container::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/container.h:37)
[58] SplitContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/split_container.h:54)
[59] DockSplitContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./editor/editor_dock_manager.h:46)
[60] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[61] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[62] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[63] void memdelete<Node>(Node*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[64] Node::_notification(int) (/home/akien/Godot/godot/./scene/main/node.cpp:241)
[65] Node::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/node.h:49 (discriminator 14))
[66] CanvasItem::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/canvas_item.h:45)
[67] Control::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/control.h:48)
[68] Container::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/container.h:37)
[69] SplitContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/split_container.h:54)
[70] DockSplitContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./editor/editor_dock_manager.h:46)
[71] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[72] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[73] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[74] void memdelete<Node>(Node*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[75] Node::_notification(int) (/home/akien/Godot/godot/./scene/main/node.cpp:241)
[76] Node::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/node.h:49 (discriminator 14))
[77] CanvasItem::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/canvas_item.h:45)
[78] Control::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/control.h:48)
[79] Container::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/container.h:37)
[80] SplitContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/split_container.h:54)
[81] DockSplitContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./editor/editor_dock_manager.h:46)
[82] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[83] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[84] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[85] void memdelete<Node>(Node*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[86] Node::_notification(int) (/home/akien/Godot/godot/./scene/main/node.cpp:241)
[87] Node::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/node.h:49 (discriminator 14))
[88] CanvasItem::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/canvas_item.h:45)
[89] Control::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/control.h:48)
[90] Container::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/container.h:37)
[91] BoxContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/box_container.h:37)
[92] VBoxContainer::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/box_container.h:90)
[93] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[94] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[95] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[96] void memdelete<Node>(Node*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[97] Node::_notification(int) (/home/akien/Godot/godot/./scene/main/node.cpp:241)
[98] Node::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/node.h:49 (discriminator 14))
[99] CanvasItem::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/canvas_item.h:45)
[100] Control::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/control.h:48)
[101] Panel::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/gui/panel.h:37)
[102] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[103] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[104] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[105] void memdelete<Node>(Node*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[106] Node::_notification(int) (/home/akien/Godot/godot/./scene/main/node.cpp:241)
[107] Node::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/node.h:49 (discriminator 14))
[108] EditorNode::_notificationv(int, bool) (/home/akien/Godot/godot/./editor/editor_node.h:126)
[109] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[110] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[111] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[112] void memdelete<Node>(Node*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[113] Node::_notification(int) (/home/akien/Godot/godot/./scene/main/node.cpp:241)
[114] Node::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/node.h:49 (discriminator 14))
[115] Viewport::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/viewport.h:95)
[116] Window::_notificationv(int, bool) (/home/akien/Godot/godot/./scene/main/window.h:44)
[117] Object::notification(int, bool) (/home/akien/Godot/godot/./core/object/object.cpp:924)
[118] Object::_predelete() (/home/akien/Godot/godot/./core/object/object.cpp:200)
[119] predelete_handler(Object*) (/home/akien/Godot/godot/./core/object/object.cpp:2155)
[120] void memdelete<Window>(Window*) (/home/akien/Godot/godot/./core/os/memory.h:112 (discriminator 1))
[121] SceneTree::finalize() (/home/akien/Godot/godot/./scene/main/scene_tree.cpp:646)
[122] OS_LinuxBSD::run() (/home/akien/Godot/godot/platform/linuxbsd/os_linuxbsd.cpp:967)
[123] godot-git(main+0x14b) [0x5aa20b1] (/home/akien/Godot/godot/platform/linuxbsd/godot_linuxbsd.cpp:85)
[124] /lib64/libc.so.6(+0x2a088) [0x7fb6ceed1088] (??:0)
[125] /lib64/libc.so.6(__libc_start_main+0x8b) [0x7fb6ceed114b] (??:0)
[126] godot-git(_start+0x25) [0x5aa1ea5] (??:?)
-- END OF BACKTRACE --
================================================================
Aborted (core dumped)

It's a regression from #91168 @kitbdev @KoBeWi 🙃

@kitbdev
Copy link
Contributor

kitbdev commented May 3, 2024

On Windows, I see a warning that is related to the crash, but it isn't the same, so it needs testing.
However, I only see this when using the --import flag.
When not using the --import flag I don't see any issues and I'm not sure it is related to #91168.

Is it a crash or a freeze or both? If it crashes when using --import and freezes when not, then it sounds like two different bugs.

@chrisl8
Copy link
Contributor Author

chrisl8 commented May 3, 2024

Is it a crash or a freeze or both? If it crashes when using --import and freezes when not, then it sounds like two different bugs.

I've seen it both crash and freeze when using --import on Windows. I've only seen it freeze when using -e. So maybe it is two issues?

The issue I see most consistently is freezing.

@chrisl8
Copy link
Contributor Author

chrisl8 commented May 3, 2024

I built #91538 and tested it, but it does not fix the freezing issue with --import or -e.
So I think the freeze and the crash are different issues.

Perhaps I need to bisect this for you when I get time?

@chrisl8
Copy link
Contributor Author

chrisl8 commented May 3, 2024

v4.3.dev.custom_build [55afb5b]

image

@kitbdev
Copy link
Contributor

kitbdev commented May 3, 2024

After trying multiple times, I managed to get it to freeze on Windows.
It looks like it is freezing here:

while (!exited.is_set()) {
OS::get_singleton()->delay_usec(10000);
RenderingServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on rendering server
}

This is in EditorResourcePreview::stop() and called from EditorNode::_exit_editor(0).

It looks like it is two separate issues. When it freezes it does so before anything can even be deleted, and when it crashes is happens during finalize when everything is being deleted as seen in the stacktrace above.
Or maybe I'm just finding a different freeze, since it also happens when deleting the .godot folder but not clearing the generated .import files.
Edit: just confirmed that this freeze I get is not in 4.3dev6 or 4.2

I found these issues about the freeze that look similar:

@KoBeWi
Copy link
Member

KoBeWi commented May 5, 2024

I can confirm the freeze from above comment, #91168 is unrelated.
I can't reproduce the crash.

@chrisl8 chrisl8 changed the title Godot freezes or crashes when trying to close project after first open Godot freezes when trying to close project after first open on Windows May 7, 2024
@akien-mga

This comment was marked as off-topic.

@chrisl8
Copy link
Contributor Author

chrisl8 commented May 7, 2024

git bisect

645be5c is the first bad commit
commit 645be5c
Merge: 70247ad 15de869
Date: Wed May 1 09:54:54 2024 +0200

Merge pull request #90760 from RandomShaper/cmd_queue_good_sync

CommandQueueMT: Optimize & fix handling of sync/ret commands

core/templates/command_queue_mt.cpp | 29 ---------------
core/templates/command_queue_mt.h | 73 +++++++++++++++----------------------
2 files changed, 30 insertions(+), 72 deletions(-)

@akien-mga akien-mga changed the title Godot freezes when trying to close project after first open on Windows Godot freezes when trying to close project after first open May 7, 2024
@akien-mga akien-mga removed the crash label May 7, 2024
@chrisl8
Copy link
Contributor Author

chrisl8 commented May 7, 2024

Every so often, even on a "bad" build, it doesn't freeze. It seems more consistent on some systems than others. So it can be hard to nail down. I thought it wasn't happening on anything besides Windows, but that was just my "luck" I think. I'm mostly testing on Windows.

@akien-mga

This comment was marked as off-topic.

@akien-mga akien-mga changed the title Godot freezes when trying to close project after first open Godot freezes when trying to close project after first open on Windows May 7, 2024
@chrisl8
Copy link
Contributor Author

chrisl8 commented May 7, 2024

Freeze confirmed on MacOS

Godot v4.3.dev (645be5c) - macOS 14.4.1 - Vulkan (Forward+) - integrated Apple M2 - Apple M2 (8 Threads)
image
Using the --import option, so it should have exited on its own. In addition to not closing, the Godot editor is entirely unresponsive to all mouse and keyboard input.
image

Update: Also confirmed with:
Godot v4.3.dev (55b8724) - macOS 14.4.1 - Vulkan (Forward+) - integrated Apple M2 - Apple M2 (8 Threads)
(Latest build from master)

@chrisl8
Copy link
Contributor Author

chrisl8 commented May 7, 2024

My current theory is that the crash fixed by #91168 was hiding the freeze on MacOS and Linux, but now that it is fixed, this freeze should be easier to trigger.

@chrisl8
Copy link
Contributor Author

chrisl8 commented May 7, 2024

I have also confirmed the freeze on Linux:
Godot v4.3.dev (55b8724) - Manjaro Linux #1 SMP PREEMPT_DYNAMIC Wed Apr 10 20:11:08 UTC 2024 - X11 - Vulkan (Forward+) - integrated Intel(R) UHD Graphics 620 (KBL GT2) () - Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 Threads)

@chrisl8 chrisl8 changed the title Godot freezes when trying to close project after first open on Windows Godot freezes when trying to close project after first open May 7, 2024
@akien-mga
Copy link
Member

akien-mga commented May 8, 2024

@chrisl8 Could you give a refresh on the exact steps you use to reproduce the issue in latest master?

I tried a few times with the GDQuest TPS demo, using both --import and opening for the first time in the editor, and it's not freezing for me on Linux.

@chrisl8
Copy link
Contributor Author

chrisl8 commented May 8, 2024

The freeze is not consistent on Linux, but it happens. It is much more consistent for me on Windows, nearly 100%, and pretty close to that on MacOS.

I just tried this again just now on Linux and it worked fine 3 times in a row and froze on the fourth try.

First just to be clear on how I'm building, in case it matters:

gh repo clone godotengine/godot
cd godot
scons -Q platform=linuxbsd production=yes
cd ..

Then do this

gh repo clone gdquest-demos/godot-4-3d-third-person-controller
cd godot-4-3d-third-person-controller
../godot/bin/godot.linuxbsd.editor.x86_64 --import

To repeat the process quickly to try again to trigger the freeze:

cd ..;rm -rf godot-4-3d-third-person-controller;gh repo clone gdquest-demos/godot-4-3d-third-person-controller;cd godot-4-3d-third-person-controller;../godot/bin/godot.linuxbsd.editor.x86_64 --import

I'm not sure if it only freezes on a fresh clone, or if the freeze is just inconsistent enough that when I tried only wiping the .godot folder and resetting the repot I also got unlucky. That is why I just wipe the folder and clone it again for each test. It always freezes eventually.

The process on Windows is similar, in short:

rm -r -Force .\godot-4-3d-third-person-controller\
gh repo clone gdquest-demos/godot-4-3d-third-person-controller
cd godot-4-3d-third-person-controller
c:\Users\chris\CLionProjects\godot\bin\godot.windows.editor.x86_64.exe --import

@RandomShaper
Copy link
Member

I've been able to reproduce it and I'm working on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants