Skip to content

TSAN data race in _PyErr_Restore #131401

Closed
Closed
@kumaraditya303

Description

@kumaraditya303

When running asyncio tests with forever mode, the following race is detected:

0:04:28 load avg: 13.03 [121/1] test_asyncio.test_tasks worker non-zero exit code (Exit code 66) -- running (3): test_asyncio.test_events (1 min 4 sec), test_asyncio.test_sendfile (32.5 sec), test_asyncio.test_tasks (1 min 28 sec)
==================
WARNING: ThreadSanitizer: data race (pid=4663)
  Read of size 8 at 0x7f754ba233f8 by main thread:
    #0 PyException_GetTraceback Objects/exceptions.c:524 (python+0x1800f4) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #1 PyTraceBack_Here Python/traceback.c:276 (python+0x473168) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #2 _PyEval_EvalFrameDefault Python/generated_cases.c.h:12134 (python+0x87bcf) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #3 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #4 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #5 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #6 _PyObject_VectorcallTstate Include/internal/pycore_call.h:168 (python+0x15567d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #7 method_vectorcall Objects/classobject.c:94 (python+0x15567d)
    #8 _PyVectorcall_Call Objects/call.c:273 (python+0x152137) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #9 _PyObject_Call Objects/call.c:348 (python+0x1526f1) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #10 PyObject_Call Objects/call.c:373 (python+0x1526f1)
    #11 _PyEval_EvalFrameDefault Python/generated_cases.c.h:2424 (python+0x8f52d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #12 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #13 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #14 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #15 _PyObject_VectorcallDictTstate Objects/call.c:135 (python+0x151d9e) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #16 _PyObject_Call_Prepend Objects/call.c:504 (python+0x1520b3) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #17 slot_tp_call Objects/typeobject.c:10061 (python+0x27af43) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #18 _PyObject_MakeTpCall Objects/call.c:242 (python+0x14ea92) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #19 _PyObject_VectorcallTstate Include/internal/pycore_call.h:166 (python+0x14fa18) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #20 _PyObject_VectorcallTstate Include/internal/pycore_call.h:153 (python+0x14fa18)
    #21 PyObject_Vectorcall Objects/call.c:327 (python+0x14fa18)
    #22 _PyEval_EvalFrameDefault Python/generated_cases.c.h:3837 (python+0x8bba6) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #23 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #24 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #25 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #26 _PyObject_VectorcallTstate Include/internal/pycore_call.h:168 (python+0x15567d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #27 method_vectorcall Objects/classobject.c:94 (python+0x15567d)
    #28 _PyVectorcall_Call Objects/call.c:273 (python+0x152137) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #29 _PyObject_Call Objects/call.c:348 (python+0x1526f1) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #30 PyObject_Call Objects/call.c:373 (python+0x1526f1)
    #31 _PyEval_EvalFrameDefault Python/generated_cases.c.h:2424 (python+0x8f52d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #32 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #33 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #34 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #35 _PyObject_VectorcallDictTstate Objects/call.c:135 (python+0x151d9e) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #36 _PyObject_Call_Prepend Objects/call.c:504 (python+0x1520b3) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #37 slot_tp_call Objects/typeobject.c:10061 (python+0x27af43) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #38 _PyObject_MakeTpCall Objects/call.c:242 (python+0x14ea92) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #39 _PyObject_VectorcallTstate Include/internal/pycore_call.h:166 (python+0x14fa18) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #40 _PyObject_VectorcallTstate Include/internal/pycore_call.h:153 (python+0x14fa18)
    #41 PyObject_Vectorcall Objects/call.c:327 (python+0x14fa18)
    #42 _PyEval_EvalFrameDefault Python/generated_cases.c.h:3837 (python+0x8bba6) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #43 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #44 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #45 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #46 _PyObject_VectorcallTstate Include/internal/pycore_call.h:168 (python+0x15567d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #47 method_vectorcall Objects/classobject.c:94 (python+0x15567d)
    #48 _PyVectorcall_Call Objects/call.c:273 (python+0x152137) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #49 _PyObject_Call Objects/call.c:348 (python+0x1526f1) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #50 PyObject_Call Objects/call.c:373 (python+0x1526f1)
    #51 _PyEval_EvalFrameDefault Python/generated_cases.c.h:2424 (python+0x8f52d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #52 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #53 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #54 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #55 _PyObject_VectorcallDictTstate Objects/call.c:135 (python+0x151d9e) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #56 _PyObject_Call_Prepend Objects/call.c:504 (python+0x1520b3) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #57 slot_tp_call Objects/typeobject.c:10061 (python+0x27af43) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #58 _PyObject_MakeTpCall Objects/call.c:242 (python+0x14ea92) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #59 _PyObject_VectorcallTstate Include/internal/pycore_call.h:166 (python+0x14fa18) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #60 _PyObject_VectorcallTstate Include/internal/pycore_call.h:153 (python+0x14fa18)
    #61 PyObject_Vectorcall Objects/call.c:327 (python+0x14fa18)
    #62 _PyEval_EvalFrameDefault Python/generated_cases.c.h:1375 (python+0x8bfa8) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #63 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x381d04) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #64 _PyEval_Vector Python/ceval.c:1903 (python+0x381d04)
    #65 PyEval_EvalCode Python/ceval.c:831 (python+0x381d04)
    #66 builtin_exec_impl Python/bltinmodule.c:1156 (python+0x36f006) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #67 builtin_exec Python/clinic/bltinmodule.c.h:560 (python+0x36f006)
    #68 cfunction_vectorcall_FASTCALL_KEYWORDS Objects/methodobject.c:452 (python+0x203bd9) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #69 _PyObject_VectorcallTstate Include/internal/pycore_call.h:168 (python+0x14f921) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #70 PyObject_Vectorcall Objects/call.c:327 (python+0x14f921)
    #71 _PyEval_EvalFrameDefault Python/generated_cases.c.h:1375 (python+0x8bfa8) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #72 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #73 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #74 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #75 _PyVectorcall_Call Objects/call.c:273 (python+0x152137) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #76 _PyObject_Call Objects/call.c:348 (python+0x1526f1) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #77 PyObject_Call Objects/call.c:373 (python+0x1526f1)
    #78 pymain_run_module Modules/main.c:337 (python+0x48ee2c) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #79 pymain_run_python Modules/main.c:673 (python+0x48fb8c) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #80 Py_RunMain Modules/main.c:760 (python+0x491042) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #81 pymain_main Modules/main.c:790 (python+0x491042)
    #82 Py_BytesMain Modules/main.c:814 (python+0x491042)
    #83 main Programs/python.c:15 (python+0x85ce2) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)

  Previous write of size 8 at 0x7f754ba233f8 by thread T6:
    #0 _PyErr_Restore Python/errors.c:103 (python+0x3c0b47) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #1 _PyErr_SetObject Python/errors.c:248 (python+0x3be492) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #2 do_raise Python/ceval.c:2069 (python+0x377a04) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #3 _PyEval_EvalFrameDefault Python/generated_cases.c.h:10137 (python+0x99acb) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #4 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #5 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #6 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #7 _PyObject_VectorcallTstate Include/internal/pycore_call.h:168 (python+0x1557f8) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #8 method_vectorcall Objects/classobject.c:72 (python+0x1557f8)
    #9 _PyVectorcall_Call Objects/call.c:273 (python+0x152137) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #10 _PyObject_Call Objects/call.c:348 (python+0x1526f1) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #11 PyObject_Call Objects/call.c:373 (python+0x1526f1)
    #12 thread_run Modules/_threadmodule.c:352 (python+0x537935) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #13 pythread_wrapper Python/thread_pthread.h:242 (python+0x46f499) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)

  Thread T6 'asyncio_0' (tid=7712, running) created by main thread at:
    #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:1022 (libtsan.so.2+0x5ac1a) (BuildId: 38097064631f7912bd33117a9c83d08b42e15571)
    #1 do_start_joinable_thread Python/thread_pthread.h:289 (python+0x46f92e) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #2 PyThread_start_joinable_thread Python/thread_pthread.h:313 (python+0x46f92e)
    #3 ThreadHandle_start Modules/_threadmodule.c:437 (python+0x538cb8) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #4 do_start_new_thread Modules/_threadmodule.c:1822 (python+0x538cb8)
    #5 thread_PyThread_start_joinable_thread Modules/_threadmodule.c:1945 (python+0x5395d1) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #6 cfunction_call Objects/methodobject.c:551 (python+0x203dd6) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #7 _PyObject_MakeTpCall Objects/call.c:242 (python+0x14ea92) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #8 _PyObject_VectorcallTstate Include/internal/pycore_call.h:166 (python+0x14fa18) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #9 _PyObject_VectorcallTstate Include/internal/pycore_call.h:153 (python+0x14fa18)
    #10 PyObject_Vectorcall Objects/call.c:327 (python+0x14fa18)
    #11 _PyEval_EvalFrameDefault Python/generated_cases.c.h:3012 (python+0x8d3aa) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #12 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #13 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #14 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #15 _PyObject_VectorcallTstate Include/internal/pycore_call.h:168 (python+0x15567d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #16 method_vectorcall Objects/classobject.c:94 (python+0x15567d)
    #17 _PyVectorcall_Call Objects/call.c:273 (python+0x152137) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #18 _PyObject_Call Objects/call.c:348 (python+0x1526f1) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #19 PyObject_Call Objects/call.c:373 (python+0x1526f1)
    #20 _PyEval_EvalFrameDefault Python/generated_cases.c.h:2424 (python+0x8f52d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #21 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #22 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #23 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #24 _PyObject_VectorcallTstate Include/internal/pycore_call.h:168 (python+0x15567d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #25 method_vectorcall Objects/classobject.c:94 (python+0x15567d)
    #26 _PyVectorcall_Call Objects/call.c:273 (python+0x152137) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #27 _PyObject_Call Objects/call.c:348 (python+0x1526f1) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #28 PyObject_Call Objects/call.c:373 (python+0x1526f1)
    #29 _PyEval_EvalFrameDefault Python/generated_cases.c.h:2424 (python+0x8f52d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #30 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #31 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #32 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #33 _PyObject_VectorcallDictTstate Objects/call.c:135 (python+0x151d9e) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #34 _PyObject_Call_Prepend Objects/call.c:504 (python+0x1520b3) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #35 slot_tp_call Objects/typeobject.c:10061 (python+0x27af43) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #36 _PyObject_MakeTpCall Objects/call.c:242 (python+0x14ea92) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #37 _PyObject_VectorcallTstate Include/internal/pycore_call.h:166 (python+0x14fa18) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #38 _PyObject_VectorcallTstate Include/internal/pycore_call.h:153 (python+0x14fa18)
    #39 PyObject_Vectorcall Objects/call.c:327 (python+0x14fa18)
    #40 _PyEval_EvalFrameDefault Python/generated_cases.c.h:3837 (python+0x8bba6) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #41 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #42 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #43 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #44 _PyObject_VectorcallTstate Include/internal/pycore_call.h:168 (python+0x15567d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #45 method_vectorcall Objects/classobject.c:94 (python+0x15567d)
    #46 _PyVectorcall_Call Objects/call.c:273 (python+0x152137) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #47 _PyObject_Call Objects/call.c:348 (python+0x1526f1) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #48 PyObject_Call Objects/call.c:373 (python+0x1526f1)
    #49 _PyEval_EvalFrameDefault Python/generated_cases.c.h:2424 (python+0x8f52d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #50 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #51 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #52 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #53 _PyObject_VectorcallDictTstate Objects/call.c:135 (python+0x151d9e) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #54 _PyObject_Call_Prepend Objects/call.c:504 (python+0x1520b3) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #55 slot_tp_call Objects/typeobject.c:10061 (python+0x27af43) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #56 _PyObject_MakeTpCall Objects/call.c:242 (python+0x14ea92) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #57 _PyObject_VectorcallTstate Include/internal/pycore_call.h:166 (python+0x14fa18) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #58 _PyObject_VectorcallTstate Include/internal/pycore_call.h:153 (python+0x14fa18)
    #59 PyObject_Vectorcall Objects/call.c:327 (python+0x14fa18)
    #60 _PyEval_EvalFrameDefault Python/generated_cases.c.h:3837 (python+0x8bba6) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #61 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #62 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #63 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #64 _PyObject_VectorcallTstate Include/internal/pycore_call.h:168 (python+0x15567d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #65 method_vectorcall Objects/classobject.c:94 (python+0x15567d)
    #66 _PyVectorcall_Call Objects/call.c:273 (python+0x152137) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #67 _PyObject_Call Objects/call.c:348 (python+0x1526f1) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #68 PyObject_Call Objects/call.c:373 (python+0x1526f1)
    #69 _PyEval_EvalFrameDefault Python/generated_cases.c.h:2424 (python+0x8f52d) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #70 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #71 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #72 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #73 _PyObject_VectorcallDictTstate Objects/call.c:135 (python+0x151d9e) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #74 _PyObject_Call_Prepend Objects/call.c:504 (python+0x1520b3) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #75 slot_tp_call Objects/typeobject.c:10061 (python+0x27af43) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #76 _PyObject_MakeTpCall Objects/call.c:242 (python+0x14ea92) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #77 _PyObject_VectorcallTstate Include/internal/pycore_call.h:166 (python+0x14fa18) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #78 _PyObject_VectorcallTstate Include/internal/pycore_call.h:153 (python+0x14fa18)
    #79 PyObject_Vectorcall Objects/call.c:327 (python+0x14fa18)
    #80 _PyEval_EvalFrameDefault Python/generated_cases.c.h:1375 (python+0x8bfa8) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #81 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x381d04) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #82 _PyEval_Vector Python/ceval.c:1903 (python+0x381d04)
    #83 PyEval_EvalCode Python/ceval.c:831 (python+0x381d04)
    #84 builtin_exec_impl Python/bltinmodule.c:1156 (python+0x36f006) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #85 builtin_exec Python/clinic/bltinmodule.c.h:560 (python+0x36f006)
    #86 cfunction_vectorcall_FASTCALL_KEYWORDS Objects/methodobject.c:452 (python+0x203bd9) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #87 _PyObject_VectorcallTstate Include/internal/pycore_call.h:168 (python+0x14f921) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #88 PyObject_Vectorcall Objects/call.c:327 (python+0x14f921)
    #89 _PyEval_EvalFrameDefault Python/generated_cases.c.h:1375 (python+0x8bfa8) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #90 _PyEval_EvalFrame Include/internal/pycore_ceval.h:116 (python+0x382348) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #91 _PyEval_Vector Python/ceval.c:1903 (python+0x382348)
    #92 _PyFunction_Vectorcall Objects/call.c:413 (python+0x14fd3b) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #93 _PyVectorcall_Call Objects/call.c:273 (python+0x152137) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #94 _PyObject_Call Objects/call.c:348 (python+0x1526f1) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #95 PyObject_Call Objects/call.c:373 (python+0x1526f1)
    #96 pymain_run_module Modules/main.c:337 (python+0x48ee2c) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #97 pymain_run_python Modules/main.c:673 (python+0x48fb8c) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #98 Py_RunMain Modules/main.c:760 (python+0x491042) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)
    #99 pymain_main Modules/main.c:790 (python+0x491042)
    #100 Py_BytesMain Modules/main.c:814 (python+0x491042)
    #101 main Programs/python.c:15 (python+0x85ce2) (BuildId: 53ed23022782f7933a3af0cc0267268b7d97fe42)

SUMMARY: ThreadSanitizer: data race Objects/exceptions.c:524 in PyException_GetTraceback
==================

The fix here is to set the traceback of the exception while holding the critical section so it should use PyException_SetTraceback API.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions