-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Removing FileDialog in plugin causing a Segfault #84000
Comments
Oh, addons/death/debug_notes is where I pasted my gdb output and where I fingered the FileDialog as the culprit. |
Stacktrace:
I can reproduce the crash with the described steps. |
It seems to be a regression, introduced in 4.2-dev3 (4.1-stable, 4.1.2-stable, 4.2-dev1 and 4.2-dev2 don't reproduce it, any later dev or beta does). So it should be one of these PRs: https://godotengine.github.io/godot-interactive-changelog/#4.2-dev3 I suspect changes in notification order caused by #67791 maybe? Just a wild guess, would need bisecting. @Sauermann |
Possibly related to: Might be worth checking if that error has popped back up itself |
This is technically a regression from #80161, at least from the user perspective. From the code perspective this PR simply uncovered a fault in logic. What happens is that we register all file dialogs with the editor node. When those dialogs are destroyed, they are unregistered. The registration happens via callback methods on the editor node, triggered from the constructor and the destructor. The faulty thing that happens is that The linked PR coincidentally intervenes with this, because it nullptrs the singleton reference on destruction. So the unregistration method has a broken reference in it. The same happens in 4.1.2, but just because the reference is not nulled, it works. I have confirmed that commenting out I'm not entirely sure what this reference is after the destructor, but it somehow works... I think the proper way to address the crash would be to add some guards to the unregistration callback. Edit: Or rather we should just remove the method references, since this is all a part of |
Godot version
v4.2.beta.custom_build [46cb7f9]
System information
Godot v4.2.beta (46cb7f9) - Ubuntu 22.04.3 LTS 22.04 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (nvidia; 535.113.01) - Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz (6 Threads)
Issue description
Was getting segfaults on each exit whilst my plugin was enabled. Eventually compiled Godot and followed some guides to get gdb going and got enough info to hopefully help you boffins fix it.
Nutshell:
In the demo project, look at main.gd
Remark out the _exit_tree func and then enable the plugin. Open it (from the bottom container) and then Ctrl+Q quit Godot. It should segfault.
Replacing the _exit_tree stops the crash.
Steps to reproduce
As above.
Minimal reproduction project
Still can't drop a zip file in here. So, made a repo:
https://gitlab.com/dbat/godot-filedialog-segfault
The text was updated successfully, but these errors were encountered: