-
-
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
Creating two mutually recursive dictionaries freezes Godot and spams console with endless errors. #80990
Comments
This is most likely recursive hash not achieving to get a proper hash since it is infinite.
will reproduce the same thing but the same with array will log a max recursion reached but will NOT freeze
I think the problem is that even if it reasches max recursion since it has two thing to check for each recursion it has to reach 2 power the max recursion limit times the max recursion which is why it freeze. However there is something fundamentally strange with how arrray/dict are handled as dictionnaries key. hash are calculated recursively but array/dict can be modified after having been set as keys which means the hash will have been changed and the value will not be able to be found anymore. hash should either be per instance like objects or array/dict should be constants. Either of thos solution will also fix the bug reported here.
Which will print
|
I'm not sure if this is a bug or a reasonable limitation of As for the "Max recursion reached" error, it's a guard condition. I recently made a PR #80888 that backports the recursive hash and the check to 3.x. |
Godot version
v4.2.dev3.official.013e8e3af
System information
Windows 10.0.19045 - GLES3 (Compatibility)
Issue description
Running the following code freezes a Godot project and causes the error:
To start printing infinitely many times into the console:
Steps to reproduce
Run the code:
Minimal reproduction project
The text was updated successfully, but these errors were encountered: