Skip to content

Running test test_read1_error_does_not_cause_reentrant_failure triggers ASan allocation error in test_bufferedio #159497

Open

Description

@ChaseKnowlden

Crash report

export CFLAGS="-g -O1 -fno-omit-frame-pointer"
./configure --with-address-sanitizer --without-pymalloc
make -j4
make -j4 test TESTOPTS="--timeout 120"
=================================================================
==652577==ERROR: AddressSanitizer: requested allocation size 0x4000000000000021 (0x4000000000001028 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0)
    #0 0x7f1c631280cf in malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/16/libasan.so.8+0x1280cf) (BuildId: 5dd8e204bdee85231489adbf7600ae439ded251b)
    #1 0x558987b0e01b in _PyMem_RawMalloc Objects/obmalloc.c:66
    #2 0x558987b354c6 in PyObject_Malloc Objects/obmalloc.c:1716
    #3 0x558987a17f51 in bytes_alloc Objects/bytesobject.c:133
    #4 0x558987a27169 in byteswriter_resize Objects/bytesobject.c:3875
    #5 0x558987a27169 in byteswriter_create Objects/bytesobject.c:3929
    #6 0x558987a271a4 in PyBytesWriter_Create Objects/bytesobject.c:3952
    #7 0x558987ef5a20 in _io__Buffered_read1_impl Modules/_io/bufferedio.c:1074
    #8 0x558987ef5a20 in _io__Buffered_read1 Modules/_io/clinic/bufferedio.c.h:652
    #9 0x558987a52e09 in method_vectorcall_FASTCALL Objects/descrobject.c:404
    #10 0x558987a323f1 in _PyObject_VectorcallTstate Include/internal/pycore_call.h:143
    #11 0x558987a323f1 in PyObject_Vectorcall Objects/call.c:327
    #12 0x558987cab969 in _Py_VectorCallInstrumentation_StackRefSteal Python/ceval.c:773
    #13 0x558987cbefee in _PyEval_EvalFrameDefault Python/generated_cases.c.h:1906
    #14 0x558987ce9ad2 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:122
    #15 0x558987ce9ad2 in _PyEval_Vector Python/ceval.c:2226
    #16 0x558987a31ca8 in _PyFunction_Vectorcall Objects/call.c:413
    #17 0x558987a34101 in _PyObject_VectorcallTstate Include/internal/pycore_call.h:143
    #18 0x558987a34101 in _PyObject_VectorcallPrepend Objects/call.c:910
    #19 0x558987a38979 in method_vectorcall Objects/classobject.c:55
    #20 0x558987a36682 in _PyVectorcall_Call Objects/call.c:273
    #21 0x558987a36a6a in _PyObject_Call Objects/call.c:348
    #22 0x558987a36aca in PyObject_Call Objects/call.c:373
    #23 0x558987cc2fd6 in _PyEval_EvalFrameDefault Python/generated_cases.c.h:3164
    #24 0x558987ce9ad2 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:122
    #25 0x558987ce9ad2 in _PyEval_Vector Python/ceval.c:2226
    #26 0x558987a31ca8 in _PyFunction_Vectorcall Objects/call.c:413
    #27 0x558987a36158 in _PyObject_VectorcallDictTstate Objects/call.c:135
    #28 0x558987a3654e in _PyObject_Call_Prepend Objects/call.c:504
    #29 0x558987b6b9d6 in call_method Objects/typeobject.c:3075
    #30 0x558987b6bc58 in slot_tp_call Objects/typeobject.c:10892
    #31 0x558987a31eda in _PyObject_MakeTpCall Objects/call.c:242
    #32 0x558987a3243b in _PyObject_VectorcallTstate Include/internal/pycore_call.h:141
    #33 0x558987a3243b in PyObject_Vectorcall Objects/call.c:327
    #34 0x558987cab5b8 in _Py_VectorCall_StackRefSteal Python/ceval.c:731
    #35 0x558987cc7619 in _PyEval_EvalFrameDefault Python/generated_cases.c.h:4566
    #36 0x558987ce9ad2 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:122
    #37 0x558987ce9ad2 in _PyEval_Vector Python/ceval.c:2226

==652577==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: allocation-size-too-big Objects/obmalloc.c:66 in _PyMem_RawMalloc
==652577==ABORTING

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

Python 3.16.0a1+dev (heads/main:fdec4df45ab, Oct 15 2026, 19:14:03) [GCC 16.2.1 20260926]

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtopic-IOtype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions