Discussion:
[Bug breakpoints/23210] [[Regression] Bogus Breakpoint address adjusted from 0xf7fe7dd3 to 0xfffffffff7fe7dd3.
hjl.tools at gmail dot com
2018-05-21 15:56:00 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23210

H.J. Lu <hjl.tools at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |markus.t.metzger at intel dot com
Summary|Bogus Breakpoint address |[[Regression] Bogus
|adjusted from 0xf7fe7dd3 to |Breakpoint address adjusted
|0xfffffffff7fe7dd3. |from 0xf7fe7dd3 to
| |0xfffffffff7fe7dd3.

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
[***@gnu-skl-1 gdb]$ cat x.c
#include <stdio.h>

int
main ()
{
printf ("hello\n");
return 0;
}
[***@gnu-skl-1 gdb]$ gcc -g x.c -m32 -fPIE -pie
[***@gnu-skl-1 gdb]$ gdb a.out
GNU gdb (GDB) Fedora 8.1-15.fc28
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...done.
(gdb) b main
Breakpoint 1 at 0x11c6: file x.c, line 6.
(gdb) r
Starting program: /export/build/gnu/gdb/build-x86_64-linux/gdb/a.out
Missing separate debuginfos, use: dnf debuginfo-install
glibc-2.27-14.1.fc28.i686

Breakpoint 1, main () at x.c:6
6 printf ("hello\n");
(gdb) q
A debugging session is active.

Inferior 1 [process 25461] will be killed.

Quit anyway? (y or n) y
[***@gnu-skl-1 gdb]$ ./gdb a.out
Exception caught while booting Guile.
Error in function "open-file":
No such file or directory: "/usr/local/share/gdb/guile/gdb/boot.scm"
./gdb: warning: Could not complete Guile gdb module initialization from:
/usr/local/share/gdb/guile/gdb/boot.scm.
Limited Guile support is available.
Suggest passing --data-directory=/path/to/gdb/data-directory.

Python Exception <type 'exceptions.ImportError'> No module named gdb:
./gdb: warning:
Could not load the Python gdb module from `/usr/local/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.

GNU gdb (GDB) 8.1.50.20180521-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...done.
(gdb) b main
Breakpoint 1 at 0x11c6: file x.c, line 6.
(gdb) r
Starting program: /export/build/gnu/gdb/build-x86_64-linux/gdb/a.out
warning: Breakpoint address adjusted from 0xf7fd6b51 to 0xfffffffff7fd6b51.
warning: Breakpoint address adjusted from 0xf7fd7529 to 0xfffffffff7fd7529.
warning: Breakpoint address adjusted from 0xf7fd9a8c to 0xfffffffff7fd9a8c.
warning: Breakpoint address adjusted from 0xf7fd9614 to 0xfffffffff7fd9614.
warning: Breakpoint address adjusted from 0xf7fe7dd3 to 0xfffffffff7fe7dd3.
warning: Breakpoint address adjusted from 0xf7fe8a56 to 0xfffffffff7fe8a56.
warning: Breakpoint address adjusted from 0xf7fe8d14 to 0xfffffffff7fe8d14.

Program received signal SIGINT, Interrupt.
Python Exception <type 'exceptions.NameError'> Installation error:
gdb.execute_unwinders function is missing:
0xf7fd6b51 in ?? () from /lib/ld-linux.so.2
(gdb)
--
You are receiving this mail because:
You are on the CC list for the bug.
hjl.tools at gmail dot com
2018-05-21 10:18:36 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23210

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
CORE_ADDR
address_significant (gdbarch *gdbarch, CORE_ADDR addr)
{
/* Clear insignificant bits of a target address and sign extend resulting
address, avoiding shifts larger or equal than the width of a CORE_ADDR.
The local variable ADDR_BIT stops the compiler reporting a shift overflow
when it won't occur. */
int addr_bit = gdbarch_significant_addr_bit (gdbarch);

if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
{
CORE_ADDR sign = (CORE_ADDR) 1 << (addr_bit - 1);
addr &= ((CORE_ADDR) 1 << addr_bit) - 1;
addr = (addr ^ sign) - sign;
}

return addr;
}

is wrong for x86.
--
You are receiving this mail because:
You are on the CC list for the bug.
hjl.tools at gmail dot com
2018-05-21 16:04:58 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23210

H.J. Lu <hjl.tools at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |omair.javaid at linaro dot org

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
This is caused by

commit 8727de56b0dbe25b7b4a3bd04f72ac41992463ed (HEAD)
Author: Omair Javaid <***@linaro.org>
Date: Tue May 1 06:31:32 2018 +0500

Fix tagged pointer support
--
You are receiving this mail because:
You are on the CC list for the bug.
brobecker at gnat dot com
2018-05-21 17:20:12 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23210

Joel Brobecker <brobecker at gnat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |brobecker at gnat dot com

--- Comment #4 from Joel Brobecker <brobecker at gnat dot com> ---
A quick note to confirm that the patch identified as triggering the issue was
backported to the 8.1 branch, so that would explain why 8.1 is impacted.
--
You are receiving this mail because:
You are on the CC list for the bug.
hjl.tools at gmail dot com
2018-05-21 16:30:42 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23210

H.J. Lu <hjl.tools at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Version|HEAD |8.1.1
Target Milestone|--- |8.1.1
Summary|[[Regression] Bogus |[8.1/8.2 Regression] Bogus
|Breakpoint address adjusted |Breakpoint address adjusted
|from 0xf7fe7dd3 to |from 0xf7fe7dd3 to
|0xfffffffff7fe7dd3. |0xfffffffff7fe7dd3.
--
You are receiving this mail because:
You are on the CC list for the bug.
omair.javaid at linaro dot org
2018-05-23 09:51:27 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23210

Omair Javaid <omair.javaid at linaro dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at sourceware dot org |omair.javaid at linaro dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
cvs-commit at gcc dot gnu.org
2018-05-31 02:32:13 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23210

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Omair Javaid <***@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5969f0dba74e17c694faf333b120f1e0b95783ed

commit 5969f0dba74e17c694faf333b120f1e0b95783ed
Author: Omair Javaid <***@linaro.org>
Date: Sat May 26 05:58:51 2018 +0500

Unset gdbarch significant_addr_bit by default

This patch fixes a bug introduced by fix to AArch64 pointer tagging.

In our fix for tagged pointer support our agreed approach was to sign
extend user-space address after clearing tag bits. This is not same
for all architectures and this patch allows sign extension for
addresses on targets which specifically set significant_addr_bit.

More information about patch that caused the issues and discussion
around tagged pointer support can be found in links below:

https://sourceware.org/ml/gdb-patches/2018-05/msg00000.html
https://sourceware.org/ml/gdb-patches/2017-12/msg00159.html

gdb/ChangeLog:

2018-05-31 Omair Javaid <***@linaro.org>

PR gdb/23210
* gdbarch.sh (significant_addr_bit): Default to zero when
not set by target architecture.
* gdbarch.c: Re-generated.
* utils.c (address_significant): Update.
--
You are receiving this mail because:
You are on the CC list for the bug.
cvs-commit at gcc dot gnu.org
2018-05-31 03:29:48 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23210

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-8.1-branch branch has been updated by Omair Javaid
<***@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8679931c2c9f97ad182f8f0a9e8fab20305719b5

commit 8679931c2c9f97ad182f8f0a9e8fab20305719b5
Author: Omair Javaid <***@linaro.org>
Date: Sat May 26 05:58:51 2018 +0500

Unset gdbarch significant_addr_bit by default

This patch fixes a bug introduced by fix to AArch64 pointer tagging.

In our fix for tagged pointer support our agreed approach was to sign
extend user-space address after clearing tag bits. This is not same
for all architectures and this patch allows sign extension for
addresses on targets which specifically set significant_addr_bit.

More information about patch that caused the issues and discussion
around tagged pointer support can be found in links below:

https://sourceware.org/ml/gdb-patches/2018-05/msg00000.html
https://sourceware.org/ml/gdb-patches/2017-12/msg00159.html

gdb/ChangeLog:

2018-05-31 Omair Javaid <***@linaro.org>

PR gdb/23210
* gdbarch.sh (significant_addr_bit): Default to zero when
not set by target architecture.
* gdbarch.c: Re-generated.
* utils.c (address_significant): Update.
--
You are receiving this mail because:
You are on the CC list for the bug.
palves at redhat dot com
2018-07-06 15:30:05 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23210

Pedro Alves <palves at redhat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
CC| |palves at redhat dot com
Resolution|--- |FIXED

--- Comment #7 from Pedro Alves <palves at redhat dot com> ---
Fix was merged a while ago. Closing.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...