GeezerVison is showing github.com — gh-111654: remove redundant decref on the eval stack value by aisk · Pull Request #111655 · python/cpython
Conversation
aisk
commented
Nov 2, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
This is just like #109123, but for another OP code. In the error path, the class_dict is still on the value stack, and the error unwinding process will call decref on it. So we should remove the decref in error path, or there will be a double decref, and cause the ref count to negative in the GC process, and leads to the runtime crash.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
aisk
changed the title
gh-111654: remove redundant decref on the eval stack value in LOAD_FROM_DICT_OR_…
gh-111654: remove redundant decref on the eval stack value
Nov 2, 2023
|
|
}
|
|
|
Py_INCREF(value);
|
|
|
}
|
|
|
Py_DECREF(class_dict);
|
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 DECREF won't happen if we GOTO_ERROR on line 1547. Is that the idea?
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.
Yes, this is the expected behavior. I'll add some notes on the first comment.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @aisk for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Sorry, @aisk and @JelleZijlstra, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 3a1b09e6d070778d78d81084f88d37377d38ee9b 3.12
|
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 s390x RHEL7 3.x has failed when building commit 3a1b09e.
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/all/#builders/179/builds/5864) and take a look at the build logs.
- Check if the failure is related to this commit (3a1b09e) 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/all/#builders/179/builds/5864
Summary of the results of the build (if available):
==
Click to see traceback logs
remote: Enumerating objects: 14, done.�[K
remote: Counting objects: 7% (1/14)�[K
remote: Counting objects: 14% (2/14)�[K
remote: Counting objects: 21% (3/14)�[K
remote: Counting objects: 28% (4/14)�[K
remote: Counting objects: 35% (5/14)�[K
remote: Counting objects: 42% (6/14)�[K
remote: Counting objects: 50% (7/14)�[K
remote: Counting objects: 57% (8/14)�[K
remote: Counting objects: 64% (9/14)�[K
remote: Counting objects: 71% (10/14)�[K
remote: Counting objects: 78% (11/14)�[K
remote: Counting objects: 85% (12/14)�[K
remote: Counting objects: 92% (13/14)�[K
remote: Counting objects: 100% (14/14)�[K
remote: Counting objects: 100% (14/14), done.�[K
remote: Compressing objects: 8% (1/12)�[K
remote: Compressing objects: 16% (2/12)�[K
remote: Compressing objects: 25% (3/12)�[K
remote: Compressing objects: 33% (4/12)�[K
remote: Compressing objects: 41% (5/12)�[K
remote: Compressing objects: 50% (6/12)�[K
remote: Compressing objects: 58% (7/12)�[K
remote: Compressing objects: 66% (8/12)�[K
remote: Compressing objects: 75% (9/12)�[K
remote: Compressing objects: 83% (10/12)�[K
remote: Compressing objects: 91% (11/12)�[K
remote: Compressing objects: 100% (12/12)�[K
remote: Compressing objects: 100% (12/12), done.�[K
remote: Total 14 (delta 4), reused 5 (delta 2), pack-reused 0�[K
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: checking out '3a1b09e6d070778d78d81084f88d37377d38ee9b'.
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 performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at 3a1b09e... gh-111654: remove redundant decref in LOAD_FROM_DICT_OR_DEREF (#111655)
Switched to and reset branch 'main'
Objects/unicodeobject.c: In function ‘unicode_endswith’:
Objects/unicodeobject.c:13021:23: warning: ‘subobj’ may be used uninitialized in this function [-Wmaybe-uninitialized]
substring = PyTuple_GET_ITEM(subobj, i);
^
Objects/unicodeobject.c: In function ‘unicode_startswith’:
Objects/unicodeobject.c:12967:23: warning: ‘subobj’ may be used uninitialized in this function [-Wmaybe-uninitialized]
substring = PyTuple_GET_ITEM(subobj, i);
^
Python/instrumentation.c: In function ‘allocate_instrumentation_data’:
Python/instrumentation.c:1489:9: warning: missing braces around initializer [-Wmissing-braces]
code->_co_monitoring->local_monitors = (_Py_LocalMonitors){ 0 };
^
Python/instrumentation.c:1489:9: warning: (near initialization for ‘(anonymous).tools’) [-Wmissing-braces]
Python/instrumentation.c:1490:9: warning: missing braces around initializer [-Wmissing-braces]
code->_co_monitoring->active_monitors = (_Py_LocalMonitors){ 0 };
^
Python/instrumentation.c:1490:9: warning: (near initialization for ‘(anonymous).tools’) [-Wmissing-braces]
./Modules/_xxinterpchannelsmodule.c: In function ‘_channel_get_info’:
./Modules/_xxinterpchannelsmodule.c:2129:21: warning: missing braces around initializer [-Wmissing-braces]
*info = (struct channel_info){0};
^
./Modules/_xxinterpchannelsmodule.c:2129:21: warning: (near initialization for ‘(anonymous).status’) [-Wmissing-braces]
make: *** [buildbottest] Error 3
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot AMD64 Windows11 Bigmem 3.x has failed when building commit 3a1b09e.
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/all/#builders/1079/builds/2652) and take a look at the build logs.
- Check if the failure is related to this commit (3a1b09e) 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/all/#builders/1079/builds/2652
Summary of the results of the build (if available):
==
Click to see traceback logs
remote: Enumerating objects: 14, done.
remote: Counting objects: 7% (1/14)
remote: Counting objects: 14% (2/14)
remote: Counting objects: 21% (3/14)
remote: Counting objects: 28% (4/14)
remote: Counting objects: 35% (5/14)
remote: Counting objects: 42% (6/14)
remote: Counting objects: 50% (7/14)
remote: Counting objects: 57% (8/14)
remote: Counting objects: 64% (9/14)
remote: Counting objects: 71% (10/14)
remote: Counting objects: 78% (11/14)
remote: Counting objects: 85% (12/14)
remote: Counting objects: 92% (13/14)
remote: Counting objects: 100% (14/14)
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 8% (1/12)
remote: Compressing objects: 16% (2/12)
remote: Compressing objects: 25% (3/12)
remote: Compressing objects: 33% (4/12)
remote: Compressing objects: 41% (5/12)
remote: Compressing objects: 50% (6/12)
remote: Compressing objects: 58% (7/12)
remote: Compressing objects: 66% (8/12)
remote: Compressing objects: 75% (9/12)
remote: Compressing objects: 83% (10/12)
remote: Compressing objects: 91% (11/12)
remote: Compressing objects: 100% (12/12)
remote: Compressing objects: 100% (12/12), done.
remote: Total 14 (delta 4), reused 5 (delta 2), pack-reused 0
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: switching to '3a1b09e6d070778d78d81084f88d37377d38ee9b'.
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 3a1b09e6d0 gh-111654: remove redundant decref in LOAD_FROM_DICT_OR_DEREF (#111655)
Switched to and reset branch 'main'
Could Not Find R:\buildarea\3.x.ambv-bb-win11.bigmem\build\Lib\*.pyc
The system cannot find the file specified.
Could Not Find R:\buildarea\3.x.ambv-bb-win11.bigmem\build\PCbuild\python*.zip
Could Not Find R:\buildarea\3.x.ambv-bb-win11.bigmem\build\PCbuild\python*.zip
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
aisk
added a commit
to aisk/cpython
that referenced
this pull request
Feb 11, 2024
Uh oh!
There was an error while loading. Please reload this page.
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.
|