cpython/InternalDocs
Pablo Galindo Salgado 65fbec64f6
[3.15] gh-151613: Fix remote debugging frame cache ABA (#152448)
gh-151613: Fix remote debugging frame cache ABA (#151614)

The remote debugging frame cache previously used only the last_profiled_frame address as its cache anchor. If a frame returned and a later frame reused the same _PyInterpreterFrame address, the profiler could accept a stale cache entry and splice parent frames from a different call chain into the current stack.

This adds a last_profiled_frame_seq counter next to last_profiled_frame, increments it when the anchor advances, stores it in frame cache entries, and validates cache hits against both the frame address and the sequence. Cache miss walks now copy stack chunks before storing new cache entries so stored continuations come from a stable snapshot. The new regression test exercises alternating call chains and checks that cached stacks never contain frames from both branches.

(cherry picked from commit 8cda6ae2f1)
2026-06-27 17:42:31 +00:00
..
images gh-119786: Move garbage collection doc from devguide to InternalDocs (#125282) 2024-10-11 21:18:37 +01:00
asyncio.md fix some typos (#138977) 2025-09-16 18:33:39 +05:30
changing_grammar.md gh-119786: cleanup internal docs and fix internal links (#127485) 2024-12-01 17:12:22 +00:00
code_objects.md gh-134690: Removed deprecated codetype.co_lnotab (#134691) 2026-04-25 19:13:48 +03:00
compiler.md gh-138081: fix some dead links in InternalDocs (#138082) 2025-09-11 10:54:16 +02:00
exception_handling.md Improve format of InternalDocs/exception_handling.md (#134969) 2025-05-31 14:56:33 +03:00
frames.md [3.15] gh-151613: Fix remote debugging frame cache ABA (#152448) 2026-06-27 17:42:31 +00:00
garbage_collector.md GH-148726: Forward-port generational GC. (GH-148746) 2026-04-30 12:19:13 -07:00
generators.md gh-138081: fix some dead links in InternalDocs (#138082) 2025-09-11 10:54:16 +02:00
interpreter.md GH-139922: add interpreter types to InternalDocs/interpreter.md (GH-148035) 2026-04-05 23:25:14 +08:00
jit.md gh-139109: Document the trace recording interpreter in internaldocs (GH-146110) 2026-03-31 23:25:54 +08:00
parser.md gh-133560: Clarified parser.md doc for pegen parser issue in using the existing Grammar/python.gram file. (GH-139194) 2026-05-01 10:11:53 +02:00
profiling_binary_format.md gh-138122: Extend binary profiling format with full source location and opcode (#143088) 2025-12-24 16:15:11 +00:00
qsbr.md gh-119786: Add InternalDocs/qsbr.md. (gh-135411) 2025-06-23 22:09:40 +00:00
README.md Move doc on structure from devguide to InternalDocs (GH-142237) 2025-12-15 15:19:02 +01:00
stack_protection.md GH-139653: Only raise an exception (or fatal error) when the stack pointer is about to overflow the stack. (GH-141711) 2025-11-19 10:16:24 +00:00
stackrefs.md gh-142472: Clean-up _PyStackRef functions (gh-142479) 2025-12-15 12:03:49 -05:00
string_interning.md InternalDocs: Correct struct path for latin1 singletons in string_interning.md (GH-148358) 2026-04-13 11:45:41 +02:00
structure.md Move doc on structure from devguide to InternalDocs (GH-142237) 2025-12-15 15:19:02 +01:00

CPython Internals Documentation

The documentation in this folder is intended for CPython maintainers. It describes implementation details of CPython, which should not be assumed to be part of the Python language specification. These details can change between any two CPython versions and should not be assumed to hold for other implementations of the Python language.

The core dev team attempts to keep this documentation up to date. If it is not, please report that through the issue tracker.

General Resources

Compiling Python Source Code

Runtime Objects

Program Execution

Built-in Types

Modules