]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-140815: Fix faulthandler for invalid/freed frame (#140921)
authorVictor Stinner <vstinner@python.org>
Tue, 4 Nov 2025 10:48:28 +0000 (11:48 +0100)
committerGitHub <noreply@github.com>
Tue, 4 Nov 2025 10:48:28 +0000 (11:48 +0100)
commita84181c31bfc45a1d6bcb1296bd298ad612c54d0
tree0eab5155297de9725661f151572d8b450e885ff8
parent08115d241a724a4769599993f654f77abcdebf5a
gh-140815: Fix faulthandler for invalid/freed frame (#140921)

faulthandler now detects if a frame or a code object is invalid or
freed.

Add helper functions:

* _PyCode_SafeAddr2Line()
* _PyFrame_SafeGetCode()
* _PyFrame_SafeGetLasti()

_PyMem_IsPtrFreed() now detects pointers in [-0xff, 0xff] range
as freed.
Include/internal/pycore_code.h
Include/internal/pycore_interpframe.h
Include/internal/pycore_pymem.h
Misc/NEWS.d/next/Library/2025-11-02-19-23-32.gh-issue-140815.McEG-T.rst [new file with mode: 0644]
Objects/codeobject.c
Python/traceback.c