-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
bpo-44553: Correct failure in tp_new for the union object #27008
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
Conversation
Before this PR:
after this PR:
|
I'm landing this as soon as the tests pass to unblock the buildbots |
if (result->args == NULL) { | ||
PyObject_GC_Del(result); |
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.
@Fidget-Spinner For next occasions, the problem with this is that PyObject_GC_Del
cannot be called like that because it overrides a bunch of cleanups like the call to _Py_ForgetReference
and other possible handling.
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.
Sorry bout that. I'll keep that in mind in the future.
BTW, does this mean this should be changed as well? https://github.com/python/cpython/blob/main/Objects/genericaliasobject.c#L654
I'm confused as to why it doesn't break the buildbots, or maybe because none of our tests make the object setup fail so PyObject_GC_Del
is never called?
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.
Yes, that has exactly the same problem. I assume is not being reaches by the tests and that's why we are not seeing corruption.
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
GH-27009 is a backport of this pull request to the 3.10 branch. |
…7008) (cherry picked from commit bc39614) Co-authored-by: Pablo Galindo <[email protected]>
…H-27009) (cherry picked from commit bc39614) Co-authored-by: Pablo Galindo <[email protected]> Co-authored-by: Pablo Galindo <[email protected]>
https://bugs.python.org/issue44553