Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Unfriendly traceback when using remote pdb to attach to a non-existing process #139940

Copy link
Copy link
@frostming

Description

@frostming
Issue body actions

Bug report

Bug description:

Run the following command on Linux:

sudo ./python -m pdb -p 5555

produces:

OSError: Cannot open process memory map file '/proc/5555/maps' for PID 5555 section search: No such file or directory

During handling of the above exception, another exception occurred:

RuntimeError: Failed to find the PyRuntime section in process 5555 on Linux platform

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/frost/workspace/cpython/Lib/runpy.py", line 198, in _run_module_as_main
    return _run_code(code, main_globals, None,
                     "__main__", mod_spec)
  File "/home/frost/workspace/cpython/Lib/runpy.py", line 88, in _run_code
    exec(code, run_globals)
    ~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/frost/workspace/cpython/Lib/pdb.py", line 3650, in <module>
    pdb.main()
    ~~~~~~~~^^
  File "/home/frost/workspace/cpython/Lib/pdb.py", line 3579, in main
    attach(opts.pid, opts.commands)
    ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frost/workspace/cpython/Lib/pdb.py", line 3448, in attach
    sys.remote_exec(pid, connect_script.name)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: PyRuntime address lookup failed during debug offsets initialization

While ./python -m asyncio ps 5555 produces:

Error retrieving tasks: Cannot open process memory map file '/proc/5555/maps' for PID 5555 section search: No such file or directory

The latter is clearer.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.