Skip to content

Conversation

@Zheaoli
Copy link
Contributor

@Zheaoli Zheaoli commented Jan 10, 2026

@Fidget-Spinner
Copy link
Member

Full disclaimer: I wrote the test here and verified it crashes on ASAN on main branch.

@Zheaoli
Copy link
Contributor Author

Zheaoli commented Jan 10, 2026

BTW, for the record, when I run ./python -m unittest -v test.test_capi.test_opt.TestExecutorInvalidation.test_prev_executor_freed_while_tracing. A new ASAN error has been raised

==3795402==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 2040 byte(s) in 1 object(s) allocated from:
    #0 0x7fe57ad20cb5 in malloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:67
    #1 0x5647b297e7c9 in _PyMem_RawMalloc Objects/obmalloc.c:64
    #2 0x5647b297db5f in _PyMem_DebugRawAlloc Objects/obmalloc.c:2926
    #3 0x5647b297dbc8 in _PyMem_DebugRawMalloc Objects/obmalloc.c:2959
    #4 0x5647b297f4a6 in _PyMem_DebugMalloc Objects/obmalloc.c:3124
    #5 0x5647b29a84bf in PyObject_Malloc Objects/obmalloc.c:1532
    #6 0x5647b2c7ece2 in _PyObject_MallocWithType Include/internal/pycore_object_alloc.h:46
    #7 0x5647b2c7ece2 in gc_alloc Python/gc.c:2352
    #8 0x5647b2c7ef4b in _PyObject_GC_NewVar Python/gc.c:2394
    #9 0x5647b2ce92b2 in allocate_executor Python/optimizer.c:1261
    #10 0x5647b2cf07ad in make_executor_from_uops Python/optimizer.c:1348
    #11 0x5647b2cf143d in uop_optimize Python/optimizer.c:1528
    #12 0x5647b2cf266c in _PyOptimizer_Optimize Python/optimizer.c:164
    #13 0x5647b2b34772 in stop_tracing_and_jit Python/ceval.c:1461
    #14 0x5647b2b7d2aa in _PyEval_EvalFrameDefault Python/generated_cases.c.h:11823
    #15 0x5647b2b80d59 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:118
    #16 0x5647b2b810c2 in _PyEval_Vector Python/ceval.c:2541
    #17 0x5647b28b0877 in _PyFunction_Vectorcall Objects/call.c:413
    #18 0x5647b28b6cbf in _PyObject_VectorcallTstate Include/internal/pycore_call.h:136
    #19 0x5647b28b6fb1 in method_vectorcall Objects/classobject.c:95
    #20 0x5647b28b3f42 in _PyVectorcall_Call Objects/call.c:273
    #21 0x5647b28b441e in _PyObject_Call Objects/call.c:348
    #22 0x5647b28b4465 in PyObject_Call Objects/call.c:373
    #23 0x5647b2b4db07 in _PyEval_EvalFrameDefault Python/generated_cases.c.h:2876
    #24 0x5647b2b80d59 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:118
    #25 0x5647b2b810c2 in _PyEval_Vector Python/ceval.c:2541
    #26 0x5647b28b0877 in _PyFunction_Vectorcall Objects/call.c:413
    #27 0x5647b28b37a4 in _PyObject_VectorcallDictTstate Objects/call.c:135
    #28 0x5647b28b3bb1 in _PyObject_Call_Prepend Objects/call.c:504
    #29 0x5647b29f04b2 in call_method Objects/typeobject.c:3088
    #30 0x5647b29f0684 in slot_tp_call Objects/typeobject.c:10681

I'm trying to figure it out why

@Fidget-Spinner
Copy link
Member

Fidget-Spinner commented Jan 10, 2026

I'm trying to figure it out why

Oops, I was testing this locally and also saw the ASAN leak so I fixed it. There's no more leak now.

@Zheaoli
Copy link
Contributor Author

Zheaoli commented Jan 10, 2026

Oops, I was testing this locally and also saw the ASAN leak so I fixed it. There's no more leak now.

LOL, Thanks for the new commit. Actually I have never think about this part yet. Thanks for the leason #TIL

@Fidget-Spinner Fidget-Spinner merged commit e2f0160 into python:main Jan 10, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants