Skip to content

[3.14] gh-149619: Fix _remote_debugging permissions error on Linux (GH-150012) - #154825

Merged
pablogsal merged 1 commit into
python:3.14from
pablogsal:backport-0563890-3.14
Jul 28, 2026
Merged

[3.14] gh-149619: Fix _remote_debugging permissions error on Linux (GH-150012)#154825
pablogsal merged 1 commit into
python:3.14from
pablogsal:backport-0563890-3.14

Conversation

@pablogsal

@pablogsal pablogsal commented Jul 28, 2026

Copy link
Copy Markdown
Member

Backport of GH-150012 to Python 3.14.

This preserves PermissionError when runtime-cookie validation fails and prevents the Linux runtime lookup from replacing it with a misleading RuntimeError. Python 3.14 already contains the overlapping map-search propagation from GH-151032, so this backport includes only the two remaining required changes.

Without this fix, process_vm_readv() returning EPERM is reported as “Failed to find the PyRuntime section” instead of the actual permissions error.

(cherry picked from commit 0563890)

…Linux (pythonGH-150012)

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 0563890)
Co-authored-by: ivonastojanovic <80911834+ivonastojanovic@users.noreply.github.com>
@pablogsal
pablogsal marked this pull request as ready for review July 28, 2026 20:31
@pablogsal
pablogsal merged commit c533f18 into python:3.14 Jul 28, 2026
50 checks passed
@pablogsal
pablogsal deleted the backport-0563890-3.14 branch July 28, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants