TSan: data race with PyTypeObject version tag · Issue #116909 · python/cpython · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

TSan: data race with PyTypeObject version tag  #116909

Closed
@pitrou

Description

@pitrou

Bug report

Bug description:

Running test_capi with TSan enabled and the GIL enabled yields the following race condition:

test_isolated_subinterpreter (test.test_capi.test_misc.TestPendingCalls.test_isolated_subinterpreter) ... 
==================
WARNING: ThreadSanitizer: data race (pid=84714)
  Read of size 4 at 0x55c8c4c10f90 by thread T1:
    #0 assign_version_tag /home/antoine/cpython/default/Objects/typeobject.c:1012:13 (python+0x327919) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #1 _PyType_Lookup /home/antoine/cpython/default/Objects/typeobject.c:5087:23 (python+0x3290ab) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #2 _PyObject_GetMethod /home/antoine/cpython/default/Objects/object.c:1462:23 (python+0x2d9f67) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #3 _PyEval_EvalFrameDefault /home/antoine/cpython/default/Python/generated_cases.c.h:3561:25 (python+0x443799) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #4 _PyEval_EvalFrame /home/antoine/cpython/default/./Include/internal/pycore_ceval.h:114:16 (python+0x26cd12) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #5 gen_send_ex2 /home/antoine/cpython/default/Objects/genobject.c:228:24 (python+0x26cd12)
    #6 gen_iternext /home/antoine/cpython/default/Objects/genobject.c:586:9 (python+0x26a0d2) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #7 builtin_next /home/antoine/cpython/default/Python/bltinmodule.c:1534:11 (python+0x4172a3) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
[...]

  Previous write of size 4 at 0x55c8c4c10f90 by main thread:
    #0 assign_version_tag /home/antoine/cpython/default/Objects/typeobject.c (python+0x32794d) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #1 _PyType_Lookup /home/antoine/cpython/default/Objects/typeobject.c:5087:23 (python+0x3290ab) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #2 _PyObject_GetMethod /home/antoine/cpython/default/Objects/object.c:1462:23 (python+0x2d9f67) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #3 _PyEval_EvalFrameDefault /home/antoine/cpython/default/Python/generated_cases.c.h:3561:25 (python+0x443799) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #4 _PyEval_EvalFrame /home/antoine/cpython/default/./Include/internal/pycore_ceval.h:114:16 (python+0x26cd12) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #5 gen_send_ex2 /home/antoine/cpython/default/Objects/genobject.c:228:24 (python+0x26cd12)
    #6 gen_iternext /home/antoine/cpython/default/Objects/genobject.c:586:9 (python+0x26a0d2) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)
    #7 builtin_next /home/antoine/cpython/default/Python/bltinmodule.c:1534:11 (python+0x4172a3) (BuildId: 80a378e5bf8e9a3b503d1ddb455283576a308db6)

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      TMZ Celebrity News – Breaking Stories, Videos & Gossip

      Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

      Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

      🎥 Watch TMZ Live

      TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.