Is that a kernel bug?

H.J. Lu (hjl@lucon.org)
Fri, 21 Nov 1997 21:24:18 -0800 (PST)


Hi,

When new kernel, at least from 2.1.62 and above, I am not longer
able to debug the dynamic linker. I got:

# gdb /lib/ld-linux.so.2

GNU gdb 970507
Copyright 1997 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 "i586-pc-linux-gnu"...
(gdb) r --list
Starting program: /lib/ld-linux.so.2 --list
Cannot insert breakpoint -1:
Error accessing memory address 0x25f0: Operation not permitted.

>From strace I got:

ptrace(PTRACE_PEEKUSER, 227, 4*EIP, [0x2aaac5f0]) = 0
ptrace(PTRACE_PEEKUSER, 227, offsetof(struct user, u_debugreg) + 24, [0]) = 0
ptrace(PTRACE_POKEUSER, 227, offsetof(struct user, u_debugreg) + 24, 0) = 0
ptrace(PTRACE_PEEKTEXT, 227, 0x25f0, [0xbffff9f4]) = -1 EIO (Input/output error)
ptrace(PTRACE_PEEKTEXT, 227, 0x25f0, [0xbffff9f4]) = -1 EIO (Input/output error)
ptrace(PTRACE_PEEKTEXT, 227, 0x1063c, [0x8]) = -1 EIO (Input/output error)
ptrace(PTRACE_PEEKTEXT, 227, 0x1063c, [0x8]) = -1 EIO (Input/output error)

Is that a gdb bug or kernel bug? BTW, linux 2.1.42 is fine and I
can debug the normal program.

Thanks.

-- 
H.J. Lu (hjl@gnu.ai.mit.edu)