Skip to content

remote debugging: read_pylong is missing a PyErr_Format call #148447

Description

@KowalskiThomas

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

Activity

  1. 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
  2. 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
  3. brianschubert commented on Apr 12, 2026

    @brianschubert
    Contributor

    Looks like this was already fixed in #146309, the relevant call is present in main:

    // 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;
    }

  4. added
    pendingThe issue will be closed if no feedback is provided
    on Apr 12, 2026
  5. KowalskiThomas commented on Apr 12, 2026

    @KowalskiThomas
    ContributorAuthor

    Ah! My main was outdated then, sorry for the false alarm. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedtopic-profilingtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions