cpython/Include
Miss Islington (bot) 331b4b868c
[3.14] gh-140815: Fix faulthandler for invalid/freed frame (GH-140921) (#140981)
gh-140815: Fix faulthandler for invalid/freed frame (GH-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)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-04 11:18:23 +00:00
..
cpython [3.14] gh-139640: Fix swallowing syntax warnings in different modules (GH-139755) (GH-140117) 2025-10-14 15:56:01 +00:00
internal [3.14] gh-140815: Fix faulthandler for invalid/freed frame (GH-140921) (#140981) 2025-11-04 11:18:23 +00:00
abstract.h [3.14] gh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021) (#135133) 2025-06-04 13:33:20 +00:00
audit.h [3.14] gh-135755: Use private names (_Py*) for header file guards new in 3.14 (GH-135921) (GH-135976) 2025-07-01 12:37:02 +02:00
bltinmodule.h
boolobject.h [3.14] gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165) (#135178) 2025-06-05 15:35:54 +02:00
bytearrayobject.h
bytesobject.h
ceval.h [3.14] gh-135755: Move SPECIAL_ constants to a private header (GH-135922) (GH-135926) 2025-06-25 13:36:46 +02:00
codecs.h
compile.h
complexobject.h
critical_section.h
datetime.h
descrobject.h
dictobject.h
dynamic_annotations.h
enumobject.h
errcode.h
exports.h
fileobject.h
fileutils.h
floatobject.h
frameobject.h
genericaliasobject.h
import.h
intrcheck.h
iterobject.h
listobject.h
lock.h
longobject.h gh-132639: Adds PyLong_AsNativeBytes, PyLong_FromNativeBytes and PyLong_FromUnsignedNativeBytes to the limited API (GH-132640) 2025-04-21 15:59:03 +01:00
marshal.h
memoryobject.h
methodobject.h gh-132097: use a macro for semantically casting function pointers (#132406) 2025-04-18 12:24:34 +02:00
modsupport.h
moduleobject.h
monitoring.h
object.h [3.14] gh-140487: Fix Py_RETURN_NOTIMPLEMENTED in limited C API 3.11 (GH-140636) (#140668) 2025-10-27 14:15:49 +01:00
objimpl.h
opcode.h gh-100239: replace BINARY_SUBSCR & family by BINARY_OP with oparg NB_SUBSCR (#129700) 2025-02-07 22:39:54 +00:00
opcode_ids.h gh-100239: specialize BINARY_OP/SUBSCR for list-slice (#132626) 2025-05-01 10:28:52 +00:00
osdefs.h
osmodule.h
patchlevel.h Post 3.14.0 2025-10-07 17:15:20 +03:00
py_curses.h bpo-44172: Keep reference to original window in curses subwindow objects (GH-26226) 2025-05-04 13:29:44 +03:00
pyatomic.h
pybuffer.h
pycapsule.h
pydtrace.d
pydtrace.h
pyerrors.h
pyexpat.h [3.14] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-139234) (#139359) 2025-11-02 09:33:36 +00:00
pyframe.h
pyhash.h
pylifecycle.h
pymacconfig.h
pymacro.h gh-128972: Add _Py_ALIGN_AS and revert PyASCIIObject memory layout. (GH-133085) 2025-05-02 18:30:40 +02:00
pymath.h
pymem.h
pyport.h [3.14] gh-137058: Sync _Py_NULL macro with the main branch (#137409) 2025-10-07 18:41:45 +02:00
pystate.h
pystats.h
pystrcmp.h
pystrtod.h
Python.h [3.14] gh-136823: Update documentation on excluded headers in Python.h (GH-136824) (#137437) 2025-10-07 23:23:33 +05:30
pythonrun.h [3.14] gh-130396: Move PYOS_LOG2_STACK_MARGIN to internal headers (GH-135928) (#136173) 2025-07-01 13:44:32 +00:00
pythread.h
pytypedefs.h
rangeobject.h
README.rst
refcount.h [3.14] gh-140153: Fix Py_REFCNT() definition on limited C API 3.11-3.13 (GH-140158) (#140164) 2025-10-15 15:02:03 +00:00
setobject.h
sliceobject.h
structmember.h
structseq.h
sysmodule.h
traceback.h
tupleobject.h
typeslots.h Revert "gh-133395: add option for extension modules to specialize BINARY_OP/SUBSCR, apply to arrays (#133396)" (#133498) 2025-05-06 13:12:26 +03:00
unicodeobject.h gh-132798: Schedule removal of PyUnicode_AsDecoded/Encoded functions for 3.15 (#132799) 2025-04-25 15:07:41 +02:00
warnings.h
weakrefobject.h

The Python C API
================

The C API is divided into these sections:

1. ``Include/``: Limited API
2. ``Include/cpython/``: CPython implementation details
3. ``Include/cpython/``, names with the ``PyUnstable_`` prefix: API that can
   change between minor releases
4. ``Include/internal/``, and any name with ``_`` prefix: The internal API

Information on changing the C API is available `in the developer guide`_

.. _in the developer guide: https://devguide.python.org/c-api/