Skip to content

Instantly share code, notes, and snippets.

@devdanzin
Last active July 17, 2026 17:04
Show Gist options
  • Select an option

  • Save devdanzin/e6e667ea59d98e8a3761e3915bc58ff9 to your computer and use it in GitHub Desktop.

Select an option

Save devdanzin/e6e667ea59d98e8a3761e3915bc58ff9 to your computer and use it in GitHub Desktop.
TSAN-0030: sys.monitoring: concurrent use_tool_id() races on the interpreter-global tool-name registry (monitoring_use_tool_id_impl)

Data race: sys.monitoring.use_tool_id() registers a tool with an unsynchronized check-then-act on the interpreter-global tool table (instrumentation.c:2190/:2194)

monitoring_use_tool_id_impl tests interp->monitoring_tool_names[tool_id] != NULL and then stores Py_NewRef(name) into that same slot with no lock, critical section, stop-the-world, or atomic. Two threads calling sys.monitoring.use_tool_id() concurrently race on the interpreter-global registry: a plain read of the slot vs a plain write. Beyond the TSan-reported race it is a genuine TOCTOU — both threads can pass the "already in use" guard, defeating the single-owner invariant and leaking a reference to the losing thread's name.

AI Disclaimer: this report was drafted by Claude Code, which also created and ran the reproducer; the maintainer reviewed and edited it.

Tracked in the umbrella issue python/cpython#153852 — one of a batch of free-threading data races found with fusil --tsan.

Summary

sys.monitoring keeps a per-interpreter table of registered tool names, interp->monitoring_tool_names[PY_MONITORING_TOOL_IDS] (Include/internal/pycore_interp_structs.h:1039). monitoring.use_tool_id(tool_id, name) claims a free slot with a check-then-act that has no synchronization:

static PyObject *
monitoring_use_tool_id_impl(PyObject *module, int tool_id, PyObject *name)
{
    ...
    PyInterpreterState *interp = _PyInterpreterState_GET();
    if (interp->monitoring_tool_names[tool_id] != NULL) {     /* :2190  read  */
        PyErr_Format(PyExc_ValueError, "tool %d is already in use", tool_id);
        return NULL;
    }
    interp->monitoring_tool_names[tool_id] = Py_NewRef(name);  /* :2194  write */
    Py_RETURN_NONE;
}

Two threads registering the same free tool_id concurrently produce a data race on interp->monitoring_tool_names[tool_id] (plain read at :2190 vs plain write at :2194). TSan places the racing address in the global _PyRuntime object (the interpreter state is embedded there). This is not the benign idempotent-cache pattern of TSAN-0005: the two operations disagree, so the race additionally corrupts the tool-registry invariant (see Impact).

Reproducer

import sys, threading
assert not sys._is_gil_enabled(), "run free-threaded: PYTHON_GIL=0"

# sys.monitoring.use_tool_id(tool_id, name) does an unsynchronized check-then-act on the
# interpreter-global registry interp->monitoring_tool_names[tool_id]:
#     if (interp->monitoring_tool_names[tool_id] != NULL) { raise; }   # :2190  read
#     interp->monitoring_tool_names[tool_id] = Py_NewRef(name);        # :2194  write
# Many threads racing to claim the SAME free tool id read the slot while one writes it.
mon = sys.monitoring
TOOL_ID = 3                 # any 0..5; not reserved
NT = 8
ROUNDS = 6000

enter = threading.Barrier(NT + 1)
leave = threading.Barrier(NT + 1)

def worker():
    for _ in range(ROUNDS):
        enter.wait()            # all workers released together onto a freshly-freed slot
        try:
            mon.use_tool_id(TOOL_ID, "t")   # read :2190 races the winner's write :2194
        except ValueError:
            pass                # "tool 3 is already in use" -> lost the race, expected
        leave.wait()

ts = [threading.Thread(target=worker, name=f"w{i}") for i in range(NT)]
for t in ts:
    t.start()
for r in range(ROUNDS):
    mon.free_tool_id(TOOL_ID)   # NULL the slot so the next round starts from a free id
    enter.wait()
    leave.wait()
