Skip to content

Instantly share code, notes, and snippets.

@mpage
Created April 22, 2024 22:58
Show Gist options
  • Save mpage/eac4a27020f988aeede0bebfd786eecd to your computer and use it in GitHub Desktop.
Save mpage/eac4a27020f988aeede0bebfd786eecd to your computer and use it in GitHub Desktop.
WARNING: ThreadSanitizer: data race (pid=12171)
Atomic write of size 4 at 0x7ba40004b038 by main thread:
#0 _Py_atomic_compare_exchange_int /home/runner/work/cpython/cpython/./Include/cpython/pyatomic_gcc.h:70:10 (python+0x58b12c) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#1 park_detached_threads /home/runner/work/cpython/cpython/Python/pystate.c:2170:17 (python+0x58b12c)
#2 stop_the_world /home/runner/work/cpython/cpython/Python/pystate.c:2220:36 (python+0x58b12c)
#3 _PyEval_StopTheWorld /home/runner/work/cpython/cpython/Python/pystate.c:2290:5 (python+0x58b500) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#4 _Py_qsbr_reserve /home/runner/work/cpython/cpython/Python/qsbr.c:201:9 (python+0x5960ce) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#5 new_threadstate /home/runner/work/cpython/cpython/Python/pystate.c:1528:27 (python+0x588285) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#6 _PyThreadState_New /home/runner/work/cpython/cpython/Python/pystate.c:1598:12 (python+0x587c80) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#7 ThreadHandle_start /home/runner/work/cpython/cpython/./Modules/_threadmodule.c:405:20 (python+0x672658) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#8 do_start_new_thread /home/runner/work/cpython/cpython/./Modules/_threadmodule.c:1797:9 (python+0x672658)
#9 thread_PyThread_start_joinable_thread /home/runner/work/cpython/cpython/./Modules/_threadmodule.c:1920:14 (python+0x671337) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#10 cfunction_call /home/runner/work/cpython/cpython/Objects/methodobject.c:540:18 (python+0x2f1d51) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#11 _PyObject_MakeTpCall /home/runner/work/cpython/cpython/Objects/call.c:242:18 (python+0x242c42) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#12 _PyObject_VectorcallTstate /home/runner/work/cpython/cpython/./Include/internal/pycore_call.h:166:16 (python+0x242546) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#13 PyObject_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c:327:12 (python+0x243ea0) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#14 _PyEval_EvalFrameDefault /home/runner/work/cpython/cpython/Python/generated_cases.c.h:1414:19 (python+0x469de8) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#15 _PyEval_EvalFrame /home/runner/work/cpython/cpython/./Include/internal/pycore_ceval.h:114:16 (python+0x46032f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#16 _PyEval_Vector /home/runner/work/cpython/cpython/Python/ceval.c:1807:12 (python+0x46032f)
#17 _PyFunction_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c (python+0x2443a7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#18 _PyObject_VectorcallTstate /home/runner/work/cpython/cpython/./Include/internal/pycore_call.h:168:11 (python+0x249ca5) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#19 method_vectorcall /home/runner/work/cpython/cpython/Objects/classobject.c:92:18 (python+0x248449) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#20 _PyVectorcall_Call /home/runner/work/cpython/cpython/Objects/call.c:273:16 (python+0x243d8f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#21 _PyObject_Call /home/runner/work/cpython/cpython/Objects/call.c:348:16 (python+0x243ff2) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#22 PyObject_Call /home/runner/work/cpython/cpython/Objects/call.c:373:12 (python+0x2441d7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#23 _PyEval_EvalFrameDefault /home/runner/work/cpython/cpython/Python/generated_cases.c.h:1267:26 (python+0x468db1) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#24 _PyEval_EvalFrame /home/runner/work/cpython/cpython/./Include/internal/pycore_ceval.h:114:16 (python+0x46032f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#25 _PyEval_Vector /home/runner/work/cpython/cpython/Python/ceval.c:1807:12 (python+0x46032f)
#26 _PyFunction_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c (python+0x2443a7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#27 _PyObject_VectorcallDictTstate /home/runner/work/cpython/cpython/Objects/call.c:135:15 (python+0x2427ec) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#28 _PyObject_Call_Prepend /home/runner/work/cpython/cpython/Objects/call.c:504:24 (python+0x2447bf) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#29 slot_tp_call /home/runner/work/cpython/cpython/Objects/typeobject.c:9229:15 (python+0x369771) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#30 _PyObject_MakeTpCall /home/runner/work/cpython/cpython/Objects/call.c:242:18 (python+0x242c42) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#31 _PyObject_VectorcallTstate /home/runner/work/cpython/cpython/./Include/internal/pycore_call.h:166:16 (python+0x242546) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#32 PyObject_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c:327:12 (python+0x243ea0) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#33 _PyEval_EvalFrameDefault /home/runner/work/cpython/cpython/Python/generated_cases.c.h:813:23 (python+0x466223) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#34 _PyEval_EvalFrame /home/runner/work/cpython/cpython/./Include/internal/pycore_ceval.h:114:16 (python+0x46032f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#35 _PyEval_Vector /home/runner/work/cpython/cpython/Python/ceval.c:1807:12 (python+0x46032f)
#36 _PyFunction_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c (python+0x2443a7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#37 _PyObject_VectorcallTstate /home/runner/work/cpython/cpython/./Include/internal/pycore_call.h:168:11 (python+0x249ca5) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#38 method_vectorcall /home/runner/work/cpython/cpython/Objects/classobject.c:92:18 (python+0x248449) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#39 _PyVectorcall_Call /home/runner/work/cpython/cpython/Objects/call.c:273:16 (python+0x243d8f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#40 _PyObject_Call /home/runner/work/cpython/cpython/Objects/call.c:348:16 (python+0x243ff2) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#41 PyObject_Call /home/runner/work/cpython/cpython/Objects/call.c:373:12 (python+0x2441d7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#42 _PyEval_EvalFrameDefault /home/runner/work/cpython/cpython/Python/generated_cases.c.h:1267:26 (python+0x468db1) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#43 _PyEval_EvalFrame /home/runner/work/cpython/cpython/./Include/internal/pycore_ceval.h:114:16 (python+0x46032f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#44 _PyEval_Vector /home/runner/work/cpython/cpython/Python/ceval.c:1807:12 (python+0x46032f)
#45 _PyFunction_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c (python+0x2443a7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#46 _PyObject_VectorcallDictTstate /home/runner/work/cpython/cpython/Objects/call.c:135:15 (python+0x2427ec) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#47 _PyObject_Call_Prepend /home/runner/work/cpython/cpython/Objects/call.c:504:24 (python+0x2447bf) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#48 slot_tp_call /home/runner/work/cpython/cpython/Objects/typeobject.c:9229:15 (python+0x369771) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#49 _PyObject_MakeTpCall /home/runner/work/cpython/cpython/Objects/call.c:242:18 (python+0x242c42) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#50 _PyObject_VectorcallTstate /home/runner/work/cpython/cpython/./Include/internal/pycore_call.h:166:16 (python+0x242546) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#51 PyObject_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c:327:12 (python+0x243ea0) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#52 _PyEval_EvalFrameDefault /home/runner/work/cpython/cpython/Python/generated_cases.c.h:813:23 (python+0x466223) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#53 _PyEval_EvalFrame /home/runner/work/cpython/cpython/./Include/internal/pycore_ceval.h:114:16 (python+0x46032f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#54 _PyEval_Vector /home/runner/work/cpython/cpython/Python/ceval.c:1807:12 (python+0x46032f)
#55 _PyFunction_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c (python+0x2443a7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#56 _PyObject_VectorcallTstate /home/runner/work/cpython/cpython/./Include/internal/pycore_call.h:168:11 (python+0x249ca5) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#57 method_vectorcall /home/runner/work/cpython/cpython/Objects/classobject.c:92:18 (python+0x248449) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#58 _PyVectorcall_Call /home/runner/work/cpython/cpython/Objects/call.c:273:16 (python+0x243d8f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#59 _PyObject_Call /home/runner/work/cpython/cpython/Objects/call.c:348:16 (python+0x243ff2) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#60 PyObject_Call /home/runner/work/cpython/cpython/Objects/call.c:373:12 (python+0x2441d7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#61 _PyEval_EvalFrameDefault /home/runner/work/cpython/cpython/Python/generated_cases.c.h:1267:26 (python+0x468db1) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#62 _PyEval_EvalFrame /home/runner/work/cpython/cpython/./Include/internal/pycore_ceval.h:114:16 (python+0x46032f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#63 _PyEval_Vector /home/runner/work/cpython/cpython/Python/ceval.c:1807:12 (python+0x46032f)
#64 _PyFunction_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c (python+0x2443a7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#65 _PyObject_VectorcallDictTstate /home/runner/work/cpython/cpython/Objects/call.c:135:15 (python+0x2427ec) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#66 _PyObject_Call_Prepend /home/runner/work/cpython/cpython/Objects/call.c:504:24 (python+0x2447bf) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#67 slot_tp_call /home/runner/work/cpython/cpython/Objects/typeobject.c:9229:15 (python+0x369771) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#68 _PyObject_MakeTpCall /home/runner/work/cpython/cpython/Objects/call.c:242:18 (python+0x242c42) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#69 _PyObject_VectorcallTstate /home/runner/work/cpython/cpython/./Include/internal/pycore_call.h:166:16 (python+0x242546) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#70 PyObject_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c:327:12 (python+0x243ea0) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#71 _PyEval_EvalFrameDefault /home/runner/work/cpython/cpython/Python/generated_cases.c.h:813:23 (python+0x466223) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#72 _PyEval_EvalFrame /home/runner/work/cpython/cpython/./Include/internal/pycore_ceval.h:114:16 (python+0x46032f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#73 _PyEval_Vector /home/runner/work/cpython/cpython/Python/ceval.c:1807:12 (python+0x46032f)
#74 PyEval_EvalCode /home/runner/work/cpython/cpython/Python/ceval.c:602:21 (python+0x45ffbe) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#75 builtin_exec_impl /home/runner/work/cpython/cpython/Python/bltinmodule.c:1132:17 (python+0x4588a6) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#76 builtin_exec /home/runner/work/cpython/cpython/Python/clinic/bltinmodule.c.h:521:20 (python+0x4588a6)
#77 cfunction_vectorcall_FASTCALL_KEYWORDS /home/runner/work/cpython/cpython/Objects/methodobject.c:441:24 (python+0x2f0ad4) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#78 _PyObject_VectorcallTstate /home/runner/work/cpython/cpython/./Include/internal/pycore_call.h:168:11 (python+0x2424e2) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#79 PyObject_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c:327:12 (python+0x243ea0) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#80 _PyEval_EvalFrameDefault /home/runner/work/cpython/cpython/Python/generated_cases.c.h:813:23 (python+0x466223) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#81 _PyEval_EvalFrame /home/runner/work/cpython/cpython/./Include/internal/pycore_ceval.h:114:16 (python+0x46032f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#82 _PyEval_Vector /home/runner/work/cpython/cpython/Python/ceval.c:1807:12 (python+0x46032f)
#83 _PyFunction_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c (python+0x2443a7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#84 _PyVectorcall_Call /home/runner/work/cpython/cpython/Objects/call.c:273:16 (python+0x243d8f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#85 _PyObject_Call /home/runner/work/cpython/cpython/Objects/call.c:348:16 (python+0x243ff2) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#86 PyObject_Call /home/runner/work/cpython/cpython/Objects/call.c:373:12 (python+0x2441d7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#87 pymain_run_module /home/runner/work/cpython/cpython/Modules/main.c:297:14 (python+0x5cbbff) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#88 pymain_run_python /home/runner/work/cpython/cpython/Modules/main.c (python+0x5cad4c) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#89 Py_RunMain /home/runner/work/cpython/cpython/Modules/main.c:707:5 (python+0x5cad4c)
#90 pymain_main /home/runner/work/cpython/cpython/Modules/main.c:737:12 (python+0x5cba6a) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#91 Py_BytesMain /home/runner/work/cpython/cpython/Modules/main.c:761:12 (python+0x5cbadb) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#92 main /home/runner/work/cpython/cpython/./Programs/python.c:15:12 (python+0x148d4e) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
Previous read of size 4 at 0x7ba40004b038 by thread T589:
#0 _PySemaphore_Wait /home/runner/work/cpython/cpython/Python/parking_lot.c:197:31 (python+0x54730e) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#1 _PyParkingLot_Park /home/runner/work/cpython/cpython/Python/parking_lot.c:308:15 (python+0x54761b) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#2 PyEvent_WaitTimed /home/runner/work/cpython/cpython/Python/lock.c:300:16 (python+0x530cb8) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#3 ThreadHandle_join /home/runner/work/cpython/cpython/./Modules/_threadmodule.c:504:13 (python+0x6737ca) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#4 PyThreadHandleObject_join /home/runner/work/cpython/cpython/./Modules/_threadmodule.c:641:9 (python+0x67422c) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#5 method_vectorcall_VARARGS /home/runner/work/cpython/cpython/Objects/descrobject.c:324:24 (python+0x259e51) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#6 _PyObject_VectorcallTstate /home/runner/work/cpython/cpython/./Include/internal/pycore_call.h:168:11 (python+0x2424e2) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#7 PyObject_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c:327:12 (python+0x243ea0) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#8 _PyEval_EvalFrameDefault /home/runner/work/cpython/cpython/Python/generated_cases.c.h:813:23 (python+0x466223) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#9 _PyEval_EvalFrame /home/runner/work/cpython/cpython/./Include/internal/pycore_ceval.h:114:16 (python+0x46032f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#10 _PyEval_Vector /home/runner/work/cpython/cpython/Python/ceval.c:1807:12 (python+0x46032f)
#11 _PyFunction_Vectorcall /home/runner/work/cpython/cpython/Objects/call.c (python+0x2443a7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#12 _PyObject_VectorcallTstate /home/runner/work/cpython/cpython/./Include/internal/pycore_call.h:168:11 (python+0x249ca5) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#13 method_vectorcall /home/runner/work/cpython/cpython/Objects/classobject.c:70:20 (python+0x2483cc) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#14 _PyVectorcall_Call /home/runner/work/cpython/cpython/Objects/call.c:273:16 (python+0x243d8f) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#15 _PyObject_Call /home/runner/work/cpython/cpython/Objects/call.c:348:16 (python+0x243ff2) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#16 PyObject_Call /home/runner/work/cpython/cpython/Objects/call.c:373:12 (python+0x2441d7) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#17 thread_run /home/runner/work/cpython/cpython/./Modules/_threadmodule.c:337:21 (python+0x672d93) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
#18 pythread_wrapper /home/runner/work/cpython/cpython/Python/thread_pthread.h:241:5 (python+0x5b08db) (BuildId: 168a8875c77d860a6ac68a572eab5630ed9cecdd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment