gdb/2240: Cannot insert breakpoint -10.
Mon Mar 19 23:28:00 GMT 2007

>Number:         2240
>Category:       gdb
>Synopsis:       Cannot insert breakpoint -10.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 19 23:28:01 GMT 2007
>Originator:     Keith Glidewell
>Release:        6.5-15.fc6rh
Fedora core 6, x86-64, /lib/, dell 2950, 8GB memory, gcc version 4.1.1 20070105 (Red Hat 4.1.1-51), target program compiled with -m32
[root@c4server1a gdb]# ~/hello32 &
[1] 8932

[root@c4server1a gdb]# cat /proc/8932/maps 
0077a000-008b1000 r-xp 00000000 fd:00 17939344                           /lib/
008b1000-008b3000 r--p 00137000 fd:00 17939344                           /lib/
008b3000-008b4000 rw-p 00139000 fd:00 17939344                           /lib/
008b4000-008b7000 rw-p 008b4000 00:00 0 
08048000-08049000 r-xp 00000000 fd:00 17025245                           /root/hello32
08049000-0804a000 rw-p 00000000 fd:00 17025245                           /root/hello32
f7fc8000-f7fc9000 rw-p f7fc8000 00:00 0 
f7fe1000-f7fe3000 rw-p f7fe1000 00:00 0 
f7fe3000-f7ffc000 r-xp 00000000 fd:00 15647825                           /lib/
f7ffc000-f7ffd000 r--p 00018000 fd:00 15647825                           /lib/
f7ffd000-f7ffe000 rw-p 00019000 fd:00 15647825                           /lib/
ffe30000-ffe32000 rw-p ffe30000 00:00 0                                  [stack]
ffffe000-fffff000 r-xp ffffe000 00:00 0 

[root@c4server1a gdb]# gdb
GNU gdb Red Hat Linux (6.5-15.fc6rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
(gdb) attach 8932
Attaching to process 8932
Reading symbols from /root/hello32...done.
Using host libthread_db library "/lib64/".
Reading symbols from /lib/
Loaded symbols for /lib/
Reading symbols from /lib/
Loaded symbols for /lib/
warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4
0x007a6548 in random_r () from /lib/
(gdb) c
Cannot insert breakpoint -10.
Error accessing memory address 0xfffffffff7ff1770: Input/output error.


Tracked it down to line 162 in solib-svr4.c.  The 32 bit address is getting sign extended to 64, creating the issue.  There is another instance on line 142 of the file that is probably wrong also.
    155 static CORE_ADDR
    156 LM_DYNAMIC_FROM_LINK_MAP (struct so_list *so)
    157 {
    158   struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
    160   gdb_assert (lmo->l_ld_size != 0);
    162   return (CORE_ADDR) extract_signed_integer (so->lm_info->lm
    163                                              + lmo->l_ld_offset,
    164                                              lmo->l_ld_size);
    165 }

Note that this only happens on *some* versions of  Look at proc/PID/maps.  If you don't see mapped in the high address ranges, it won't fail.
gcc -m32 -o loop loop.c
loop &
attach PID

 Cannot insert breakpoint -10 Error accessing memory address 0xfffffffff7ff1770
 X-Send-Pr-Version: gnatsweb-2.9.3 (
 Cannot insert breakpoint -10 Error accessing memory address 0xfffffffff7ff1770

More information about the Gdb-prs mailing list