Skip to content

SystemError: <built-in function remote_exec> returned a result with an exception set #137293

@godlygeek

Description

@godlygeek

Bug report

Bug description:

While testing with sys.remote_exec today I got this error:

OSError: Cannot open ELF file '/home/godlygeek/repos/memray/src/memray/_memray.cpython-314-x86_64-linux-gnu.so (deleted)' for section 'PyRuntime' search: No such file or directory

The above exception was the direct cause of the following exception:
...
SystemError: <built-in function remote_exec> returned a result with an exception set

The root cause is that sys.remote_exec can return a result with an exception set if it fails to open one or more mapped files while searching for the mapping that contains PyRuntime, but eventually successfully reads the file that does contain PyRuntime.

We either need to stop setting exceptions inside search_linux_map_for_section entirely, or print and clear them with PyErr_Print before continuing on with the search.

I'll contribute a fix tomorrow unless someone beats me to it.

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixes3.15new features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions