public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/26037] New: Linking with dynamicbase and high-entropy-va causes gdb to issue Cannot access memory when setting breakpoint
@ 2020-05-25  6:48 rick.maschmann at outlook dot com
  2020-09-08 19:47 ` [Bug breakpoints/26037] " sourceware-bugzilla at jdrake dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rick.maschmann at outlook dot com @ 2020-05-25  6:48 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26037
           Summary: Linking with dynamicbase and high-entropy-va causes
                    gdb to issue Cannot access memory when setting
                    breakpoint
           Product: gdb
           Version: 9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: rick.maschmann at outlook dot com
  Target Milestone: ---

OS: MINGW64_NT-10.0-18363 3.1.4-340.x86_64 2020-05-22 08:28 UTC x86_64 Msys

GCC: v10.1.0
GDB: v9.1 (This GDB was configured as "x86_64-w64-mingw32".)


Summary: After building a simple 'c' program using --dynamicbase and
--high-entropy-va, gdb errors with:

Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x401558

Repro steps:

1. save the following program as hw.c

#include <stdio.h>
int main() {
  printf("Hello World");
  return 0;
}

2. build with:

$ gcc hw.c -o hw1 -g -Wl,--dynamicbase -Wl,--high-entropy-va

3. debug session:

$ gdb hw1.exe
(gdb) break main
Breakpoint 1 at 0x40155d: file hw.c, line 3.
(gdb) run
Starting program: hw1.exe
[New Thread 17836.0x36b4]
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x401558

Command aborted.
(gdb) 

Build the program again without "-Wl,--dynamicbase -Wl,--high-entropy-va" and
gdb stops at the breakpoint without any issues.

Here's the full gcc info:

$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-10.1.0/configure --prefix=/mingw64
--with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include
--libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64
--with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string
--enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes
--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check
--enable-lto --enable-libgomp --disable-multilib --enable-checking=release
--disable-rpath --disable-win32-registry --disable-nls --disable-werror
--disable-symvers --disable-plugin --with-libiconv --with-system-zlib
--with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64
--with-isl=/mingw64 --with-pkgversion='Rev2, Built by MSYS2 project'
--with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as
--with-gnu-ld
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.1.0 (Rev2, Built by MSYS2 project)

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

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

* [Bug breakpoints/26037] Linking with dynamicbase and high-entropy-va causes gdb to issue Cannot access memory when setting breakpoint
  2020-05-25  6:48 [Bug breakpoints/26037] New: Linking with dynamicbase and high-entropy-va causes gdb to issue Cannot access memory when setting breakpoint rick.maschmann at outlook dot com
@ 2020-09-08 19:47 ` sourceware-bugzilla at jdrake dot com
  2020-09-08 19:48 ` sourceware-bugzilla at jdrake dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: sourceware-bugzilla at jdrake dot com @ 2020-09-08 19:47 UTC (permalink / raw)
  To: gdb-prs

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

sourceware-bugzilla at jdrake dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sourceware-bugzilla@jdrake.
                   |                            |com

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

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

* [Bug breakpoints/26037] Linking with dynamicbase and high-entropy-va causes gdb to issue Cannot access memory when setting breakpoint
  2020-05-25  6:48 [Bug breakpoints/26037] New: Linking with dynamicbase and high-entropy-va causes gdb to issue Cannot access memory when setting breakpoint rick.maschmann at outlook dot com
  2020-09-08 19:47 ` [Bug breakpoints/26037] " sourceware-bugzilla at jdrake dot com
@ 2020-09-08 19:48 ` sourceware-bugzilla at jdrake dot com
  2020-09-09 15:54 ` cbiesinger at google dot com
  2020-09-09 16:58 ` ssbssa at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: sourceware-bugzilla at jdrake dot com @ 2020-09-08 19:48 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from sourceware-bugzilla at jdrake dot com ---
This also makes backtraces pretty useless.  It seems that GDB expects the exe
to be loaded at its ImageBase.

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

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

* [Bug breakpoints/26037] Linking with dynamicbase and high-entropy-va causes gdb to issue Cannot access memory when setting breakpoint
  2020-05-25  6:48 [Bug breakpoints/26037] New: Linking with dynamicbase and high-entropy-va causes gdb to issue Cannot access memory when setting breakpoint rick.maschmann at outlook dot com
  2020-09-08 19:47 ` [Bug breakpoints/26037] " sourceware-bugzilla at jdrake dot com
  2020-09-08 19:48 ` sourceware-bugzilla at jdrake dot com
@ 2020-09-09 15:54 ` cbiesinger at google dot com
  2020-09-09 16:58 ` ssbssa at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cbiesinger at google dot com @ 2020-09-09 15:54 UTC (permalink / raw)
  To: gdb-prs

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

Christian Biesinger <cbiesinger at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cbiesinger at google dot com,
                   |                            |ssbssa at sourceware dot org

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

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

* [Bug breakpoints/26037] Linking with dynamicbase and high-entropy-va causes gdb to issue Cannot access memory when setting breakpoint
  2020-05-25  6:48 [Bug breakpoints/26037] New: Linking with dynamicbase and high-entropy-va causes gdb to issue Cannot access memory when setting breakpoint rick.maschmann at outlook dot com
                   ` (2 preceding siblings ...)
  2020-09-09 15:54 ` cbiesinger at google dot com
@ 2020-09-09 16:58 ` ssbssa at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: ssbssa at sourceware dot org @ 2020-09-09 16:58 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |10.1

--- Comment #2 from Hannes Domani <ssbssa at sourceware dot org> ---
(In reply to sourceware-bugzilla from comment #1)
> This also makes backtraces pretty useless.  It seems that GDB expects the
> exe to be loaded at its ImageBase.

Yes, it did.

But it's fixed for the upcoming gdb release with:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=584cf46d0ab5960cca76bfaf414cee5641166868

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

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

end of thread, other threads:[~2020-09-09 16:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25  6:48 [Bug breakpoints/26037] New: Linking with dynamicbase and high-entropy-va causes gdb to issue Cannot access memory when setting breakpoint rick.maschmann at outlook dot com
2020-09-08 19:47 ` [Bug breakpoints/26037] " sourceware-bugzilla at jdrake dot com
2020-09-08 19:48 ` sourceware-bugzilla at jdrake dot com
2020-09-09 15:54 ` cbiesinger at google dot com
2020-09-09 16:58 ` ssbssa 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).