Skip to content

Instantly share code, notes, and snippets.

@hawkinsp
Created January 10, 2025 21:38
Show Gist options
  • Select an option

  • Save hawkinsp/948bc90fe8942f69db78924ffbb8a4eb to your computer and use it in GitHub Desktop.

Select an option

Save hawkinsp/948bc90fe8942f69db78924ffbb8a4eb to your computer and use it in GitHub Desktop.
tests/optimizers_test.py
==================
WARNING: ThreadSanitizer: data race (pid=3471332)
Write of size 8 at 0x7f216a050d20 by thread T144 (mutexes: read M0):
#0 mi_block_set_nextx /usr/local/google/home/phawkins/p/cpython/./Include/internal/mimalloc/mimalloc/internal.h:652:15 (python3.13+0x2ba5e6) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#1 mi_block_set_next /usr/local/google/home/phawkins/p/cpython/./Include/internal/mimalloc/mimalloc/internal.h:678:3 (python3.13+0x2ba5e6)
#2 mi_free /usr/local/google/home/phawkins/p/cpython/Objects/mimalloc/alloc.c:590:7 (python3.13+0x2ba5e6)
#3 _PyObject_MiFree /usr/local/google/home/phawkins/p/cpython/Objects/obmalloc.c:284:5 (python3.13+0x2ba5e6)
#4 PyObject_Free /usr/local/google/home/phawkins/p/cpython/Objects/obmalloc.c:1331:5 (python3.13+0x2bd064) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#5 arraymethod_dealloc array_method.c (_multiarray_umath.cpython-313t-x86_64-linux-gnu.so+0x227e86) (BuildId: 59eee63b7606b5c663c76774f0ae2b524ce1fdfb)
#6 _Py_Dealloc /usr/local/google/home/phawkins/p/cpython/Objects/object.c:2935:5 (python3.13+0x290805) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#7 merge_queued_objects /usr/local/google/home/phawkins/p/cpython/Python/brc.c:110:13 (python3.13+0x3dcd8a) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#8 _Py_brc_merge_refcounts /usr/local/google/home/phawkins/p/cpython/Python/brc.c:131:5 (python3.13+0x3dcd8a)
#9 _Py_HandlePending /usr/local/google/home/phawkins/p/cpython/Python/ceval_gil.c:1289:9 (python3.13+0x4536de) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#10 _PyEval_EvalFrameDefault /usr/local/google/home/phawkins/p/cpython/Python/generated_cases.c.h:5160:17 (python3.13+0x3f31c0) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#11 _PyEval_EvalFrame /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_ceval.h:119:16 (python3.13+0x3dea3a) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#12 _PyEval_Vector /usr/local/google/home/phawkins/p/cpython/Python/ceval.c:1807:12 (python3.13+0x3dea3a)
#13 _PyFunction_Vectorcall /usr/local/google/home/phawkins/p/cpython/Objects/call.c (python3.13+0x1eb65f) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#14 _PyObject_VectorcallTstate /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_call.h:168:11 (python3.13+0x1ef6e0) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#15 method_vectorcall /usr/local/google/home/phawkins/p/cpython/Objects/classobject.c:92:18 (python3.13+0x1ef6e0)
#16 _PyVectorcall_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:273:16 (python3.13+0x1eb2d3) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#17 _PyObject_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:348:16 (python3.13+0x1eb2d3)
#18 PyObject_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:373:12 (python3.13+0x1eb355) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#19 _PyEval_EvalFrameDefault /usr/local/google/home/phawkins/p/cpython/Python/generated_cases.c.h:1355:26 (python3.13+0x3e4af2) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#20 _PyEval_EvalFrame /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_ceval.h:119:16 (python3.13+0x3dea3a) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#21 _PyEval_Vector /usr/local/google/home/phawkins/p/cpython/Python/ceval.c:1807:12 (python3.13+0x3dea3a)
#22 _PyFunction_Vectorcall /usr/local/google/home/phawkins/p/cpython/Objects/call.c (python3.13+0x1eb65f) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#23 _PyObject_VectorcallTstate /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_call.h:168:11 (python3.13+0x1ef6e0) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#24 method_vectorcall /usr/local/google/home/phawkins/p/cpython/Objects/classobject.c:92:18 (python3.13+0x1ef6e0)
#25 _PyVectorcall_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:273:16 (python3.13+0x1eb2d3) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#26 _PyObject_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:348:16 (python3.13+0x1eb2d3)
#27 PyObject_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:373:12 (python3.13+0x1eb355) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#28 _PyEval_EvalFrameDefault /usr/local/google/home/phawkins/p/cpython/Python/generated_cases.c.h:1355:26 (python3.13+0x3e4af2) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#29 _PyEval_EvalFrame /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_ceval.h:119:16 (python3.13+0x3dea3a) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#30 _PyEval_Vector /usr/local/google/home/phawkins/p/cpython/Python/ceval.c:1807:12 (python3.13+0x3dea3a)
#31 _PyFunction_Vectorcall /usr/local/google/home/phawkins/p/cpython/Objects/call.c (python3.13+0x1eb65f) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#32 _PyObject_VectorcallDictTstate /usr/local/google/home/phawkins/p/cpython/Objects/call.c:135:15 (python3.13+0x1ea1dd) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#33 _PyObject_Call_Prepend /usr/local/google/home/phawkins/p/cpython/Objects/call.c:504:24 (python3.13+0x1ebcd7) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#34 slot_tp_call /usr/local/google/home/phawkins/p/cpython/Objects/typeobject.c:9533:15 (python3.13+0x2f8bb8) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#35 _PyObject_MakeTpCall /usr/local/google/home/phawkins/p/cpython/Objects/call.c:242:18 (python3.13+0x1ea44c) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#36 _PyObject_VectorcallTstate /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_call.h:166:16 (python3.13+0x1eb0a8) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#37 PyObject_Vectorcall /usr/local/google/home/phawkins/p/cpython/Objects/call.c:327:12 (python3.13+0x1eb0a8)
#38 _PyEval_EvalFrameDefault /usr/local/google/home/phawkins/p/cpython/Python/generated_cases.c.h:813:23 (python3.13+0x3e290b) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#39 _PyEval_EvalFrame /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_ceval.h:119:16 (python3.13+0x3dea3a) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#40 _PyEval_Vector /usr/local/google/home/phawkins/p/cpython/Python/ceval.c:1807:12 (python3.13+0x3dea3a)
#41 _PyFunction_Vectorcall /usr/local/google/home/phawkins/p/cpython/Objects/call.c (python3.13+0x1eb65f) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#42 _PyObject_VectorcallTstate /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_call.h:168:11 (python3.13+0x1ef62f) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#43 method_vectorcall /usr/local/google/home/phawkins/p/cpython/Objects/classobject.c:70:20 (python3.13+0x1ef62f)
#44 _PyVectorcall_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:273:16 (python3.13+0x1eb2d3) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#45 _PyObject_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:348:16 (python3.13+0x1eb2d3)
#46 PyObject_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:373:12 (python3.13+0x1eb355) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#47 thread_run /usr/local/google/home/phawkins/p/cpython/./Modules/_threadmodule.c:337:21 (python3.13+0x564a32) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#48 pythread_wrapper /usr/local/google/home/phawkins/p/cpython/Python/thread_pthread.h:243:5 (python3.13+0x4bddb7) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
Previous atomic read of size 8 at 0x7f216a050d20 by thread T146 (mutexes: read M0):
#0 _Py_atomic_load_uintptr_relaxed /usr/local/google/home/phawkins/p/cpython/./Include/cpython/pyatomic_gcc.h:347:10 (python3.13+0x26096c) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#1 _Py_IsOwnedByCurrentThread /usr/local/google/home/phawkins/p/cpython/./Include/object.h:309:12 (python3.13+0x26096c)
#2 _Py_TryIncrefFast /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_object.h:440:9 (python3.13+0x26096c)
#3 _Py_TryIncrefCompare /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_object.h:479:9 (python3.13+0x26096c)
#4 _Py_TryXGetRef /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_object.h:518:9 (python3.13+0x26096c)
#5 _Py_dict_lookup_threadsafe /usr/local/google/home/phawkins/p/cpython/Objects/dictobject.c:1528:21 (python3.13+0x26096c)
#6 PyDict_GetItemWithError /usr/local/google/home/phawkins/p/cpython/Objects/dictobject.c:2403:10 (python3.13+0x26267a) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#7 PyArray_GetCastingImpl <null> (_multiarray_umath.cpython-313t-x86_64-linux-gnu.so+0x2454eb) (BuildId: 59eee63b7606b5c663c76774f0ae2b524ce1fdfb)
#8 PyArray_GetCastInfo <null> (_multiarray_umath.cpython-313t-x86_64-linux-gnu.so+0x2460d1) (BuildId: 59eee63b7606b5c663c76774f0ae2b524ce1fdfb)
#9 PyArray_EquivTypes <null> (_multiarray_umath.cpython-313t-x86_64-linux-gnu.so+0x2d4918) (BuildId: 59eee63b7606b5c663c76774f0ae2b524ce1fdfb)
#10 arraydescr_richcompare descriptor.c (_multiarray_umath.cpython-313t-x86_64-linux-gnu.so+0x275a8b) (BuildId: 59eee63b7606b5c663c76774f0ae2b524ce1fdfb)
#11 do_richcompare /usr/local/google/home/phawkins/p/cpython/Objects/object.c:1010:15 (python3.13+0x2939c8) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#12 PyObject_RichCompare /usr/local/google/home/phawkins/p/cpython/Objects/object.c:1059:21 (python3.13+0x2939c8)
#13 PyObject_RichCompareBool /usr/local/google/home/phawkins/p/cpython/Objects/object.c:1081:11 (python3.13+0x293262) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#14 list_contains /usr/local/google/home/phawkins/p/cpython/Objects/listobject.c:663:19 (python3.13+0x23ee50) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#15 PySequence_Contains /usr/local/google/home/phawkins/p/cpython/Objects/abstract.c:2277:19 (python3.13+0x1c2ced) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#16 _PyEval_EvalFrameDefault /usr/local/google/home/phawkins/p/cpython/Python/generated_cases.c.h:2358:27 (python3.13+0x3e8cf9) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#17 _PyEval_EvalFrame /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_ceval.h:119:16 (python3.13+0x3dea3a) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#18 _PyEval_Vector /usr/local/google/home/phawkins/p/cpython/Python/ceval.c:1807:12 (python3.13+0x3dea3a)
#19 _PyFunction_Vectorcall /usr/local/google/home/phawkins/p/cpython/Objects/call.c (python3.13+0x1eb65f) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#20 _PyObject_VectorcallTstate /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_call.h:168:11 (python3.13+0x1ef6e0) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#21 method_vectorcall /usr/local/google/home/phawkins/p/cpython/Objects/classobject.c:92:18 (python3.13+0x1ef6e0)
#22 _PyVectorcall_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:273:16 (python3.13+0x1eb2d3) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#23 _PyObject_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:348:16 (python3.13+0x1eb2d3)
#24 PyObject_Call /usr/local/google/home/phawkins/p/cpython/Objects/call.c:373:12 (python3.13+0x1eb355) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#25 _PyEval_EvalFrameDefault /usr/local/google/home/phawkins/p/cpython/Python/generated_cases.c.h:1355:26 (python3.13+0x3e4af2) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#26 _PyEval_EvalFrame /usr/local/google/home/phawkins/p/cpython/./Include/internal/pycore_ceval.h:119:16 (python3.13+0x3dea3a) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#27 _PyEval_Vector /usr/local/google/home/phawkins/p/cpython/Python/ceval.c:1807:12 (python3.13+0x3dea3a)
#28 _PyFunction_Vectorcall /usr/local/google/home/phawkins/p/cpython/Objects/call.c (python3.13+0x1eb65f) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#29 _PyObject_VectorcallDictTstate /usr/local/google/home/phawkins/p/cpython/Objects/call.c:135:15 (python3.13+0x1ea1dd) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#30 _PyObject_Call_Prepend /usr/local/google/home/phawkins/p/cpython/Objects/call.c:504:24 (python3.13+0x1ebcd7) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
#31 slot_tp_call /usr/local/google/home/phawkins/p/cpython/Objects/typeobject.c:9533:15 (python3.13+0x2f8bb8) (BuildId: 19c569fa942016d8ac49d19fd40ccb1ddded939b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment