[Bug dap/34482] New: Ptrace error during attach is not reported

"dmitry.neverov at jetbrains dot com via Gdb-prs" <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34482

            Bug ID: 34482
           Summary: Ptrace error during attach is not reported
           Product: gdb
           Version: 17.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: dap
          Assignee: unassigned at sourceware dot org
          Reporter: dmitry.neverov at jetbrains dot com
  Target Milestone: ---

To reproduce on Ubuntu:
- run echo 1 | sudo tee /proc/sys/kernel/yama/ptrace_scope
- attach to a running process with gdb

Gdb/mi reports the ptrace error:

  >24-target-attach 29838
  <24^error,msg="ptrace: Operation not permitted."
  <(gdb)

Gdb/dap logs the error but reports success:

  READ: <<<{"type": "request", "seq": 2, "command": "attach", "arguments":
{"pid": 30919}}>>>
  ...
  READ: <<<{"type": "request", "seq": 4, "command": "configurationDone",
"arguments": {}}>>>
  WROTE: <<<{"request_seq": 4, "type": "response", "command":
"configurationDone", "success": true}>>>
  +++ attach 30919
  Traceback (most recent call last):
    File
"/home/nd/.local/share/JetBrains/Toolbox/apps/clion/bin/gdb/linux/x64/share/gdb/python/gdb/dap/startup.py",
line 212, in exec_and_log
      output = gdb.execute(cmd, from_tty=True, to_string=True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  gdb.error: ptrace: Operation not permitted.
  WROTE: <<<{"request_seq": 2, "type": "response", "command": "attach",
"success": true}>>>

After that gdb/dap doesn't repond to other commands, like pause.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.