From e22778938db77949ec5a57fd871b16c539184757 Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Wed, 28 Oct 2026 18:37:41 +0100 Subject: [PATCH 1/2] up --- Modules/_remote_debugging/frames.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/_remote_debugging/frames.c b/Modules/_remote_debugging/frames.c index 5df309109fcfe3..da2d9f865e536f 100644 --- a/Modules/_remote_debugging/frames.c +++ b/Modules/_remote_debugging/frames.c @@ -36,7 +36,7 @@ process_single_stack_chunk( return -1; } - if (_Py_RemoteDebug_PagedReadRemoteMemory(&unwinder->handle, chunk_addr, current_size, this_chunk) < 0) { + if (_Py_RemoteDebug_ReadRemoteMemory(&unwinder->handle, chunk_addr, current_size, this_chunk) < 0) { PyMem_RawFree(this_chunk); set_exception_cause(unwinder, PyExc_RuntimeError, "Failed to read stack chunk"); return -1; @@ -65,7 +65,7 @@ process_single_stack_chunk( } this_chunk = tmp; - if (_Py_RemoteDebug_PagedReadRemoteMemory(&unwinder->handle, chunk_addr, actual_size, this_chunk) < 0) { + if (_Py_RemoteDebug_ReadRemoteMemory(&unwinder->handle, chunk_addr, actual_size, this_chunk) < 0) { PyMem_RawFree(this_chunk); set_exception_cause(unwinder, PyExc_RuntimeError, "Failed to reread stack chunk with correct size"); return -1; From 14680c15b94eac5aa7c88ac4d32bab3f7064ca8a Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Wed, 18 Nov 2026 12:19:02 +0000 Subject: [PATCH 2/2] gh-149584: Add NEWS for direct stack chunk reads --- .../Library/2026-11-18-12-18-53.gh-issue-149584.rDchNk.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2026-11-18-12-18-53.gh-issue-149584.rDchNk.rst diff --git a/Misc/NEWS.d/next/Library/2026-11-18-12-18-53.gh-issue-149584.rDchNk.rst b/Misc/NEWS.d/next/Library/2026-11-18-12-18-53.gh-issue-149584.rDchNk.rst new file mode 100644 index 00000000000000..2d0e9d203cf6b3 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-11-18-12-18-53.gh-issue-149584.rDchNk.rst @@ -0,0 +1,3 @@ +Read stack chunks directly in :mod:`profiling.sampling`, without the page +cache. This removes a redundant retry on macOS that can read a replacement +chunk after the target process reuses the same address.