GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — GH-97592: Fix crash in C remove_done_callback due to evil code by gvanrossum · Pull Request #97660 · python/cpython Conversation
|
|
@xiaxinmeng Feel free to add your review. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| class evil: | ||
| def __eq__(self, other): | ||
| fut.remove_done_callback(other) | ||
|
|
||
| fut.remove_done_callback(evil()) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Class names should normally use the CapWords convention.
| class evil: | |
| def __eq__(self, other): | |
| fut.remove_done_callback(other) | |
| fut.remove_done_callback(evil()) | |
| class Evil: | |
| def __eq__(self, other): | |
| fut.remove_done_callback(other) | |
| fut.remove_done_callback(Evil()) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| def __eq__(self, other): | ||
| fut.remove_done_callback(other) | ||
|
|
||
| fut.remove_done_callback(evil()) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
All callbacks added by fut.add_done_callback() will be cleared when calling fut.remove_done_callback(Evil()), but the return value will be the number of callbacks added last.
I'm not sure if we need to improve the return value of remove done callback further, the current changes are good enough to fix the crash. :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Kumar Aditya <[email protected]>
|
Thanks @gvanrossum for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-97692 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ythonGH-97660) Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called. (cherry picked from commit 63780f4) Co-authored-by: Guido van Rossum <[email protected]>
|
GH-97693 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ythonGH-97660) Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called. (cherry picked from commit 63780f4) Co-authored-by: Guido van Rossum <[email protected]>
) Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called. (cherry picked from commit 63780f4) Co-authored-by: Guido van Rossum <[email protected]>
) Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called. (cherry picked from commit 63780f4) Co-authored-by: Guido van Rossum <[email protected]>
…ython#97660) Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.