for t in ts:
    t.join()
print("done, no crash")

Run (free-threaded + TSan build):

DEBUGINFOD_URLS= PYTHON_GIL=0 TSAN_OPTIONS="halt_on_error=1:symbolize=1:history_size=4" \
  setarch -R ./python repro.py

TSan report (confirmed, CPython 3.16.0a0 --disable-gil --with-thread-sanitizer, heads/main:bcf98ddbc40)

WARNING: ThreadSanitizer: data race (pid=2171512)
  Read of size 8 at 0x5555560b1018 by thread T1:
    #0 monitoring_use_tool_id_impl  Python/instrumentation.c:2190:9   (if (interp->monitoring_tool_names[tool_id] != NULL))
    #1 monitoring_use_tool_id       Python/clinic/instrumentation.c.h:33:20
    #2 _Py_BuiltinCallFast_StackRef Python/ceval.c:817:11
    ...
    #26 thread_run                  Modules/_threadmodule.c:388:21

  Previous write of size 8 at 0x5555560b1018 by thread T5:
    #0 monitoring_use_tool_id_impl  Python/instrumentation.c:2194:44  (interp->monitoring_tool_names[tool_id] = Py_NewRef(name))
    #1 monitoring_use_tool_id       Python/clinic/instrumentation.c.h:33:20
    #2 _Py_BuiltinCallFast_StackRef Python/ceval.c:817:11
    ...
    #26 thread_run                  Modules/_threadmodule.c:388:21

  Location is global '_PyRuntime' of size 424320 at 0x55555604df40 (python+0xb5d018)

SUMMARY: ThreadSanitizer: data race Python/instrumentation.c:2190:9 in monitoring_use_tool_id_impl

Reproduces deterministically (exit 66) in a few seconds; does not crash in the use-vs-use case. The confirmed signature matches the fuzzer-seeded one exactly (same two functions, read :2190 vs write :2194). The seed vehicle reached the same site indirectly through _lsprof.Profiler.enable() -> PyObject_CallMethod(... "use_tool_id" ...); the repro calls the API directly.

Root cause

interp->monitoring_tool_names[] is per-interpreter global state, but the four sys.monitoring tool-registry entry points mutate/inspect it with plain (non-atomic, unlocked) accesses:

  • monitoring_use_tool_id_impl — read :2190, write :2194
  • monitoring_clear_tool_id_impl — read :2216
  • monitoring_free_tool_id_impl — read :2242, Py_CLEAR (decref+NULL) :2248
  • monitoring_get_tool_impl — read :2270

None of them takes a lock, enters a critical section, or brackets the access with stop-the-world. This is striking because the same file already establishes the correct idiom for interpreter-global monitoring state: _PyMonitoring_ClearToolId / _PyMonitoring_SetEvents wrap their global mutations in _PyEval_StopTheWorld(interp) ... _PyEval_StartTheWorld(interp) (e.g. instrumentation.c:2122-2147), and per-code-object state is guarded by LOCK_CODE() (Py_BEGIN_CRITICAL_SECTION). The tool-name table was simply never brought under any of these.

Impact / severity

Severity: medium (a real free-threading correctness bug, not the value-benign class of TSAN-0005).

  1. Data race on monitoring_tool_names[tool_id] — plain read vs plain write (TSan-confirmed).
  2. Broken single-owner invariant / reference leak: when two threads both observe NULL at :2190, both execute Py_NewRef(name) and store at :2194. The second store overwrites the first pointer with no Py_DECREF, so the first name reference is leaked, and both callers return success believing they own the tool id — exactly the state the "tool %d is already in use" guard exists to prevent. A debugger and a coverage tool can each think they hold the same id.
  3. Use-after-free / double-free window across siblings: free_tool_id's Py_CLEAR(interp->monitoring_tool_names[tool_id]) at :2248 decrefs and NULLs the slot with no synchronization against a concurrent use_tool_id/get_tool/clear_tool_id reading the same slot — a classic drop-while-reading hazard on a PyObject*, which can drop the last reference under another thread's borrowed pointer.

