-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
Closing a scene tab causes a crash #86427
Comments
I managed to reproduce it only once 🤔 |
Can't reproduce it at all (on Windows, but this shouldn't matter). @novhack How reliably can you reproduce it? Are there any steps that you can think of which you didn't mention, like creating and attaching a script? How do you create a scene specifically? Do you have other scene tabs open? Are you able to compile the engine with debug symbols and try to catch the trace when the crash happens? |
I have the same crash. The message in console is :
My computer : Kubuntu 22.04 - NVIDIA RTX3050 |
Can you try this in a debug build of Godot? That way the stack trace indicates exactly where it crashed. You can follow this compilation guide. EDIT: Turns out CI editor build artifacts don't have debugging symbols. |
I've also been seeing this. I bisected it to #60965. Its crashing during a call_deferred call which is performing a dynamic_cast. Since it segfaults inside dynamic cast I suspect its got garbage or memory corruption. I've included bt full from gdb. |
Forgot to include I'm on linux, fedora 39. I've tried both llvm and gcc and they both behave the same for me. I can upload a project if needed but its been trivial to reproduce. I just create a new project, create and save a new scene with just a Node3d as root. Repeat for another scene. Then open both and try to close both. Occasionally it succeeds. Usually closing one causes it to crash. |
I think what is happening is when a node is removed, a deferred call is queued up which references the node. See: But, by the time the deferred call get run, the node has been deleted. This results in the attempts to check the type and cast to the appropriate object finds something incompatible so the dynamic cast just blows up. |
Managed to reproduce it as well. Full log for 3D:
Full log for 2D:
Also, I seem to have more luck closing tabs with Ctrl+Shift+W than I do with clicking on the X next to tab name. |
I can reproduce it in 4.3-dev1 on my Alpine Linux with Wayland, but is working well on master. |
I was curious that some people seem to be having a hard time reproducing this issue. For me, on Fedora 39 (on both Intel and AMD machines, GCC and LLVM), I see it crash reliably all the time. The only time it didn't was when I did a debug build with ASAN and UBSAN but I don't have a good explanation for that other then memory layout was different. I even confirmed by modifying memdelete to set a poison value when it deletes memory and can see the poison value in the debugger on two of my machines and on windows 11 (compiled with mingw). Windows 11 did not crash without the poison value which perhaps explains why some systems aren't reliably crashing. Perhaps the default compile flags are such that Fedora 39 doesn't allow the use after free so the segfault is encountered instead. With the poison value, all machines crash reliably. |
I can confirm the OP. Crashes no matter what tab you close. I did a compile etc. Text dump: v4.3.dev.custom_build [13a0d6e] Running from cli:'godc' is my symlink to compiled master
And in gdb:
|
This may be fixed by #84858 |
Tested versions
System information
Godot v4.3.dev1.mono - Arch Linux #1 SMP PREEMPT_DYNAMIC Thu, 14 Dec 2023 03:45:42 +0000 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 5700 XT (RADV NAVI10) () - AMD Ryzen 5 2600 Six-Core Processor (12 Threads)
Issue description
An attempt to close an opened scene via a scene tab close button causes the whole editor to momentarily freeze and crash.
I am using KDE Plasma 5 Wayland session on Arch Linux.
Steps to reproduce
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: