gh-111654: remove redundant decref on the eval stack value#111655
Conversation
…DEREF in error path
JelleZijlstra
left a comment
There was a problem hiding this comment.
Thanks!
Sorry, something went wrong.
|
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.
|
Sorry, @aisk and @JelleZijlstra, I could not cleanly backport this to |
Sorry, something went wrong.
…DEREF (pythonGH-111655) (cherry picked from commit 3a1b09e) Co-authored-by: AN Long <aisk@users.noreply.github.com>
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot s390x RHEL7 3.x has failed when building commit 3a1b09e. What do you need to do:
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 logsremote: 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.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 Windows11 Bigmem 3.x has failed when building commit 3a1b09e. What do you need to do:
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 logsremote: 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.
This is just like #109123, but for another OP code. In the error path, the
class_dictis 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.