-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
GDScript engine destruction causes deadlock when destroying lambdas #85151
Comments
I managed to figure out how to stop it from happening. It is definitely one of the many lists (vector/dictionary) of Callables or classes that hold a Callable. I explicitly |
Judging by the stack trace, this may be fixed by #85170. Could you give it a test? |
I tested with v4.2.rc.custom_build.1ed691914 from that PR and got the same deadlock and a similar stack trace. I think it could be related to lambdas capturing state in closures causing a circular reference, but I still can't get a MRP that does the same. |
I can actually see a difference from that commit. I can reproduce the issue with a mutex lock before applying 1ed6919, and I get a distinct crash after applying it. Interesting enough, the lock issue doesn't seem to be consistent. But the new crash is consistent and happens on every exit. Which may indicate a new regression. |
I can reproduce the deadlock on Linux with GCC compiled binary from 1faf2f5, with the steps outlined in #85151 (comment). Almost the same stacktrace as in the OP. |
I'm trying to create a MRP for the issue, because while I could reproduce the issue cloning the |
I'm actively investigating this based on the Cursed Farm project. I already know what's going on, quite. I should be able to come up with a fix soon. |
Godot version
v4.2.rc.custom_build [dfd61cd]
System information
Debian, Vulkan (Forward+)
Issue description
Stack Trace
Not sure what causes this, but it seems having a vector/array of Callables/lambdas or of something that contains lambdas is causing a deadlock.
The deadlock only happens AFTER calling
get_tree().quit()
(or Alt+F4) and AFTER the tree has been removed. I am using static variables in classes to hold lists of callables, but even manually removing those references before quitting doesn't change the outcome.It is impossible to pin it from the godot debugger as it blocks the keyboard interrupt signal, thus, a GDB backtrace. This causes the project to hang on the last frame and become unresponsive to anything save a kill.
I don't know how to provide more information on this, sorry.
Steps to reproduce
No clue!
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: