Repository navigation
Pdb crashes after jump with Fatal Python error: _PyMem_DebugRawFree: bad trailing pad byte #91742
Description
Activity
- addedtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
on Apr 20, 2022 Commit cf345e9 introduced this issue.
Running the following minimal example with the below input reproduces the crash.def function(): print( 3 ) breakpoint() function()
s n n j 1 cChanging
Py_DECREFtoPy_XDECREFfixes the issue but I'll let @markshannon decide if it is the correct fix.cc @markshannon
GDB backtrace:
#0 frame_stack_pop ( f=Frame 0x7ffff7fc0078, for file /workspaces/cpython/main.py, line 7, in about ()) at Objects/frameobject.c:421 #1 frame_setlineno ( f=Frame 0x7ffff7fc0078, for file /workspaces/cpython/main.py, line 7, in about (), p_new_lineno=<optimized out>, _unused_ignored=<optimized out>) at Objects/frameobject.c:641 #2 0x000055555570c906 in _PyObject_GenericSetAttrWithDict (dict=0x0, value=4, name='f_lineno', obj=Frame 0x7ffff7fc0078, for file /workspaces/cpython/main.py, line 7, in about ()) at Objects/object.c:1386
This looks like an old bug, probably dating back to the introduction of
LOAD_METHOD.
LOAD_METHODpushes aNULLto stack, which could cause this crash.LOAD_GLOBALcan also push aNULL, making this bug much easier to trigger.@kumaraditya303 your fix looks correct.
- added3.11only security fixesonly security fixes3.12only security fixesonly security fixes
on Jun 23, 2022 - added a commit that references this issue
on Jun 23, 2022 Python 3.11 and 3.12 (main) both are fixed now.
However Python 3.10 is also affected but it crashes on different assertion.
python: Python/ceval.c:3040: _PyEval_EvalFrameDefault: Assertion `STACK_LEVEL() <= co->co_stacksize' failed.cc @markshannon
- added a commit that references this issue
on Jun 26, 2022 - removed3.11only security fixesonly security fixes3.12only security fixesonly security fixes
on Jun 27, 2022 Removing the 3.11 and 3.12 tags so these are fixed in 3.11 and 3.12.
I'm removing the release blocker flag because 3.10 was already crashing with this. This will be treated as a regular bugfix.
Closed as 3.10 is no longer accepting bug fixes
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Crash report
Access violation occurs when using
pdbin the following procedure:printfunctionprintfunction, jump to the beginning of the codeCode Example [test_pdb.py] (click to expand)
Error messages
$ python -Wd -Xdev -Xtracemalloc test_pdb.py
Your environment