-
-
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
Fix crash when saving resources with circular references #68281
Fix crash when saving resources with circular references #68281
Conversation
Any idea why the build tests are failing? |
80cc78d
to
4ec5bb4
Compare
I have pulled back support for saving circular references as it can cause memory leaks. Instead I narrowed this change down to fixing crash when saving resources with circular references. |
4ec5bb4
to
5c8fde4
Compare
Looks good to me overall, but needs a review from @reduz to make sure it's correct. |
381035d
to
f39b9cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, looks good to go and be tested in early 4.2 dev releasese.
When saving resources, marking of already seen resources was done too late, causing infinite loop traversing referenced resources and eventual stack overflow. The change marks traversed resource before descending to it's children, thus when this resource is encountered again, it is already marked as seen and traversal stops.
f39b9cd
to
058604f
Compare
I rebased and force-pushed it on your behalf because it's been many months since the last update. Just in case there may be problems or new checks on CI. |
Thanks! |
When saving resources, marking of already seen resources was done too late, causing infinite loop traversing referenced resources and eventual stack overflow. The change marks traversed resource before descending to it's children, thus when this resource is encountered again, it is already marked as seen and traversal stops.
Fixes #60590