Skip to content

segv in ceval #156074

Description

@chongwick

Bug report

Bug description:

import types
def f():
    raise ValueError("boom")
# exception table entry: start=0, size=1000, handler=1000000, depth_and_lasti=0
tbl = bytes([0x80, 0x4F, 0x28, 0x43, 0x74, 0x49, 0x00, 0x00])
c = f.__code__.replace(co_exceptiontable=tbl)
g = types.FunctionType(c, {})
g()

AddressSanitizer:DEADLYSIGNAL

==686==ERROR: AddressSanitizer: SEGV on unknown address 0x51100024d858 (pc 0x55afba634234 bp 0x7ffd0ebd9a70 sp 0x7ffd0ebd9800 T0)
==686==The signal is caused by a READ memory access.
#0 0x55afba634234 in _PyEval_EvalFrameDefault /src/Python/ceval.c:941:13
#1 0x55afba5d3751 in PyEval_EvalCode /src/Python/ceval.c:604:21
#2 0x55afba87390d in run_eval_code_obj /src/Python/pythonrun.c:1412:9
#3 0x55afba86e2d7 in run_mod /src/Python/pythonrun.c:1520:19
#4 0x55afba86e2d7 in _PyRun_File /src/Python/pythonrun.c:1325:15
#5 0x55afba86c564 in _PyRun_SimpleFile /src/Python/pythonrun.c:535:15
#6 0x55afba86bbea in _PyRun_AnyFile /src/Python/pythonrun.c:80:18
#7 0x55afba91692c in pymain_run_file_obj /src/Modules/main.c:439:24
#8 0x55afba91692c in pymain_run_file /src/Modules/main.c:460:20
#9 0x55afba9149df in pymain_run_python /src/Modules/main.c:749:21
#10 0x55afba9149df in Py_RunMain /src/Modules/main.c:834:5
#11 0x55afba915a4e in pymain_main /src/Modules/main.c:864:12
#12 0x55afba915ccb in Py_BytesMain /src/Modules/main.c:888:12
#13 0x7f13b6e5c1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 328820b908de8ea1ef79afa8995e302e819163d7)
#14 0x7f13b6e5c28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 328820b908de8ea1ef79afa8995e302e819163d7)
#15 0x55afb9c600e4 in _start (/src/python+0x8a50e4) (BuildId: 3b43aba34b3fa4d8f78d45ed989d4376001e9216)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /src/Python/ceval.c:941:13 in _PyEval_EvalFrameDefault
==686==ABORTING

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errortype-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