No crash was observed in the captured use-vs-use scenario, but the invariant break and the free/get hazard make this more than cosmetic. It is in scope for the same reason as TSAN-0011 (audit hooks): interpreter-global instrumentation state that profilers/debuggers/coverage tools configure, plausibly from more than one thread during startup.

Suggested fix

Bring the tool-registry accessors under the synchronization already used elsewhere in the file. Two workable options:

  • Stop-the-world (matches the in-file precedent). Bracket the check-then-act in use_tool_id, clear_tool_id, free_tool_id, and get_tool with _PyEval_StopTheWorld(interp) / _PyEval_StartTheWorld(interp), the same pattern _PyMonitoring_ClearToolId uses at instrumentation.c:2122. Straightforward and consistent, at the cost of a brief pause on each (rare) registration call.

  • A dedicated interpreter mutex. Add a PyMutex to the interpreter's instrumentation state and hold it across every access to monitoring_tool_names[] (register/clear/free/get). Lighter weight and sufficient if the table is only ever touched via these entry points.

Either way the whole monitoring_tool_names[] array should be treated as shared mutable interpreter state and never read or written without holding the chosen synchronization, so the check and the act become atomic with respect to each other and to free_tool_id's Py_CLEAR.

Notes

Found by ThreadSanitizer fuzzing (fusil --tsan), seed vehicle fusil-tsan_fleet_02/inst-04 via _lsprof.Profiler.enable(). Confirmed unfixed on current main (bcf98ddbc40, Jul 2026): the four entry points are still plain accesses. Resembles the known "sys.monitoring is not free-threading-safe" class and mirrors TSAN-0011 (unsynchronized interpreter-global instrumentation registry); the registration path here is genuinely unsynchronized. When auditing, fix all four accessors together — fixing only use_tool_id would leave the free/get/clear hazards live.


Part of an upcoming umbrella issue tracking free-threading data races found by fusil --tsan. Not yet individually filed.

