-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Object: Let debug lock handle callee destruction within call chain gracefully #96856
Object: Let debug lock handle callee destruction within call chain gracefully #96856
Conversation
b0ec68a
to
05e3c71
Compare
How does this relate to: And this fix: |
Wow, I had totally forgotten I was involved there. Now I understand the issue better, I can say that GDScript already ensures the lifetime of a |
Of course, using |
05e3c71
to
b70bbba
Compare
This looks pretty good and identical to my approach in the issue (great minds think alike and all that 😁 ), so am almost there to approve. The only thing I wasn't sure about is how often this gets called in practice with every call to an object, and how expensive the ObjectDB lookup is (hashtable?) and whether we should be looking to avoid it, even in debug. i.e. does it appear on a profile. I suspect not, but would be nice to check. An alternative would be to optionally store e.g. a pointer to a bool on each If the UPDATE: |
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.
Makes sense and looks good to me
Would be good to add some tests if we can reliably reproduce these issues |
…acefully Co-authored-by: lawnjelly <[email protected]>
b70bbba
to
10e2318
Compare
Regarding performance, I wouldn't worry much since I've force-pushed with an added I'm adding some tests and will push again. |
Ah yes I'll do that on mine too. 👍 |
Pushed some tests, as "black-boxey" as possible. There are other cases of |
I don't know the first thing about tests, but given the MRP only crashes with asan and debug build, does the test fail with the old code (with the normal tests build)? |
It will only fail with asan enabled, but luckily CI runs jobs that compile with sanitizers and runs tests on such builds. |
2736124
to
a9ff30d
Compare
I've been able to come up with a way of letting a crash happen despite asan not enabled. Not as guaranteed, but makes the test crash with the prior implementation of |
a9ff30d
to
271729d
Compare
3218a35
to
e4e0087
Compare
Wow, getting the non-asan/tsan version of the crash induction to work on every platform has proven challenging. Also, I've added tests for GDScript as its script instance and VM implementation have to guarantee the behavior. Those will only fail with asan/tsan, though. I'm fairly happy with this now. |
e4e0087
to
bb77520
Compare
Thanks! |
Cherry-picked for 4.3.1. |
Fixes #75658.