Repository navigation
TSAN race in _waiting_release #123828
Copy link
Copy link
Closed
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
A TSAN (gcc-12) build of the latest version of cpython reports a race in the test_send_recv_different_interpreters_and_threads test:
Read of size 4 at 0x7ffe8d0c9338 by main thread:
#0 _waiting_finish_releasing Modules/_interpchannelsmodule.c:504 (_interpchannels.cpython-314-x86_64-linux-gnu.so+0x88f4) (BuildId: 233ea3cec8e2d6b4a5322cdab2aa3fcc24ab85f8)
#1 channel_send_wait Modules/_interpchannelsmodule.c:1852 (_interpchannels.cpython-314-x86_64-linux-gnu.so+0x88f4)
#2 channelsmod_send Modules/_interpchannelsmodule.c:3096 (_interpchannels.cpython-314-x86_64-linux-gnu.so+0x8dd0) (BuildId: 233ea3cec8e2d6b4a5322cdab2aa3fcc24ab85f8)
#3 cfunction_call Objects/methodobject.c:540 (python+0x549e55) (BuildId: f667f6a4a823ca3db627f9e7bf3836f7af978c6d)
#0 _waiting_release Modules/_interpchannelsmodule.c:498 (_interpchannels.cpython-314-x86_64-linux-gnu.so+0x37c7) (BuildId: 233ea3cec8e2d6b4a5322cdab2aa3fcc24ab85f8)
#1 channel_recv Modules/_interpchannelsmodule.c:1937 (_interpchannels.cpython-314-x86_64-linux-gnu.so+0x863a) (BuildId: 233ea3cec8e2d6b4a5322cdab2aa3fcc24ab85f8)
#2 channelsmod_recv Modules/_interpchannelsmodule.c:3189 (_interpchannels.cpython-314-x86_64-linux-gnu.so+0x863a)
Indeed,
cpython/Modules/_interpchannelsmodule.c
Line 504 in 8b209fd
| while (waiting->status == WAITING_RELEASING) { |
waiting->status to change state, with cpython/Modules/_interpchannelsmodule.c
Line 498 in 8b209fd
| waiting->status = WAITING_RELEASED; |
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
Activity
ZeroIntensity commentedon Sep 8, 2024
cc @ericsnowcurrently
n-bes commentedon Sep 11, 2024
Can confirm, reproduced on Python-3.13.0b4
Build 182
Build 183
Build 186
p.s. summary table
If I remember correctly, this OOM related with this issue
pythongh-123828: fix data raceing for _waiting_release method in _int…
gh-123828: Fix data race in `_interpchannels._waiting_release` (GH-12…
pythongh-123828: Fix data race in `_interpchannels._waiting_release` (p…
[3.14] gh-123828: Fix data race in `_interpchannels._waiting_release` (…