import sys, threading
assert not sys._is_gil_enabled(), "run free-threaded: PYTHON_GIL=0"
# sys.monitoring.use_tool_id(tool_id, name) does an unsynchronized check-then-act on the
# interpreter-global registry interp->monitoring_tool_names[tool_id]:
# if (interp->monitoring_tool_names[tool_id] != NULL) { raise; } # :2190 read
# interp->monitoring_tool_names[tool_id] = Py_NewRef(name); # :2194 write
# Many threads racing to claim the SAME free tool id read the slot while one writes it.
mon = sys.monitoring
TOOL_ID = 3 # any 0..5; not reserved
NT = 8
ROUNDS = 6000
enter = threading.Barrier(NT + 1)
leave = threading.Barrier(NT + 1)
def worker():
for _ in range(ROUNDS):
enter.wait() # all workers released together onto a freshly-freed slot
try:
mon.use_tool_id(TOOL_ID, "t") # read :2190 races the winner's write :2194
except ValueError:
pass # "tool 3 is already in use" -> lost the race, expected
leave.wait()
ts = [threading.Thread(target=worker, name=f"w{i}") for i in range(NT)]
for t in ts:
t.start()
for r in range(ROUNDS):
mon.free_tool_id(TOOL_ID) # NULL the slot so the next round starts from a free id
enter.wait()
leave.wait()
for t in ts:
t.join()
print("done, no crash")
WARNING: ThreadSanitizer: data race (pid=2030318)
Read of size 8 at 0x5555560b1010 by thread T2:
#0 monitoring_use_tool_id_impl /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/instrumentation.c:2190:9 (python+0x636d7b) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#1 monitoring_use_tool_id /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/clinic/instrumentation.c.h:33:20 (python+0x636d7b)
#2 cfunction_vectorcall_FASTCALL /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/methodobject.c:449:24 (python+0x36f762) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#3 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x294b28) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#4 _PyObject_CallFunctionVa /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:552:18 (python+0x29727c) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#5 callmethod /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:626:12 (python+0x297878) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#6 PyObject_CallMethod /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:645:24 (python+0x297878)
#7 _lsprof_Profiler_enable_impl /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/_lsprof.c:820:23 (_lsprof.cpython-316td-x86_64-linux-gnu.so+0x4e34) (BuildId: b1de4cfdaf4458510642f90e6e11544cfe373400)
#8 _lsprof_Profiler_enable /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/clinic/_lsprof.c.h:321:20 (_lsprof.cpython-316td-x86_64-linux-gnu.so+0x4e34)
#9 method_vectorcall_FASTCALL_KEYWORDS /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/descrobject.c:421:24 (python+0x2b4ff6) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#10 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x294b28) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#11 PyObject_Vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:327:12 (python+0x296660) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#12 _Py_VectorCallInstrumentation_StackRefSteal /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:768:11 (python+0x536b24) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#13 _PyEval_EvalFrameDefault /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/generated_cases.c.h:1906:35 (python+0x5662d0) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#14 _PyEval_EvalFrame /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_ceval.h:122:16 (python+0x53601c) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#15 _PyEval_Vector /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:2171:12 (python+0x53601c)
#16 _PyFunction_Vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c (python+0x296ba6) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#17 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x294b28) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#18 _PyObject_VectorcallPrepend /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:855:20 (python+0x298682) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#19 method_vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/classobject.c:55:12 (python+0x29b26a) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#20 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x5b472a) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#21 context_run /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/context.c:731:29 (python+0x5b472a)
#22 method_vectorcall_FASTCALL_KEYWORDS /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/descrobject.c:421:24 (python+0x2b4ff6) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#23 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x294b28) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#24 PyObject_Vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:327:12 (python+0x296660) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#25 _Py_VectorCallInstrumentation_StackRefSteal /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:768:11 (python+0x536b24) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#26 _PyEval_EvalFrameDefault /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/generated_cases.c.h:1906:35 (python+0x5662d0) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#27 _PyEval_EvalFrame /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_ceval.h:122:16 (python+0x53601c) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#28 _PyEval_Vector /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:2171:12 (python+0x53601c)
#29 _PyFunction_Vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c (python+0x296ba6) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#30 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x294b28) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#31 _PyObject_VectorcallPrepend /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:855:20 (python+0x298682) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#32 method_vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/classobject.c:55:12 (python+0x29b26a) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#33 _PyVectorcall_Call /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:273:16 (python+0x296512) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#34 _PyObject_Call /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:348:16 (python+0x296785) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#35 PyObject_Call /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:373:12 (python+0x2969a7) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#36 thread_run /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/_threadmodule.c:388:21 (python+0x7e0778) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#37 pythread_wrapper /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/thread_pthread.h:234:5 (python+0x6cd55b) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
Previous write of size 8 at 0x5555560b1010 by thread T4:
#0 monitoring_use_tool_id_impl /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/instrumentation.c:2194:44 (python+0x636e39) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#1 monitoring_use_tool_id /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/clinic/instrumentation.c.h:33:20 (python+0x636e39)
#2 cfunction_vectorcall_FASTCALL /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/methodobject.c:449:24 (python+0x36f762) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#3 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x294b28) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#4 _PyObject_CallFunctionVa /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:552:18 (python+0x29727c) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#5 callmethod /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:626:12 (python+0x297878) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#6 PyObject_CallMethod /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:645:24 (python+0x297878)
#7 _lsprof_Profiler_enable_impl /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/_lsprof.c:820:23 (_lsprof.cpython-316td-x86_64-linux-gnu.so+0x4e34) (BuildId: b1de4cfdaf4458510642f90e6e11544cfe373400)
#8 _lsprof_Profiler_enable /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/clinic/_lsprof.c.h:321:20 (_lsprof.cpython-316td-x86_64-linux-gnu.so+0x4e34)
#9 method_vectorcall_FASTCALL_KEYWORDS /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/descrobject.c:421:24 (python+0x2b4ff6) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#10 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x294b28) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#11 PyObject_Vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:327:12 (python+0x296660) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#12 _Py_VectorCallInstrumentation_StackRefSteal /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:768:11 (python+0x536b24) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#13 _PyEval_EvalFrameDefault /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/generated_cases.c.h:1906:35 (python+0x5662d0) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#14 _PyEval_EvalFrame /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_ceval.h:122:16 (python+0x53601c) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#15 _PyEval_Vector /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:2171:12 (python+0x53601c)
#16 _PyFunction_Vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c (python+0x296ba6) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#17 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x294b28) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#18 _PyObject_VectorcallPrepend /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:877:18 (python+0x2986ee) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#19 method_vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/classobject.c:55:12 (python+0x29b26a) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#20 _PyVectorcall_Call /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:273:16 (python+0x296512) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#21 _PyObject_Call /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:348:16 (python+0x296785) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#22 PyObject_Call /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:373:12 (python+0x2969a7) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#23 _PyEval_EvalFrameDefault /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/generated_cases.c.h:3161:32 (python+0x564344) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#24 _PyEval_EvalFrame /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_ceval.h:122:16 (python+0x53601c) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#25 _PyEval_Vector /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:2171:12 (python+0x53601c)
#26 _PyFunction_Vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c (python+0x296ba6) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#27 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x294b28) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#28 _PyObject_VectorcallPrepend /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:855:20 (python+0x298682) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#29 method_vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/classobject.c:55:12 (python+0x29b26a) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#30 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x5b472a) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#31 context_run /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/context.c:731:29 (python+0x5b472a)
#32 method_vectorcall_FASTCALL_KEYWORDS /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/descrobject.c:421:24 (python+0x2b4ff6) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#33 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x294b28) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#34 PyObject_Vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:327:12 (python+0x296660) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#35 _Py_VectorCallInstrumentation_StackRefSteal /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:768:11 (python+0x536b24) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#36 _PyEval_EvalFrameDefault /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/generated_cases.c.h:1906:35 (python+0x5662d0) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#37 _PyEval_EvalFrame /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_ceval.h:122:16 (python+0x53601c) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#38 _PyEval_Vector /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:2171:12 (python+0x53601c)
#39 _PyFunction_Vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c (python+0x296ba6) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#40 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:144:11 (python+0x294b28) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#41 _PyObject_VectorcallPrepend /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:855:20 (python+0x298682) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#42 method_vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/classobject.c:55:12 (python+0x29b26a) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#43 _PyVectorcall_Call /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:273:16 (python+0x296512) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#44 _PyObject_Call /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:348:16 (python+0x296785) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#45 PyObject_Call /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:373:12 (python+0x2969a7) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#46 thread_run /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/_threadmodule.c:388:21 (python+0x7e0778) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#47 pythread_wrapper /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/thread_pthread.h:234:5 (python+0x6cd55b) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
Location is global '_PyRuntime' of size 424320 at 0x55555604df40 (python+0xb5d010)
Thread T2 'tsan_0_1' (tid=2030372, running) created by main thread at:
#0 pthread_create <null> (python+0xfff0e) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#1 do_start_joinable_thread /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/thread_pthread.h:281:14 (python+0x6cc22b) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#2 PyThread_start_joinable_thread /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/thread_pthread.h:323:9 (python+0x6cc024) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#3 ThreadHandle_start /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/_threadmodule.c:475:9 (python+0x7e0237) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#4 do_start_new_thread /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/_threadmodule.c:1919:9 (python+0x7e0237)
#5 thread_PyThread_start_joinable_thread /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/_threadmodule.c:2042:14 (python+0x7de480) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#6 cfunction_call /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/methodobject.c:564:18 (python+0x370f23) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#7 _PyObject_MakeTpCall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:242:18 (python+0x29522c) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#8 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:142:16 (python+0x294b69) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#9 PyObject_Vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:327:12 (python+0x296660) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#10 _Py_VectorCall_StackRefSteal /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:726:11 (python+0x53636b) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#11 _PyEval_EvalFrameDefault /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/generated_cases.c.h:3686:35 (python+0x54f032) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#12 _PyEval_EvalFrame /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_ceval.h:122:16 (python+0x53601c) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#13 _PyEval_Vector /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:2171:12 (python+0x53601c)
#14 PyEval_EvalCode /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:679:21 (python+0x5358a1) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#15 run_eval_code_obj /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/pythonrun.c:1369:12 (python+0x69ef1f) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#16 run_mod /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/pythonrun.c:1472:19 (python+0x69eab2) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#17 pyrun_file /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/pythonrun.c:1296:15 (python+0x69a4e1) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#18 _PyRun_SimpleFileObject /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/pythonrun.c:518:13 (python+0x698aca) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#19 _PyRun_AnyFileObject /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/pythonrun.c:81:15 (python+0x6981a6) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#20 pymain_run_file_obj /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:411:15 (python+0x6ee3ad) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#21 pymain_run_file /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:430:15 (python+0x6ee3ad)
#22 pymain_run_python /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:715:21 (python+0x6ed206) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#23 Py_RunMain /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:796:5 (python+0x6ed206)
#24 pymain_main /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:826:12 (python+0x6ed977) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#25 Py_BytesMain /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:850:12 (python+0x6eda24) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#26 main /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Programs/python.c:15:12 (python+0x184cc0) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
Thread T4 'tsan_0_3' (tid=2030374, running) created by main thread at:
#0 pthread_create <null> (python+0xfff0e) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#1 do_start_joinable_thread /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/thread_pthread.h:281:14 (python+0x6cc22b) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#2 PyThread_start_joinable_thread /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/thread_pthread.h:323:9 (python+0x6cc024) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#3 ThreadHandle_start /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/_threadmodule.c:475:9 (python+0x7e0237) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#4 do_start_new_thread /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/_threadmodule.c:1919:9 (python+0x7e0237)
#5 thread_PyThread_start_joinable_thread /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Modules/_threadmodule.c:2042:14 (python+0x7de480) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#6 cfunction_call /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/methodobject.c:564:18 (python+0x370f23) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#7 _PyObject_MakeTpCall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:242:18 (python+0x29522c) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#8 _PyObject_VectorcallTstate /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_call.h:142:16 (python+0x294b69) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#9 PyObject_Vectorcall /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Objects/call.c:327:12 (python+0x296660) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#10 _Py_VectorCall_StackRefSteal /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:726:11 (python+0x53636b) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#11 _PyEval_EvalFrameDefault /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/generated_cases.c.h:3686:35 (python+0x54f032) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#12 _PyEval_EvalFrame /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Include/internal/pycore_ceval.h:122:16 (python+0x53601c) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#13 _PyEval_Vector /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:2171:12 (python+0x53601c)
#14 PyEval_EvalCode /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/ceval.c:679:21 (python+0x5358a1) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#15 run_eval_code_obj /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/pythonrun.c:1369:12 (python+0x69ef1f) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#16 run_mod /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/pythonrun.c:1472:19 (python+0x69eab2) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#17 pyrun_file /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/pythonrun.c:1296:15 (python+0x69a4e1) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#18 _PyRun_SimpleFileObject /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/pythonrun.c:518:13 (python+0x698aca) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#19 _PyRun_AnyFileObject /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/pythonrun.c:81:15 (python+0x6981a6) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#20 pymain_run_file_obj /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:411:15 (python+0x6ee3ad) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#21 pymain_run_file /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:430:15 (python+0x6ee3ad)
#22 pymain_run_python /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:715:21 (python+0x6ed206) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#23 Py_RunMain /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:796:5 (python+0x6ed206)
#24 pymain_main /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:826:12 (python+0x6ed977) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#25 Py_BytesMain /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Modules/main.c:850:12 (python+0x6eda24) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
#26 main /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/./Programs/python.c:15:12 (python+0x184cc0) (BuildId: 210f4dee1678f3b37d4df3e6b4d2f870b5f45e9c)
SUMMARY: ThreadSanitizer: data race /home/danzin/projects/python_build_matrix/builds/debug-ft-nojit-tsan/Python/instrumentation.c:2190:9 in monitoring_use_tool_id_impl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment