This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/2240: Cannot insert breakpoint -10.


>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
>Closed-Date:
>Last-Modified:
>Originator:     Keith Glidewell
>Release:        6.5-15.fc6rh
>Organization:
>Environment:
Fedora core 6, x86-64, /lib/ld-2.5.so, dell 2950, 8GB memory, gcc version 4.1.1 20070105 (Red Hat 4.1.1-51), target program compiled with -m32
>Description:
[root@c4server1a gdb]# ~/hello32 &
[1] 8932

[root@c4server1a gdb]# cat /proc/8932/maps 
0077a000-008b1000 r-xp 00000000 fd:00 17939344                           /lib/libc-2.5.so
008b1000-008b3000 r--p 00137000 fd:00 17939344                           /lib/libc-2.5.so
008b3000-008b4000 rw-p 00139000 fd:00 17939344                           /lib/libc-2.5.so
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/ld-2.5.so
f7ffc000-f7ffd000 r--p 00018000 fd:00 15647825                           /lib/ld-2.5.so
f7ffd000-f7ffe000 rw-p 00019000 fd:00 15647825                           /lib/ld-2.5.so
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/libthread_db.so.1".
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4
0x007a6548 in random_r () from /lib/libc.so.6
(gdb) c
Continuing.
Warning:
Cannot insert breakpoint -10.
Error accessing memory address 0xfffffffff7ff1770: Input/output error.

(gdb) 

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 ();
    159 
    160   gdb_assert (lmo->l_ld_size != 0);
    161 
    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 ld-2.5.so.  Look at proc/PID/maps.  If you don't see ld-2.5.so mapped in the high address ranges, it won't fail.
>How-To-Repeat:
gcc -m32 -o loop loop.c
loop &
gdb
attach PID
c
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
 Cannot insert breakpoint -10 Error accessing memory address 0xfffffffff7ff1770
 From: glidewell_keith@emc.com
 Reply-To: glidewell_keith@emc.com
 X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31)
 X-GNATS-Notify: 
 
 Cannot insert breakpoint -10 Error accessing memory address 0xfffffffff7ff1770


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]