-
-
Notifications
You must be signed in to change notification settings - Fork 32k
_Py_RefcntAdd
doesn't increment ref count stats
#127599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
Comments
Looks like a bug. We're missing |
Thank you for such a quick reply! I'll try to clone CPython separately to create a PR to fix these over the next few days. |
Eclips4
pushed a commit
that referenced
this issue
Dec 15, 2024
…_INCREF_IMMORTAL_STAT_INC (#127717) Previously, `_Py_RefcntAdd` hasn't called `_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect. Now it has been fixed.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Dec 15, 2024
…NC/_Py_INCREF_IMMORTAL_STAT_INC (pythonGH-127717) Previously, `_Py_RefcntAdd` hasn't called `_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect. Now it has been fixed. (cherry picked from commit ab05beb) Co-authored-by: Ed Nutting <[email protected]>
srinivasreddy
pushed a commit
to srinivasreddy/cpython
that referenced
this issue
Jan 8, 2025
…NC/_Py_INCREF_IMMORTAL_STAT_INC (python#127717) Previously, `_Py_RefcntAdd` hasn't called `_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect. Now it has been fixed.
EdNutting
added a commit
to EdNutting/cpython
that referenced
this issue
Jan 10, 2025
…_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC (pythonGH-127717) Previously, `_Py_RefcntAdd` hasn't called `_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect. Now it has been fixed. (cherry picked from commit ab05beb) Co-authored-by: Ed Nutting <[email protected]>
EdNutting
added a commit
to EdNutting/cpython
that referenced
this issue
Jan 10, 2025
…_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC (pythonGH-127717) Previously, `_Py_RefcntAdd` hasn't called `_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect. Now it has been fixed. (cherry picked from commit ab05beb) Co-authored-by: Ed Nutting <[email protected]>
EdNutting
added a commit
to EdNutting/cpython
that referenced
this issue
Jan 10, 2025
…_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC (pythonGH-127717) Previously, `_Py_RefcntAdd` hasn't called `_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect. Now it has been fixed. (cherry picked from commit ab05beb) Co-authored-by: Ed Nutting <[email protected]>
Thank you @EdNutting! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
Hi,
I am unsure if this intentional or not so apologies if this turns out not to be a bug.
The code for
_Py_RefcntAdd
does not include_Py_INCREF_STAT_INC
. This appears to mean the statistics do not track these additions to the reference count, which are increments (although not increments by1
, they are increasing the ref count in a single operation).cpython/Include/internal/pycore_object.h
Line 121 in ad9d059
I believe this may be an oversight because this stat should be tracked, and also because the corresponding decrement ref count code does call
_Py_DECREF_STAT_INC
(e.g.cpython/Include/internal/pycore_object.h
Line 383 in ad9d059
I have checked the callers of
_Py_RefcntAdd
(inlistobject.c
andtupleobject.c
) and they do not separately perform the stats tracking.Is this an issue or is there a reason this ref count increment is excluded?
Thanks,
Ed
CPython versions tested on:
3.12, 3.13
Operating systems tested on:
Linux, macOS
Linked PRs
The text was updated successfully, but these errors were encountered: