[Bug breakpoints/34381] New: Emit an error message when CONFIG_PROC_MEM_NO_FORCE=y causes attach failure

sam at gentoo dot org via Gdb-prs <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34381

            Bug ID: 34381
           Summary: Emit an error message when CONFIG_PROC_MEM_NO_FORCE=y
                    causes attach failure
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: sam at gentoo dot org
                CC: aburgess at redhat dot com, adrian.ratiu at collabora dot com
  Target Milestone: ---

For PR31520, 5b582f86bd7a6ece68f4a979c40faeffde9eec5e added an improved error
message where kernel.yama.ptrace_scope=0.

A little while ago, the kernel added [0] a build-time config option
(CONFIG_PROC_MEM_NO_FORCE=y) which manifests in a similar but worse way:

(gdb) break main
Breakpoint 1 at 0x4b59a: file ..., line 9.
(gdb) run
Starting program: ...
❌️ Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x55555559f59a

In this case, gdb successfully attaches (or it doesn't emit any error about
that at least), just it can't actually do anything useful. It's caught a few
people out (e.g. https://forums.gentoo.org/viewtopic-p-8846891.html).

Is it possible to detect this case too?

[0] 41e8149c8892ed1962bd15350b3c3e6e90cba7f4 in linux.git

-- 
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.