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_concurrent_futures TSAN failures #130605

Closed
colesbury opened this issue Feb 26, 2025 · 1 comment
Closed

test_concurrent_futures TSAN failures #130605

colesbury opened this issue Feb 26, 2025 · 1 comment
Labels
build The build process and cross-build tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@colesbury
Copy link
Contributor

colesbury commented Feb 26, 2025

Bug report

I enabled test_concurrent_futures in the thread sanitizer job yesterday in:

Unfortunately, this is causing fairly frequent failures in the TSAN job, especially for the default (GIL-enabled) build, which I hadn't tested sufficiently with TSAN.

I'll temporarily remove test_concurrent_futures while I work on fixing the races.

Races

take_gil and _PyEval_SetSwitchInterval

WARNING: ThreadSanitizer: data race (pid=9777)
  Read of size 8 at 0x55e09fe6ae08 by thread T24 (mutexes: write M0):
    #0 take_gil /home/runner/work/cpython/cpython/Python/ceval_gil.c:328:40 (python+0x4fef47) (BuildId: bc0ef96fe091f729b109ca39e0975c49764059f7)
    #1 _PyEval_AcquireLock /home/runner/work/cpython/cpython/Python/ceval_gil.c:586:5 (python+0x4ff62e) (BuildId: bc0ef96fe091f729b109ca39e0975c49764059f7)
    #2 _PyThreadState_Attach /home/runner/work/cpython/cpython/Python/pystate.c:2092:9 (python+0x571225) (BuildId: bc0ef96fe091f729b109ca39e0975c49764059f7)
    #3 PyEval_AcquireThread /home/runner/work/cpython/cpython/Python/ceval_gil.c:603:5 (python+0x4ff6fe) (BuildId: bc0ef96fe091f729b109ca39e0975c49764059f7)
...

Previous write of size 8 at 0x55e09fe6ae08 by main thread:
    #0 _PyEval_SetSwitchInterval /home/runner/work/cpython/cpython/Python/ceval_gil.c:423:19 (python+0x4fe71a) (BuildId: bc0ef96fe091f729b109ca39e0975c49764059f7)
    #1 sys_setswitchinterval_impl /home/runner/work/cpython/cpython/./Python/sysmodule.c:1313:5 (python+0x598ae8) (BuildId: bc0ef96fe091f729b109ca[39](https://github.com/python/cpython/actions/runs/13552992546/job/37880869299?pr=130602#step:14:40)e0975c49764059f7)
    #2 sys_setswitchinterval /home/runner/work/cpython/cpython/./Python/clinic/sysmodule.c.h:529:20 (python+0x598ae8)
    #3 cfunction_vectorcall_O /home/runner/work/cpython/cpython/Objects/methodobject.c:523:24 (python+0x2eb8bd) (BuildId: bc0ef96fe091f729b109ca39e0975c4976[40](https://github.com/python/cpython/actions/runs/13552992546/job/37880869299?pr=130602#step:14:41)59f7)
...

SUMMARY: ThreadSanitizer: data race /home/runner/work/cpython/cpython/Python/ceval_gil.c:328:40 in take_gil

Linked PRs

@colesbury colesbury added build The build process and cross-build tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Feb 26, 2025
colesbury added a commit to colesbury/cpython that referenced this issue Feb 26, 2025
…CI job

There are a number of data races in the default build without
suppressions that are exposed by this test. Disable the test for now
under TSAN until we have suppressions or fix the data races.
colesbury added a commit to colesbury/cpython that referenced this issue Feb 26, 2025
The interval may be concurrently read by a thread attempting to acquire
the GIL.
colesbury added a commit that referenced this issue Feb 26, 2025
…gh-130606)

There are a number of data races in the default build without
suppressions that are exposed by this test. Disable the test for now
under TSAN until we have suppressions or fix the data races.
colesbury added a commit to colesbury/cpython that referenced this issue Feb 27, 2025
The interval may be concurrently read by a thread attempting to acquire
the GIL.
colesbury added a commit to colesbury/cpython that referenced this issue Feb 27, 2025
The interval may be concurrently read by a thread attempting to acquire
the GIL.
colesbury added a commit that referenced this issue Feb 28, 2025
)

The interval may be concurrently read by a thread attempting to acquire
the GIL.
@colesbury
Copy link
Contributor Author

I think these are fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant