Skip to content
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

test_interpreters fails when running with -R 3:3 argument #116099

Closed
Eclips4 opened this issue Feb 29, 2024 · 4 comments · Fixed by #116164
Closed

test_interpreters fails when running with -R 3:3 argument #116099

Eclips4 opened this issue Feb 29, 2024 · 4 comments · Fixed by #116164
Assignees
Labels
3.13 bugs and security fixes tests Tests in the Lib/test dir topic-subinterpreters type-bug An unexpected behavior, bug, or error

Comments

@Eclips4
Copy link
Member

Eclips4 commented Feb 29, 2024

Bug report

Bug description:

./python.exe -m test -R 3:3 test_interpreters
Using random seed: 922541786
0:00:00 load avg: 2.79 Run 1 test sequentially
0:00:00 load avg: 2.79 [1/1] test_interpreters
beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)
123:456
XX. .../Include/object.h:1030: _Py_NegativeRefcount: Assertion failed: object has negative ref count
<object at 0x104847bc0 is freed>
Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: initialized

Current thread 0x00000001e11dd000 (most recent call first):
  <no Python frame>

Extension modules: _xxsubinterpreters, _xxinterpqueues (total: 2)
zsh: abort      ./python.exe -m test -R 3:3 test_interpreters

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

@Eclips4 Eclips4 added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir topic-subinterpreters labels Feb 29, 2024
@Eclips4 Eclips4 added the 3.13 bugs and security fixes label Feb 29, 2024
@Eclips4
Copy link
Member Author

Eclips4 commented Feb 29, 2024

Bisected to e80abd5
cc @ericsnowcurrently

@swtaarrs
Copy link
Member

@colesbury figured out that it's caused by this code decrefing qidobj too many times.

@ericsnowcurrently, I'm preparing a PR for this but let me know if you were already working on it.

@ericsnowcurrently
Copy link
Member

@swtaarrs I'll gladly review your PR. Thanks for taking care of it!

What's your ETA? Per #76785 (comment), @encukou may revert gh-115566 within the next few hours.

@swtaarrs
Copy link
Member

What's your ETA?

The PR should be posted within a few minutes.

@swtaarrs swtaarrs linked a pull request Feb 29, 2024 that will close this issue
ericsnowcurrently pushed a commit that referenced this issue Mar 1, 2024
This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after
the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with
`Py_CLEAR()` to make it clear that the variable is dead.

With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer
fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref
count`.
@github-project-automation github-project-automation bot moved this from Todo to Done in Subinterpreters Mar 1, 2024
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this issue Mar 4, 2024
…h-116164)

This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after
the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with
`Py_CLEAR()` to make it clear that the variable is dead.

With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer
fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref
count`.
adorilson pushed a commit to adorilson/cpython that referenced this issue Mar 25, 2024
…h-116164)

This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after
the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with
`Py_CLEAR()` to make it clear that the variable is dead.

With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer
fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref
count`.
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
…h-116164)

This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after
the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with
`Py_CLEAR()` to make it clear that the variable is dead.

With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer
fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref
count`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes tests Tests in the Lib/test dir topic-subinterpreters type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants