microsoft / microsoft/vscode-cpptools

Cannot input password when attaching to process with GDB

Open
#10,576 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger Feature Request
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: Ubuntu 20.04 LTS
  • VS Code: 1.72.2
  • C/C++ extension: 1.14.3
  • GDB / LLDB version: 9.2
Bug Summary and Steps to Reproduce

Bug Summary:

Steps to reproduce:

  1. Run VS Code
  2. Try attaching to process with GDB
  3. Get YAMA ptrace prompt, select yes to input password
  4. Get new terminal prompt, rendering you unable to enter password
Debugger Configurations
"version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Attach Remote",
            "type": "cppdbg",
            "request": "attach",
            "program": "/path/to/my/executable",
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Set Disassembly Flavor to Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ]
        },
Debugger Logs
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/bin/gdb' as the super user
Authenticating as: root
Password: prompt>
Other Extensions
  • C/C++ extension pack: 1.3.0
Additional Information

More background info on this. My application disables ptrace hardening at runtime using a call to prctl, making me able to attach with regular CLI GDB from the command line, however, I want to use VS Code. I have already opened an issue in the MIDebugEngine, where the message comes from: https://github.com/microsoft/MIEngine/issues/1388.

Opening a bug issue here as well, as I was unable to input the password when prompted in the VS Code terminal. If this issue is external, please point me in the right direction. Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the debugger attach configuration and the linked MIEngine issue #1388, then reproduce the YAMA/polkit prompt on Ubuntu 20.04 using GDB 9.2. Trace how the VS Code terminal handles the authentication prompt; done means the password can be entered and the attach completes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.