Repository navigation
remote debugging: read_pylong is missing a PyErr_Format call #148447
Copy link
Copy link
Closed as duplicate
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtopic-profilingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Apr 12, 2026 - changed the title
[-]remote-debugging: `read_pylong` is missing a `PyErr_Format` call[/-][+]remote- debugging: `read_pylong` is missing a `PyErr_Format` call[/+]on Apr 12, 2026 - changed the title
[-]remote- debugging: `read_pylong` is missing a `PyErr_Format` call[/-][+]remote debugging: `read_pylong` is missing a `PyErr_Format` call[/+]on Apr 12, 2026 - addedinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
on Apr 12, 2026 Looks like this was already fixed in #146309, the relevant call is present in main:
cpython/Modules/_remote_debugging/object_reading.c
Lines 197 to 204 in 03d2f03
// Validate size: reject garbage (negative or unreasonably large) if (size < 0 || size > MAX_LONG_DIGITS) { PyErr_Format(PyExc_RuntimeError, "Invalid PyLong digit count: %zd (expected 0-%d)", size, MAX_LONG_DIGITS); set_exception_cause(unwinder, PyExc_RuntimeError, "Invalid PyLong size (corrupted remote memory)"); return -1; } - addedpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
on Apr 12, 2026 Ah! My main was outdated then, sorry for the false alarm. Closing.
Reacted by Brian Schubert
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtopic-profilingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
Bug description:
I'm working on the Python Profiler at Datadog and while looking at how Tachyon is implemented, I noticed that I believe this error path is missing a call to
PyErr_Format. This probably rarely happens (it would require the process to read corrupt memory) but I still think it's worth fixing.I have a branch that adds the call if you're OK with adding it.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS