cpython/Include
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
..
cpython [3.13] gh-139640: Fix swallowing syntax warnings in different modules (GH-139755) (GH-140119) 2025-10-14 15:46:11 +00:00
internal [3.13] gh-140815: Fix faulthandler for invalid/freed frame (#140921) (#140985) 2025-11-05 18:39:28 +01:00
abstract.h [3.13] gh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021) (#135134) 2025-06-04 17:10:51 +02:00
bltinmodule.h
boolobject.h [3.13] gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165) (#135182) 2025-06-05 15:02:09 +00:00
bytearrayobject.h
bytesobject.h
ceval.h gh-74929: Implement PEP 667 (GH-115153) 2024-05-04 12:12:10 +01:00
codecs.h
compile.h
complexobject.h
critical_section.h [3.13] gh-119344: Make critical section API public (GH-119353) (#120856) 2024-06-21 20:20:41 +00:00
datetime.h
descrobject.h
dictobject.h
dynamic_annotations.h
enumobject.h
errcode.h
exports.h
fileobject.h
fileutils.h
floatobject.h [3.13] gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) (GH-122012) 2024-07-19 09:13:08 +00:00
frameobject.h
genericaliasobject.h
import.h
intrcheck.h
iterobject.h
listobject.h
lock.h [3.13] gh-136759: revert rename lock.h to pylock.h (GH-137041) (#137075) (#137166) 2025-07-28 12:19:32 +00:00
longobject.h
marshal.h
memoryobject.h
methodobject.h
modsupport.h [3.13] gh-112136: Restore removed _PyArg_Parser (GH-121262) (#121344) 2024-07-03 18:29:00 +00:00
moduleobject.h gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645) 2024-05-06 18:59:36 +02:00
monitoring.h gh-111997: C-API for signalling monitoring events (#116413) 2024-05-04 08:23:50 +00:00
object.h [3.13] gh-140487: Fix Py_RETURN_NOTIMPLEMENTED in limited C API 3.11 (GH-140636) (GH-140670) 2025-10-27 14:43:59 +01:00
objimpl.h
opcode.h
opcode_ids.h GH-118095: Use broader specializations of CALL in tier 1, for better tier 2 support of calls. (GH-118322) 2024-05-04 12:11:11 +01:00
osdefs.h
osmodule.h
patchlevel.h Post 3.13.9 2025-10-14 20:35:49 +02:00
py_curses.h [3.13] bpo-44172: Keep reference to original window in curses subwindow objects (GH-26226) (GH-133370) 2025-05-04 11:15:43 +00:00
pyatomic.h
pybuffer.h
pycapsule.h
pydtrace.d
pydtrace.h
pyerrors.h [3.13] gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680, GH-120955) (GH-120944) 2024-06-24 20:23:30 +02:00
pyexpat.h [3.13] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-139234) (#139367) 2025-11-02 12:39:11 +00:00
pyframe.h
pyhash.h
pylifecycle.h
pymacconfig.h
pymacro.h [3.13] gh-127906: Fix Py_BUILD_ASSERT_EXPR() on Windows (#127994) 2024-12-16 17:17:01 +00:00
pymath.h [3.13] Revert "gh-136006: fix Py_NAN expansion on Solaris systems (GH-136575) (#138734)" (#139239) 2025-09-22 14:18:11 +00:00
pymem.h
pyport.h [3.13] gh-133256: Add _Py_NONSTRING macro (#133257) (#135135) 2025-06-04 17:10:35 +02:00
pystate.h
pystats.h
pystrcmp.h
pystrtod.h
Python.h [3.13] gh-136823: Update documentation on excluded headers in Python.h (GH-136824) (#137438) 2025-08-05 22:16:24 +01:00
pythonrun.h
pythread.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
pytypedefs.h
rangeobject.h
README.rst
setobject.h
sliceobject.h
structmember.h
structseq.h
sysmodule.h
traceback.h
tupleobject.h
typeslots.h
unicodeobject.h
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/