GeezerVison is showing github.com — gh-151524: Avoid using instrumentation callback result after Py_DECREF by lpyu001 · Pull Request #151525 · python/cpython
Conversation
lpyu001
commented
Jun 16, 2026
•
edited by bedevere-app
Bot
Loading
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.
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.
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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 have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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
I’ve submitted the news entry.thanks
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Question: was it ever tested? Or was just the RC of res higher than 1, so no crash happened?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
@@ -0,0 +1,2 @@ |
|
|
Avoid comparing the result of a ``sys.monitoring`` callback after
|
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.
This would be a user-facing news entry. Users care about crashes (which could happen here), not about RC :)
Let's rephrase it.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chris-eibl reacted with thumbs up emoji
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.
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)
True
That 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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chris-eibl reacted with thumbs up emoji
Uh oh!
There was an error while loading. Please reload this page.
|
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 have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi @lpyu001 I see you made some update on this PR, and currently I think it look fine. Can you reply "I have made the requested changes; please review again" in the comments as the bot said, to require other reviewers continue the work?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I have made the requested changes; please review again
|
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.
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 and helps me who didn't realize _PyInstrumentation_DISABLE is immortal 👍
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.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @lpyu001 for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @lpyu001 for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @lpyu001 for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖
|
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.
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.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot AMD64 Arch Linux Asan Debug 3.13 (tierless) has failed when building commit 2e19855.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1439/builds/1152) and take a look at the build logs.
- Check if the failure is related to this commit (2e19855) or if it is a false positive.
- If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.
You can take a look at the buildbot page here:
https://buildbot.python.org/#/builders/1439/builds/1152
Failed tests:
Failed subtests:
- test_daemon_threads_shutdown_stdout_deadlock - test.test_io.CMiscIOTest.test_daemon_threads_shutdown_stdout_deadlock
- test_daemon_threads_shutdown_stderr_deadlock - test.test_io.CMiscIOTest.test_daemon_threads_shutdown_stderr_deadlock
Summary of the results of the build (if available):
==
Click to see traceback logs
Traceback (most recent call last):
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4755, in test_daemon_threads_shutdown_stderr_deadlock
self.check_daemon_threads_shutdown_deadlock('stderr')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4743, in check_daemon_threads_shutdown_deadlock
self.assertRegex(err, pattern)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
AssertionError: Regex didn't match: "Fatal Python error: _enter_buffered_busy: could not acquire lock for <(_io\\.)?BufferedWriter name='<stderr>'> at interpreter shutdown, possibly due to daemon threads" not found in '...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Traceback (most recent call last):
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4755, in test_daemon_threads_shutdown_stderr_deadlock
self.check_daemon_threads_shutdown_deadlock('stderr')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4743, in check_daemon_threads_shutdown_deadlock
self.assertRegex(err, pattern)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
AssertionError: Regex didn't match: "Fatal Python error: _enter_buffered_busy: could not acquire lock for <(_io\\.)?BufferedWriter name='<stderr>'> at interpreter shutdown, possibly due to daemon threads" not found in '....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Traceback (most recent call last):
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4750, in test_daemon_threads_shutdown_stdout_deadlock
self.check_daemon_threads_shutdown_deadlock('stdout')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_io.py", line 4743, in check_daemon_threads_shutdown_deadlock
self.assertRegex(err, pattern)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot AMD64 Arch Linux Usan Function 3.13 (tierless) has failed when building commit 2e19855.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1601/builds/821) and take a look at the build logs.
- Check if the failure is related to this commit (2e19855) or if it is a false positive.
- If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.
You can take a look at the buildbot page here:
https://buildbot.python.org/#/builders/1601/builds/821
Summary of the results of the build (if available):
Click to see traceback logs
Note: switching to '2e19855a1734a47780b42cfcdc9e3f31976c3e7c'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 2e19855a1734a [3.13] gh-151524: Make it clearer that `_PyInstrumentation_DISABLE` is immortal in the code (GH-151525) (GH-155351)
Switched to and reset branch '3.13'
rror: unable to open output file 'Python/pythonrun.o': 'No space left on device'
1 error generated.
make: *** [Makefile:3042: Python/pythonrun.o] Error 1
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make: [Makefile:3132: clean-retain-profile] Error 1 (ignored)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
aisk
aisk approved these changes
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.
|