gh-151524: Avoid using instrumentation callback result after Py_DECREF#151525
gh-151524: Avoid using instrumentation callback result after Py_DECREF#151525lpyu001 wants to merge 3 commits into
Conversation
chris-eibl
left a comment
There was a problem hiding this comment.
The change lgtm, but I'd create a news entry, like almost all of the fixes for the umbrella issue #146102 did so far.
cc @pablogsal
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I’ve submitted the news entry.thanks |
sobolevn
left a comment
There was a problem hiding this comment.
Question: was it ever tested? Or was just the RC of res higher than 1, so no crash happened?
| @@ -0,0 +1,2 @@ | |||
| Avoid comparing the result of a ``sys.monitoring`` callback after | |||
There was a problem hiding this comment.
This would be a user-facing news entry. Users care about crashes (which could happen here), not about RC :)
Let's rephrase it.
ZeroIntensity
left a comment
There was a problem hiding this comment.
This isn't UB. _PyInstrumentation_DISABLE is an immortal object; Py_DECREF operations on it are a no-op.
>>> import sys
>>> sys._is_immortal(sys.monitoring.DISABLE)
TrueThat said, I do agree that it's misleading. Let's either remove the Py_DECREF call entirely and/or add an assertion that it's immortal.
There was a problem hiding this comment.
This is technically just a refactor, so it's not user-facing. Let's remove this.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Uh oh!
There was an error while loading. Please reload this page.