GeezerVison is showing github.com — gh-117657: Make frame clearing thread-safe by Fidget-Spinner · Pull Request #120542 · python/cpython
Conversation
Fidget-Spinner
commented
Jun 15, 2024
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Data race reported by TSAN on the test:
==================
WARNING: ThreadSanitizer: data race (pid=58102)
Write of size 4 at 0x7fffb4922638 by thread T1:
#0 frame_tp_clear /home/ken/Documents/GitHub/cpython/Objects/frameobject.c:1659:26 (python+0x2a6c43) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#1 frame_clear /home/ken/Documents/GitHub/cpython/Objects/frameobject.c:1682:15 (python+0x2ac64c) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#2 method_vectorcall_NOARGS /home/ken/Documents/GitHub/cpython/Objects/descrobject.c:447:24 (python+0x275080) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#3 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x2589c1) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#4 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#5 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:813:23 (python+0x4a1732) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#6 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#7 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#8 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#9 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x260c31) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#10 method_vectorcall /home/ken/Documents/GitHub/cpython/Objects/classobject.c:70:20 (python+0x25ef55) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#11 _PyVectorcall_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:273:16 (python+0x25a45f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#12 _PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:348:16 (python+0x25a6f7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#13 PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:373:12 (python+0x25a8e7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#14 thread_run /home/ken/Documents/GitHub/cpython/./Modules/_threadmodule.c:337:21 (python+0x6a2648) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#15 pythread_wrapper /home/ken/Documents/GitHub/cpython/Python/thread_pthread.h:243:5 (python+0x5ddd7b) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
Previous write of size 4 at 0x7fffb4922638 by thread T2:
#0 frame_tp_clear /home/ken/Documents/GitHub/cpython/Objects/frameobject.c:1659:26 (python+0x2a6c43) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#1 frame_clear /home/ken/Documents/GitHub/cpython/Objects/frameobject.c:1682:15 (python+0x2ac64c) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#2 method_vectorcall_NOARGS /home/ken/Documents/GitHub/cpython/Objects/descrobject.c:447:24 (python+0x275080) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#3 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x2589c1) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#4 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#5 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:813:23 (python+0x4a1732) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#6 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#7 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#8 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#9 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x260c31) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#10 method_vectorcall /home/ken/Documents/GitHub/cpython/Objects/classobject.c:70:20 (python+0x25ef55) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#11 _PyVectorcall_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:273:16 (python+0x25a45f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#12 _PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:348:16 (python+0x25a6f7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#13 PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:373:12 (python+0x25a8e7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#14 thread_run /home/ken/Documents/GitHub/cpython/./Modules/_threadmodule.c:337:21 (python+0x6a2648) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#15 pythread_wrapper /home/ken/Documents/GitHub/cpython/Python/thread_pthread.h:243:5 (python+0x5ddd7b) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
Thread T1 (tid=58105, running) created by main thread at:
#0 pthread_create <null> (python+0xdd37b) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#1 do_start_joinable_thread /home/ken/Documents/GitHub/cpython/Python/thread_pthread.h:290:14 (python+0x5dc9eb) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#2 PyThread_start_joinable_thread /home/ken/Documents/GitHub/cpython/Python/thread_pthread.h:314:9 (python+0x5dc80a) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#3 ThreadHandle_start /home/ken/Documents/GitHub/cpython/./Modules/_threadmodule.c:422:9 (python+0x6a214f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#4 do_start_new_thread /home/ken/Documents/GitHub/cpython/./Modules/_threadmodule.c:1798:9 (python+0x6a214f)
#5 thread_PyThread_start_joinable_thread /home/ken/Documents/GitHub/cpython/./Modules/_threadmodule.c:1921:14 (python+0x6a0ba5) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#6 cfunction_call /home/ken/Documents/GitHub/cpython/Objects/methodobject.c:540:18 (python+0x31a189) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#7 _PyObject_MakeTpCall /home/ken/Documents/GitHub/cpython/Objects/call.c:242:18 (python+0x259183) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#8 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:166:16 (python+0x2589e9) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#9 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#10 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:1505:19 (python+0x4a5e53) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#11 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#12 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#13 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#14 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x260c31) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#15 method_vectorcall /home/ken/Documents/GitHub/cpython/Objects/classobject.c:92:18 (python+0x25efc2) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#16 _PyVectorcall_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:273:16 (python+0x25a45f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#17 _PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:348:16 (python+0x25a6f7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#18 PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:373:12 (python+0x25a8e7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#19 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:1358:26 (python+0x4a4c61) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#20 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#21 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#22 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#23 _PyObject_VectorcallDictTstate /home/ken/Documents/GitHub/cpython/Objects/call.c:135:15 (python+0x258c83) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#24 _PyObject_Call_Prepend /home/ken/Documents/GitHub/cpython/Objects/call.c:504:24 (python+0x25af46) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#25 slot_tp_call /home/ken/Documents/GitHub/cpython/Objects/typeobject.c:9730:15 (python+0x397e8c) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#26 _PyObject_MakeTpCall /home/ken/Documents/GitHub/cpython/Objects/call.c:242:18 (python+0x259183) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#27 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:166:16 (python+0x2589e9) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#28 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#29 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:813:23 (python+0x4a1732) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#30 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#31 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#32 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#33 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x260c31) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#34 method_vectorcall /home/ken/Documents/GitHub/cpython/Objects/classobject.c:92:18 (python+0x25efc2) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#35 _PyVectorcall_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:273:16 (python+0x25a45f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#36 _PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:348:16 (python+0x25a6f7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#37 PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:373:12 (python+0x25a8e7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#38 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:1358:26 (python+0x4a4c61) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#39 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#40 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#41 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#42 _PyObject_VectorcallDictTstate /home/ken/Documents/GitHub/cpython/Objects/call.c:135:15 (python+0x258c83) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#43 _PyObject_Call_Prepend /home/ken/Documents/GitHub/cpython/Objects/call.c:504:24 (python+0x25af46) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#44 slot_tp_call /home/ken/Documents/GitHub/cpython/Objects/typeobject.c:9730:15 (python+0x397e8c) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#45 _PyObject_MakeTpCall /home/ken/Documents/GitHub/cpython/Objects/call.c:242:18 (python+0x259183) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#46 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:166:16 (python+0x2589e9) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#47 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#48 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:813:23 (python+0x4a1732) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#49 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#50 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#51 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#52 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x260c31) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#53 method_vectorcall /home/ken/Documents/GitHub/cpython/Objects/classobject.c:92:18 (python+0x25efc2) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#54 _PyVectorcall_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:273:16 (python+0x25a45f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#55 _PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:348:16 (python+0x25a6f7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#56 PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:373:12 (python+0x25a8e7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#57 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:1358:26 (python+0x4a4c61) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#58 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#59 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#60 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#61 _PyObject_VectorcallDictTstate /home/ken/Documents/GitHub/cpython/Objects/call.c:135:15 (python+0x258c83) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#62 _PyObject_Call_Prepend /home/ken/Documents/GitHub/cpython/Objects/call.c:504:24 (python+0x25af46) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#63 slot_tp_call /home/ken/Documents/GitHub/cpython/Objects/typeobject.c:9730:15 (python+0x397e8c) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#64 _PyObject_MakeTpCall /home/ken/Documents/GitHub/cpython/Objects/call.c:242:18 (python+0x259183) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#65 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:166:16 (python+0x2589e9) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#66 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#67 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:813:23 (python+0x4a1732) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#68 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#69 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#70 PyEval_EvalCode /home/ken/Documents/GitHub/cpython/Python/ceval.c:599:21 (python+0x49b48a) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#71 builtin_exec_impl /home/ken/Documents/GitHub/cpython/Python/bltinmodule.c:1145:17 (python+0x493873) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#72 builtin_exec /home/ken/Documents/GitHub/cpython/Python/clinic/bltinmodule.c.h:556:20 (python+0x493873)
#73 cfunction_vectorcall_FASTCALL_KEYWORDS /home/ken/Documents/GitHub/cpython/Objects/methodobject.c:441:24 (python+0x318c4c) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#74 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x2589c1) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#75 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#76 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:813:23 (python+0x4a1732) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#77 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#78 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#79 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#80 _PyVectorcall_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:273:16 (python+0x25a45f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#81 _PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:348:16 (python+0x25a6f7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#82 PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:373:12 (python+0x25a8e7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#83 pymain_run_module /home/ken/Documents/GitHub/cpython/Modules/main.c:297:14 (python+0x5f9ab3) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#84 pymain_run_python /home/ken/Documents/GitHub/cpython/Modules/main.c (python+0x5f91cb) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#85 Py_RunMain /home/ken/Documents/GitHub/cpython/Modules/main.c:719:5 (python+0x5f91cb)
#86 pymain_main /home/ken/Documents/GitHub/cpython/Modules/main.c:749:12 (python+0x5f9859) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#87 Py_BytesMain /home/ken/Documents/GitHub/cpython/Modules/main.c:773:12 (python+0x5f98d9) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#88 main /home/ken/Documents/GitHub/cpython/./Programs/python.c:15:12 (python+0x15a840) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
Thread T2 (tid=58106, running) created by main thread at:
#0 pthread_create <null> (python+0xdd37b) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#1 do_start_joinable_thread /home/ken/Documents/GitHub/cpython/Python/thread_pthread.h:290:14 (python+0x5dc9eb) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#2 PyThread_start_joinable_thread /home/ken/Documents/GitHub/cpython/Python/thread_pthread.h:314:9 (python+0x5dc80a) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#3 ThreadHandle_start /home/ken/Documents/GitHub/cpython/./Modules/_threadmodule.c:422:9 (python+0x6a214f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#4 do_start_new_thread /home/ken/Documents/GitHub/cpython/./Modules/_threadmodule.c:1798:9 (python+0x6a214f)
#5 thread_PyThread_start_joinable_thread /home/ken/Documents/GitHub/cpython/./Modules/_threadmodule.c:1921:14 (python+0x6a0ba5) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#6 cfunction_call /home/ken/Documents/GitHub/cpython/Objects/methodobject.c:540:18 (python+0x31a189) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#7 _PyObject_MakeTpCall /home/ken/Documents/GitHub/cpython/Objects/call.c:242:18 (python+0x259183) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#8 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:166:16 (python+0x2589e9) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#9 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#10 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:1505:19 (python+0x4a5e53) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#11 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#12 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#13 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#14 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x260c31) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#15 method_vectorcall /home/ken/Documents/GitHub/cpython/Objects/classobject.c:92:18 (python+0x25efc2) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#16 _PyVectorcall_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:273:16 (python+0x25a45f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#17 _PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:348:16 (python+0x25a6f7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#18 PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:373:12 (python+0x25a8e7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#19 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:1358:26 (python+0x4a4c61) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#20 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#21 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#22 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#23 _PyObject_VectorcallDictTstate /home/ken/Documents/GitHub/cpython/Objects/call.c:135:15 (python+0x258c83) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#24 _PyObject_Call_Prepend /home/ken/Documents/GitHub/cpython/Objects/call.c:504:24 (python+0x25af46) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#25 slot_tp_call /home/ken/Documents/GitHub/cpython/Objects/typeobject.c:9730:15 (python+0x397e8c) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#26 _PyObject_MakeTpCall /home/ken/Documents/GitHub/cpython/Objects/call.c:242:18 (python+0x259183) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#27 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:166:16 (python+0x2589e9) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#28 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#29 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:813:23 (python+0x4a1732) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#30 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#31 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#32 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#33 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x260c31) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#34 method_vectorcall /home/ken/Documents/GitHub/cpython/Objects/classobject.c:92:18 (python+0x25efc2) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#35 _PyVectorcall_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:273:16 (python+0x25a45f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#36 _PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:348:16 (python+0x25a6f7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#37 PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:373:12 (python+0x25a8e7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#38 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:1358:26 (python+0x4a4c61) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#39 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#40 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#41 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#42 _PyObject_VectorcallDictTstate /home/ken/Documents/GitHub/cpython/Objects/call.c:135:15 (python+0x258c83) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#43 _PyObject_Call_Prepend /home/ken/Documents/GitHub/cpython/Objects/call.c:504:24 (python+0x25af46) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#44 slot_tp_call /home/ken/Documents/GitHub/cpython/Objects/typeobject.c:9730:15 (python+0x397e8c) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#45 _PyObject_MakeTpCall /home/ken/Documents/GitHub/cpython/Objects/call.c:242:18 (python+0x259183) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#46 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:166:16 (python+0x2589e9) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#47 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#48 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:813:23 (python+0x4a1732) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#49 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#50 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#51 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#52 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x260c31) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#53 method_vectorcall /home/ken/Documents/GitHub/cpython/Objects/classobject.c:92:18 (python+0x25efc2) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#54 _PyVectorcall_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:273:16 (python+0x25a45f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#55 _PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:348:16 (python+0x25a6f7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#56 PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:373:12 (python+0x25a8e7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#57 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:1358:26 (python+0x4a4c61) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#58 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#59 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#60 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#61 _PyObject_VectorcallDictTstate /home/ken/Documents/GitHub/cpython/Objects/call.c:135:15 (python+0x258c83) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#62 _PyObject_Call_Prepend /home/ken/Documents/GitHub/cpython/Objects/call.c:504:24 (python+0x25af46) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#63 slot_tp_call /home/ken/Documents/GitHub/cpython/Objects/typeobject.c:9730:15 (python+0x397e8c) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#64 _PyObject_MakeTpCall /home/ken/Documents/GitHub/cpython/Objects/call.c:242:18 (python+0x259183) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#65 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:166:16 (python+0x2589e9) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#66 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#67 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:813:23 (python+0x4a1732) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#68 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#69 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#70 PyEval_EvalCode /home/ken/Documents/GitHub/cpython/Python/ceval.c:599:21 (python+0x49b48a) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#71 builtin_exec_impl /home/ken/Documents/GitHub/cpython/Python/bltinmodule.c:1145:17 (python+0x493873) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#72 builtin_exec /home/ken/Documents/GitHub/cpython/Python/clinic/bltinmodule.c.h:556:20 (python+0x493873)
#73 cfunction_vectorcall_FASTCALL_KEYWORDS /home/ken/Documents/GitHub/cpython/Objects/methodobject.c:441:24 (python+0x318c4c) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#74 _PyObject_VectorcallTstate /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_call.h:168:11 (python+0x2589c1) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#75 PyObject_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c:327:12 (python+0x25a590) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#76 _PyEval_EvalFrameDefault /home/ken/Documents/GitHub/cpython/Python/generated_cases.c.h:813:23 (python+0x4a1732) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#77 _PyEval_EvalFrame /home/ken/Documents/GitHub/cpython/./Include/internal/pycore_ceval.h:119:16 (python+0x49b823) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#78 _PyEval_Vector /home/ken/Documents/GitHub/cpython/Python/ceval.c:1819:12 (python+0x49b823)
#79 _PyFunction_Vectorcall /home/ken/Documents/GitHub/cpython/Objects/call.c (python+0x25aabe) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#80 _PyVectorcall_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:273:16 (python+0x25a45f) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#81 _PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:348:16 (python+0x25a6f7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#82 PyObject_Call /home/ken/Documents/GitHub/cpython/Objects/call.c:373:12 (python+0x25a8e7) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#83 pymain_run_module /home/ken/Documents/GitHub/cpython/Modules/main.c:297:14 (python+0x5f9ab3) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#84 pymain_run_python /home/ken/Documents/GitHub/cpython/Modules/main.c (python+0x5f91cb) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#85 Py_RunMain /home/ken/Documents/GitHub/cpython/Modules/main.c:719:5 (python+0x5f91cb)
#86 pymain_main /home/ken/Documents/GitHub/cpython/Modules/main.c:749:12 (python+0x5f9859) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#87 Py_BytesMain /home/ken/Documents/GitHub/cpython/Modules/main.c:773:12 (python+0x5f98d9) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
#88 main /home/ken/Documents/GitHub/cpython/./Programs/python.c:15:12 (python+0x15a840) (BuildId: ba673fbbe716d09ffde3346e89a86287691724bc)
SUMMARY: ThreadSanitizer: data race /home/ken/Documents/GitHub/cpython/Objects/frameobject.c:1659:26 in frame_tp_clear
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Fidget-Spinner
changed the title
gh-117657: Make frame clearing thread safe
gh-117657: Make frame clearing thread-safe
Jun 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the test case that triggered the TSAN error?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
}
|
|
|
|
|
|
static void
|
|
|
gen_dealloc(PyGenObject *gen)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right to me. tp_dealloc can't be called concurrently on an object.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case the racing part is mainly _PyFrame_ClearExceptCode and setting the generator's flags. _PyEval_FrameClearAndPop can race with this as it also clears a generator, but instead it's done by ceval.c.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand -- how can _PyFrame_ClearExceptCode race with gen_dealloc?
It looks like gen_dealloc is only called from the tp_dealloc handler. If an object is being destroyed, then no other thread has access to it (or there's a separate serious bug).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I'm not too sure either. Let me revert this fix for now and try to hunt it down again.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What is the test case that triggered the TSAN error?
I first saw this getting triggered spuriously on our main test suite (I can't find the test now). But the TSAN logs I posted here are for the test case I wrote in this PR.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
All commit authors signed the Contributor License Agreement.

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I think this is fixed on main by #131479
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
markshannon
Awaiting requested review from markshannon
markshannon is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|