python -m pdb -p fails when CONFIG_CROSS_MEMORY_ATTACH not set in kernel config #134876
Labels
3.14
bugs and security fixes
3.15
new features, bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
It's possible that a Linux kernel is built with the kernel config variable
CONFIG_CROSS_MEMORY_ATTACH
not set. (This is the case for the kernel that comes with Flatcar Container Linux and for CoreOS, the former of which is used for kubernetes nodes by the cloud provider we use).In this case, using
python -m pdb <some python PID>
fails and it looks like this:This is a single command to repro on such a system
Further relevant version info for the above repro output:
Diagnosis:
When
CONFIG_CROSS_MEMORY_ATTACH
is not set, the syscall handler forprocess_vm_readv
(and alsoprocess_vm_writev
) is not compiled into the kernel and so it returnsENOSYS
aserrno
.If it's ok, I'd also like to / be happy to offer a PR to fix.
Specifically I'd go with the approach that I discovered someone contributed to py-spy, of falling back to the
/proc/[pid]/mem
file in the proc filesystem. I could even open such a PR pretty soon.CPython versions tested on:
3.14, 3.15, CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: