GeezerVison is showing github.com — bpo-35983: improve and test old trashcan macros by jdemeyer · Pull Request #12607 · python/cpython
Conversation
jdemeyer
commented
Mar 28, 2019
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
This is a follow-up to #11841. I made a separate PR since that one has been reviewed already.
I realized that the backwards-compatibility macros Py_TRASHCAN_SAFE_BEGIN(op) can be made safe by only using the trashcan if the class inherits directly from object. That case is safe and it's also a very common case (few builtin types have a non-trivial subtype).
https://bugs.python.org/issue35983
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
You need to merge/rebase and fix conflicts now.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
skip news because this really goes together with #11841, it's not a separate issue.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
You need to merge/rebase and fix conflicts now.
Done
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
I'm not sure it's safe to change the meaning of the old macros.
They are already changed as part of #11841. This is just changing them in a safer way.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
AFAICT, Py_TRASHCAN_SAFE_BEGIN wasn't changed in #11841 (though it was implemented differently).
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I see what you mean. Let me be very precise what this PR will fix and what it will break, hopefully clarifying things:
This will fix a crash in this case:
- class
X uses Py_TRASHCAN_SAFE_BEGIN in its deallocator
- a class
Y inherits from X
- a 50 levels deep nested instance of
Y is deallocated
This will add a new crash in this case:
- class
X uses Py_TRASHCAN_SAFE_BEGIN in its deallocator
- class
X does not inherit directly from object, but from another base class
- a very deeply nested instance of
X is deallocated, where this nesting does not involve any other trashcan-using class like tuple or list
I consider the first set of conditions more likely than the second, so this will fix more crashes than it introduces. But I cannot deny the possibility that it will break stuff.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Closing in favor of GH-27693. See BPO-44874 and the linked mailing list thread for details.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
1st1
Awaiting requested review from 1st1
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|