cpython/Python
Victor Stinner 43882c7c4e
[3.13] gh-140815: Fix faulthandler for invalid/freed frame (#140921) (#140985)
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.

(cherry picked from commit a84181c31b)
2025-11-05 18:39:28 +01:00
..
clinic [3.13] gh-139748: fix leaks in AC error paths when using unicode FS-b… (#139792) 2025-10-08 22:21:49 +05:30
frozen_modules
_warnings.c [3.13] gh-139640: Fix swallowing syntax warnings in different modules (GH-139755) (GH-140119) 2025-10-14 15:46:11 +00:00
adaptive.md
asdl.c
asm_trampoline.S [3.13] gh-136541: Fix several problems of perf trampolines in x86_64 and aarch64 (GH-136500) (#136545) 2025-07-11 14:02:19 +00:00
assemble.c [3.13] gh-130775: Allow negative locations in ast (GH-130795) (#132243) 2025-04-08 10:47:24 +02:00
ast.c
ast_opt.c
ast_unparse.c
bltinmodule.c [3.13] gh-139748: fix leaks in AC error paths when using unicode FS-b… (#139792) 2025-10-08 22:21:49 +05:30
bootstrap_hash.c
brc.c
bytecodes.c [3.13] gh-137400: Fix thread-safety issues when profiling all threads (gh-137518) (gh-137733) 2025-10-09 11:42:47 -04:00
ceval.c [3.13] gh-137400: Fix thread-safety issues when profiling all threads (gh-137518) (gh-137733) 2025-10-09 11:42:47 -04:00
ceval_gil.c [3.13] gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805) (GH-137827) 2025-08-17 09:08:14 -07:00
ceval_macros.h
codecs.c [3.13] gh-58124: Avoid CP_UTF8 in UnicodeDecodeError (GH-137415) (#137461) 2025-08-06 12:59:11 +00:00
compile.c [3.13] gh-139640: Fix swallowing syntax warnings in different modules (GH-139755) (GH-140119) 2025-10-14 15:46:11 +00:00
condvar.h
config_common.h
context.c
critical_section.c
crossinterp.c [3.13] gh-140306: Fix memory leaks in cross-interpreter data handling (GH-140307) (GH-140357) 2025-10-20 10:13:15 +00:00
crossinterp_data_lookup.h
crossinterp_exceptions.h
dtoa.c
dup2.c
dynamic_annotations.c
dynload_hpux.c
dynload_shlib.c
dynload_stub.c
dynload_win.c
emscripten_signal.c
emscripten_trampoline.c
errors.c
executor_cases.c.h [3.13] gh-132744: Check recursion limit in _PY_FRAME_GENERAL (GH-132746) (GH-138032) 2025-08-22 20:25:24 +08:00
fileutils.c [3.13] gh-124476: Fix decoding from the locale encoding in the C.UTF-8 locale (GH-132477) (ПР-132528) 2025-04-14 18:59:07 +00:00
flowgraph.c
formatter_unicode.c
frame.c
frozen.c
frozenmain.c
future.c
gc.c
gc_free_threading.c
gc_gil.c
generated_cases.c.h [3.13] gh-137400: Fix thread-safety issues when profiling all threads (gh-137518) (gh-137733) 2025-10-09 11:42:47 -04:00
getargs.c
getcompiler.c
getcopyright.c
getopt.c
getplatform.c
getversion.c
hamt.c [3.13] gh-137440: Update comment in Python/hamt.c on importing for testing (GH-137441) (GH-137520) 2025-08-07 16:54:52 +00:00
hashtable.c
import.c [3.13] gh-134100: Fix use-after-free in PyImport_ImportModuleLevelObject (GH-134117) (#134172) 2025-05-18 20:38:28 +05:30
importdl.c
initconfig.c
instruction_sequence.c
instrumentation.c [3.13] gh-137400: Fix thread-safety issues when profiling all threads (gh-137518) (gh-137733) 2025-10-09 11:42:47 -04:00
interpconfig.c
intrinsics.c
jit.c
legacy_tracing.c [3.13] gh-137400: Fix thread-safety issues when profiling all threads (gh-137518) (gh-137733) 2025-10-09 11:42:47 -04:00
lock.c [3.13] gh-135871: Fix needless spinning in _PyMutex_LockTimed with zero timeout (gh-135872) (gh-135947) 2025-06-25 17:09:17 +00:00
marshal.c
modsupport.c [3.13] gh-132909: handle overflow for 'K' format in do_mkvalue (GH-132911) (#132932) 2025-04-25 12:44:53 +00:00
mysnprintf.c
mystrtoul.c
object_stack.c
opcode_targets.h
optimizer.c
optimizer_analysis.c
optimizer_bytecodes.c
optimizer_cases.c.h [3.13] gh-132744: Check recursion limit in _PY_FRAME_GENERAL (GH-132746) (GH-138032) 2025-08-22 20:25:24 +08:00
optimizer_symbols.c
parking_lot.c
pathconfig.c
perf_jit_trampoline.c [3.13] gh-136541: Fix several problems of perf trampolines in x86_64 and aarch64 (GH-136500) (#136545) 2025-07-11 14:02:19 +00:00
perf_trampoline.c [3.13] gh-136541: Fix several problems of perf trampolines in x86_64 and aarch64 (GH-136500) (#136545) 2025-07-11 14:02:19 +00:00
preconfig.c
pyarena.c
pyctype.c
pyfpe.c
pyhash.c
pylifecycle.c [3.13] gh-112729: Correctly fail when the process is out of memory during interpreter creation (GH-139164) (GH-139169) 2025-09-19 15:09:44 +00:00
pymath.c
pystate.c [3.13] gh-140301: Fix memory leak in subinterpreter PyConfig cleanup (GH-140303) (#140684) 2025-10-27 19:42:13 +00:00
pystrcmp.c
pystrhex.c
pystrtod.c
Python-ast.c [3.13] gh-140471: Fix buffer overflow in AST node initialization with malformed _fields (GH-140506) (#140510) 2025-10-24 00:38:02 +01:00
Python-tokenize.c
pythonrun.c [3.13] gh-137576: Fix for Basic REPL showing incorrect code in tracebacks with PYTHONSTARTUP (GH-137625) (#137778) 2025-08-15 12:10:39 +03:00
pytime.c
qsbr.c [3.13] GH-133136: Revise QSBR to reduce excess memory held (gh-135473) (gh-136480) 2025-07-30 11:06:44 -07:00
README
specialize.c
stdlib_module_names.h
structmember.c
suggestions.c
symtable.c
sysmodule.c [3.13] gh-137400: Fix thread-safety issues when profiling all threads (gh-137518) (gh-137733) 2025-10-09 11:42:47 -04:00
thread.c
thread_nt.h [3.13] gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805) (GH-137827) 2025-08-17 09:08:14 -07:00
thread_pthread.h [3.13] gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805) (GH-137827) 2025-08-17 09:08:14 -07:00
thread_pthread_stubs.h
tier2_engine.md
traceback.c [3.13] gh-140815: Fix faulthandler for invalid/freed frame (#140921) (#140985) 2025-11-05 18:39:28 +01:00
tracemalloc.c
vm-state.md

Miscellaneous source files for the main Python shared library