Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
bpo-38588: Fix possible crashes in dict and list when calling PyObject_RichCompareBool#17734
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
corona10 commented Dec 29, 2019 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading. Please reload this page.
pablogsal commented Dec 29, 2019
Could you include the rest of the cases that LCatro was mentioning? He mentioned another 2 for lists. |
corona10 commented Dec 30, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
poc3 is not reproducible on my local mac machine and Linux machine with the master branch. Line 452 in 3c87a66
However poc2 is reproducible, so I will add the patch on this PR. $ cat poc3.py class poc() : def __eq__(self,other) :list1.clear() return NotImplemented list1 = [ set() ] poc() in list1 print('end') $ ./python poc3.py end |
ZackerySpytz commented Dec 30, 2019
FWIW, LCatro had opened another issue (https://bugs.python.org/issue38610) for similar crashes in the |
corona10 commented Dec 30, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@pablogsal And for the And IMHO, we can close bpo-38588 with this patch |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
corona10 commented Dec 31, 2019
@pablogsal Updated! |
pablogsal left a comment
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.
LGTM
Thanks for the quick fix, @corona10!
miss-islington commented Dec 31, 2019
Thanks @corona10 for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
miss-islington commented Dec 31, 2019
I'm having trouble backporting to |
miss-islington commented Dec 31, 2019
Sorry, @corona10 and @pablogsal, I could not cleanly backport this to |
pablogsal commented Dec 31, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@corona10 Can you make the backport to 3.7 and 3.8 using |
miss-islington commented Dec 31, 2019
Thanks @corona10 for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
miss-islington commented Dec 31, 2019
Sorry @corona10 and @pablogsal, I had trouble checking out the |
bedevere-bot commented Dec 31, 2019
GH-17764 is a backport of this pull request to the 3.8 branch. |
…yObject_RichCompareBool (pythonGH-17734) Take strong references before calling PyObject_RichCompareBool to protect against the case where the object dies during the call. (cherry picked from commit 2d5bf56) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
methane commented Dec 31, 2019
Oh, please check the b.p.o before merge... |
pablogsal commented Dec 31, 2019
Apologies, I had totally missed the comment in bpo :( |
bedevere-bot commented Dec 31, 2019
GH-17765 is a backport of this pull request to the 3.7 branch. |
pablogsal commented Dec 31, 2019
Sorry @corona10, I will leave the backports open until we decide what to do finally in the bpo issue. |
corona10 commented Dec 31, 2019
@pablogsal cc @methane |
GH-17765) * [3.7] bpo-38588: Fix possible crashes in dict and list when calling PyObject_RichCompareBool (GH-17734) Take strong references before calling PyObject_RichCompareBool to protect against the case where the object dies during the call.. (cherry picked from commit 2d5bf56) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com> * methane's suggestion methane's suggestion Co-Authored-By: Inada Naoki <songofacandy@gmail.com> Co-authored-by: Inada Naoki <songofacandy@gmail.com>
GH-17764) * [3.8] bpo-38588: Fix possible crashes in dict and list when calling PyObject_RichCompareBool (GH-17734) Take strong references before calling PyObject_RichCompareBool to protect against the case where the object dies during the call. (cherry picked from commit 2d5bf56) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com> * Update Objects/listobject.c @methane's suggestion Co-Authored-By: Inada Naoki <songofacandy@gmail.com> Co-authored-by: Inada Naoki <songofacandy@gmail.com>
pythonGH-17765) * [3.7] bpo-38588: Fix possible crashes in dict and list when calling PyObject_RichCompareBool (pythonGH-17734) Take strong references before calling PyObject_RichCompareBool to protect against the case where the object dies during the call.. (cherry picked from commit 2d5bf56) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com> * methane's suggestion methane's suggestion Co-Authored-By: Inada Naoki <songofacandy@gmail.com> Co-authored-by: Inada Naoki <songofacandy@gmail.com>
…t_RichCompareBool (pythonGH-17734) Take strong references before calling PyObject_RichCompareBool to protect against the case where the object dies during the call.
Based on LCatro's report
https://bugs.python.org/issue38588