public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26291] New: `find` is halted upon stumbling upon inaccessible memory region
@ 2020-07-23 10:12 hi-angel at yandex dot ru
  2020-07-23 14:29 ` [Bug gdb/26291] " tromey at sourceware dot org
  0 siblings, 1 reply; 2+ messages in thread
From: hi-angel at yandex dot ru @ 2020-07-23 10:12 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26291

            Bug ID: 26291
           Summary: `find` is halted upon stumbling upon inaccessible
                    memory region
           Product: gdb
           Version: 9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: hi-angel at yandex dot ru
  Target Milestone: ---

Trying to search in process memory may result in search getting halted because
gdb stumble upon an inaccessible memory region.

Apparently, the workaround is for a user to manually find all such regions and
try to skip them. However not only it is tedious, the `find` gdb command
doesn't even provide means for skipping memory addresses.

So it looks like an omission in the `find` command, it would be great if search
was not getting halted because an inaccessible region was found, but instead
the region would simply be skipped.

# Steps to reproduce (in terms of terminal commands)

    $ gdb ls
    Reading symbols from ls...
    (No debugging symbols found in ls)
    gdb λ br write
    Function "write" not defined.
    Make breakpoint pending on future shared library load? (y or [n]) y
    Breakpoint 1 (write) pending.
    gdb λ r
    Starting program: /usr/bin/ls

    Breakpoint 1, 0x00007ffff7e77b40 in write () from /usr/lib/libc.so.6
    gdb λ i proc map
    process 23816
    Mapped address spaces:

              Start Addr           End Addr       Size     Offset objfile
          0x555555554000     0x555555558000     0x4000        0x0 /usr/bin/ls
          0x555555558000     0x55555556c000    0x14000     0x4000 /usr/bin/ls
          0x55555556c000     0x555555575000     0x9000    0x18000 /usr/bin/ls
          0x555555575000     0x555555577000     0x2000    0x20000 /usr/bin/ls
          0x555555577000     0x555555578000     0x1000    0x22000 /usr/bin/ls
          0x555555578000     0x55555559a000    0x22000        0x0 [heap]
          0x7ffff7a9d000     0x7ffff7d84000   0x2e7000        0x0
/usr/lib/locale/locale-archive
          0x7ffff7d84000     0x7ffff7d87000     0x3000        0x0
          0x7ffff7d87000     0x7ffff7dac000    0x25000        0x0
/usr/lib/libc-2.31.so
          0x7ffff7dac000     0x7ffff7ef9000   0x14d000    0x25000
/usr/lib/libc-2.31.so
          0x7ffff7ef9000     0x7ffff7f43000    0x4a000   0x172000
/usr/lib/libc-2.31.so
          0x7ffff7f43000     0x7ffff7f44000     0x1000   0x1bc000
/usr/lib/libc-2.31.so
          0x7ffff7f44000     0x7ffff7f47000     0x3000   0x1bc000
/usr/lib/libc-2.31.so
          0x7ffff7f47000     0x7ffff7f4a000     0x3000   0x1bf000
/usr/lib/libc-2.31.so
          0x7ffff7f4a000     0x7ffff7f4e000     0x4000        0x0
          0x7ffff7f4e000     0x7ffff7f50000     0x2000        0x0
/usr/lib/libcap.so.2.37
          0x7ffff7f50000     0x7ffff7f54000     0x4000     0x2000
/usr/lib/libcap.so.2.37
          0x7ffff7f54000     0x7ffff7f56000     0x2000     0x6000
/usr/lib/libcap.so.2.37
          0x7ffff7f56000     0x7ffff7f57000     0x1000     0x7000
/usr/lib/libcap.so.2.37
          0x7ffff7f57000     0x7ffff7f58000     0x1000     0x8000
/usr/lib/libcap.so.2.37
          0x7ffff7f58000     0x7ffff7f5a000     0x2000        0x0
          0x7ffff7fcb000     0x7ffff7fcf000     0x4000        0x0 [vvar]
          0x7ffff7fcf000     0x7ffff7fd1000     0x2000        0x0 [vdso]
          0x7ffff7fd1000     0x7ffff7fd3000     0x2000        0x0
/usr/lib/ld-2.31.so
          0x7ffff7fd3000     0x7ffff7ff3000    0x20000     0x2000
/usr/lib/ld-2.31.so
          0x7ffff7ff3000     0x7ffff7ffb000     0x8000    0x22000
/usr/lib/ld-2.31.so
          0x7ffff7ffc000     0x7ffff7ffd000     0x1000    0x2a000
/usr/lib/ld-2.31.so
          0x7ffff7ffd000     0x7ffff7ffe000     0x1000    0x2b000
/usr/lib/ld-2.31.so
          0x7ffff7ffe000     0x7ffff7fff000     0x1000        0x0
          0x7ffffffde000     0x7ffffffff000    0x21000        0x0 [stack]
      0xffffffffff600000 0xffffffffff601000     0x1000        0x0 [vsyscall]
    gdb λ find 0x555555554000, 0x7ffffffff000, "foo"
    warning: Unable to access 16000 bytes of target memory at 0x555555596683,
halting search.
    Pattern not found.

## Expected

Search is not halted upon stumbling upon inaccessible region, instead it is
simply skipped.

## Actual

Search is halted.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug gdb/26291] `find` is halted upon stumbling upon inaccessible memory region
  2020-07-23 10:12 [Bug gdb/26291] New: `find` is halted upon stumbling upon inaccessible memory region hi-angel at yandex dot ru
@ 2020-07-23 14:29 ` tromey at sourceware dot org
  0 siblings, 0 replies; 2+ messages in thread
From: tromey at sourceware dot org @ 2020-07-23 14:29 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26291

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |tromey at sourceware dot org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-07-23

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Makes sense to me, especially because gdb has the
"set mem inaccessible-by-default" setting, so it presumably
often knows something about the memory map.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-23 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23 10:12 [Bug gdb/26291] New: `find` is halted upon stumbling upon inaccessible memory region hi-angel at yandex dot ru
2020-07-23 14:29 ` [Bug gdb/26291] " tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).