-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Python 3.15.0: test_sys.test_getallocatedblocks() fails if run after test_collections.test_odd_sizes() #134248
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
Comments
After investigating further, I have found that when running the tests with Basically, "test_sys.test_getallocatedblocks() " only fails when run sequentially, and as part of the full suite. |
I had experienced the same error with a slightly different configuration, and have been experimenting to reproduce and maybe isolate. I have now observed the bug with a configure using only the
and
This was on Ubuntu 24.04.2 LTS, Core™ i7-1195G7 × 8 processor, Python 3.15.0a0 (main), |
I can reproduce the issue with:
|
The test_sys.test_getallocatedblocks() failure is related to test_collections.test_odd_sizes():
|
According to git bisect, it started to fail at commit 2498c22.
|
The following change introduced the regression:
|
…zed strings When sanity checking against gettotalrefcount we exclude the blocks for immortalized strings since their references are not tracked/reported. This now matches refleak.py's book-keeping using the same functions.
Another bisect showed that it was 6f1d448 that first had the dependency of a large n in
cpython/Objects/unicodeobject.c Lines 14638 to 14644 in ea2c001
cpython/Objects/unicodeobject.c Lines 15272 to 15277 in 6f1d448
Therefore, the large n number of names input to the I'm arranging a PR which brings the check in test_getallocatedblocks more in line with its original intent by removing the size of the blocks used on immortalized strings. This same technique is already used by refleak.py (see #122420) so it seems appropriate here as well. There are other ways this could be separately or simultaneously be addressed. I want to specifically link the discussion in #130384 to adjust how I'd very much welcome insight from anyone who worked on these tests or immortalization previously! Edited to add a correction to (3), the linked code above is accounting for all of the references prior to interning, but in cpython/Objects/unicodeobject.c Lines 15518 to 15527 in 046670c
The call to |
Update command: |
…rings (#134871) When sanity checking against gettotalrefcount(), we exclude the blocks for immortalized strings since their references are not tracked/reported. This now matches refleak.py's book-keeping using the same functions.
…zed strings (pythonGH-134871) When sanity checking against gettotalrefcount(), we exclude the blocks for immortalized strings since their references are not tracked/reported. This now matches refleak.py's book-keeping using the same functions. (cherry picked from commit 54ca559) Co-authored-by: tpburns <[email protected]>
Fixed, thanks for the report @Fearless-Badger. |
…ized strings (GH-134871) (#135095) gh-134248 test_getallocatedblocks pre-check to ignore immortalized strings (GH-134871) When sanity checking against gettotalrefcount(), we exclude the blocks for immortalized strings since their references are not tracked/reported. This now matches refleak.py's book-keeping using the same functions. (cherry picked from commit 54ca559) Co-authored-by: tpburns <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
test_sys fails while running the test suite of python 3.15.0 when --with-pydebug and --enable-optimizations are both enabled.
I get consistent failure of the test suite, but when I run the test individually, it passes. I do not know if this is expected or not, as I understand that enabling the debugger and optimizations is kind of contradictory. I included the test header, as well as the tests summary for additional info.
I don't suspect my local environment to be the problem, since the test suite passes when I remove the "--enable-optimizations" flag, and just enable the debugger. The variable "a" seems to change each time I run the suite, so I included the random seed.
Build setup:
Tested on Python 3.15.0.
CPU: product: Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
Configuration I used
CPython versions tested on:
3.15, CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: