Commit Graph
19 Commits
Author SHA1 Message Date
Miss Islington (bot)andノウラ | Flare 373bc1abdf [3.14] gh-157549: Use sysconf() for the page size in remote_debug.h (GH-157800) (#157814)
gh-157549: Use sysconf() for the page size in remote_debug.h (GH-157800)

getpagesize() is not an ISO C or POSIX function. Darwin hides the prototype under -std=c11, so the _remote_debugging build fails with -Werror=implicit-function-declaration. That is the failure in the reported x86_64-apple-darwin → arm64-apple-darwin cross build.

Call sysconf(_SC_PAGESIZE) instead, which is already how resource.getpagesize() works. Fall back to 4096 if sysconf() fails.

--without-remote-debug is unchanged. That flag only disables the target-side attach protocol (Py_REMOTE_DEBUG); it does not exclude the _remote_debugging client module.
(cherry picked from commit 9193375382)

Co-authored-by: ノウラ | Flare <nouraellm@gmail.com>
2026-09-19 16:45:19 +00:00
Pablo Galindo Salgado 04735deeb2 [3.14] gh-149619: Harden _remote_debugging error paths (GH-150349) (#154844)
(cherry picked from commit a5be25d3bd)
2026-07-28 23:46:43 +01:00
Pablo Galindo Salgadoandivonastojanovic c533f180e0 [3.14] gh-149619: Fix _remote_debugging permissions error on Linux (GH-150012) (#154825)
When running profiling on Linux without sudo, attempts to read
process memory would fail with the misleading error 'Failed to find
the PyRuntime section in process <pid> on Linux platform'.

The actual issue is a permissions error because profiling was not
run with sudo. We were clearing the exception on Linux when trying
to read memory, instead, we should bubble up the permissions error
and show it properly.

(cherry picked from commit 0563890872)

Co-authored-by: ivonastojanovic <80911834+ivonastojanovic@users.noreply.github.com>
2026-07-28 22:53:39 +01:00
Łukasz Langa 9a9bceb953 [3.14] gh-151029: Fix sys.remote_exec() unable to find writable memory when libpython replaced on disk (GH-151032) (#152464) 2026-06-28 16:43:14 +02:00
Miss Islington (bot)andUxío García Andrade 3f8c485660 [3.14] gh-137293: Ignore Exceptions when searching ELF File in Remote Debug (GH-137309) (#149391)
gh-137293: Ignore Exceptions when searching ELF File in Remote Debug (GH-137309)
(cherry picked from commit 2995d45659)

Co-authored-by: Uxío García Andrade <uxiog21@gmail.com>
2026-05-05 01:15:33 +00:00
Pablo Galindo Salgado ded533b1fa [3.14] gh-144316: Fix missing exception in _remote_debugging with debug=False (GH-144442) (#145280) 2026-02-26 22:39:48 +00:00
Bartosz Sławecki 616e611844 [3.14] gh-144563: Fix remote debugging with duplicate libpython mappings from ctypes (GH-144595) (#144655) 2026-02-10 14:31:49 +00:00
Miss Islington (bot)andVictor Stinner 8e496013b2 [3.14] gh-142627: Ignore anonymous mappings in Linux remote debugging (GH-142628) (#142630)
gh-142627: Ignore anonymous mappings in Linux remote debugging (GH-142628)
(cherry picked from commit e0bca091a4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-12-12 13:38:09 +00:00
Miss Islington (bot)andPablo Galindo Salgado 9a79c5128f [3.14] gh-91048: Revert the memory cache removal for remote debugging (GH-136440) (#136443)
gh-91048: Revert the memory cache removal for remote debugging (GH-136440)
(cherry picked from commit 77d25e5b16)


gh-91048: Reintroduce the memory cache for remote debugging

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-07-09 02:21:56 +01:00
Pablo Galindo Salgado c66b54f361 [3.14] gh-91048: Fix external inspection multi-threaded performance (GH-136005) (#136080)
(cherry picked from commit 5334732f9c)
2025-06-28 19:12:54 +01:00
Miss Islington (bot)andChris Eibl 84c6fe6ac6 [3.14] Fix warnings set but not used [-Wunused-but-set-variable] in remote_debug.h (GH-135290) (#135319)
Fix warnings `set but not used [-Wunused-but-set-variable]` in remote_debug.h (GH-135290)
(cherry picked from commit 49fc1f215a)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-06-10 00:29:28 +00:00
Miss Islington (bot)andZanie Blue 79c86b118c [3.14] Fix definition of _Py_RemoteDebug_ symbols for static linking (GH-135146) (#135318)
Fix definition of `_Py_RemoteDebug_` symbols for static linking (GH-135146)
(cherry picked from commit 2e1ad6eb26)

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-06-10 00:28:42 +00:00
Miss Islington (bot)andDaniel Golding ef539654e6 [3.14] gh-134876: Add fallback for when process_vm_readv fails with ENOSYS (GH-134878) (#135240)
gh-134876: Add fallback for when process_vm_readv fails with ENOSYS (GH-134878)
(cherry picked from commit ac9c3431cc)

Co-authored-by: Daniel Golding <goldingd89@gmail.com>
2025-06-07 18:56:38 +00:00
Miss Islington (bot) aded785b8c [3.14] gh-91048: Add better error messages for remote debugging for CI builds (GH-134682) (#134719) 2025-05-26 15:04:36 +00:00
Miss Islington (bot)andRussell Keith-Magee 6c917cb11c [3.14] gh-91048: Correct Apple platform includes for iOS. (GH-134712) (#134714)
Correct Apple platform includes for iOS.
(cherry picked from commit 965662ee4a)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-05-26 13:10:37 +00:00
Pablo Galindo SalgadoandŁukasz Langa 1822f33b1a [3.14] gh-91048: Refactor and optimize remote debugging module (#134652) (#134673)
gh-91048: Refactor and optimize remote debugging module (#134652)

Completely refactor Modules/_remote_debugging_module.c with improved
code organization, replacing scattered reference counting and error
handling with centralized goto error paths. This cleanup improves
maintainability and reduces code duplication throughout the module while
preserving the same external API.

Implement memory page caching optimization in Python/remote_debug.h to
avoid repeated reads of the same memory regions during debugging
operations. The cache stores previously read memory pages and reuses
them for subsequent reads, significantly reducing system calls and
improving performance.

Add code object caching mechanism with a new code_object_generation
field in the interpreter state that tracks when code object caches need
invalidation. This allows efficient reuse of parsed code object metadata
and eliminates redundant processing of the same code objects across
debugging sessions.

Optimize memory operations by replacing multiple individual structure
copies with single bulk reads for the same data structures. This reduces
the number of memory operations and system calls required to gather
debugging information from the target process.

Update Makefile.pre.in to include Python/remote_debug.h in the headers
list, ensuring that changes to the remote debugging header force proper
recompilation of dependent modules and maintain build consistency across
the codebase.

Also, make the module compatible with the free threading build as an extra :)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>

(cherry picked from commit 42b25ad4d3)
2025-05-25 22:10:20 +00:00
Sergey Miryanov bd2ed7c7ce gh-91048: Chain some exceptions in _testexternalinspection.c (#132970) 2025-05-03 01:35:30 +02:00
Victor Stinner 17718b0503 gh-91048: Fix _testexternalinspection.c on FreeBSD (#132945) 2025-04-25 14:57:01 +00:00
Pablo Galindo Salgado e8cf3a1a64 gh-91048: Refactor _testexternalinspection and add Windows support (#132852) 2025-04-25 14:12:16 +01:00