This is the mail archive of the 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]

Re: Problems with GDB-5.0 and recent Linux kernels (2.4.0-test1-ac[47])

[ Apologies to those receiving two copies of this message.  My ISP has
  managed to get one of its mail servers in ORBS again.  Sigh ... ]

   From: Andris Pavenis <>
   Date: Sat, 3 Jun 2000 20:37:45 +0200

   Have somebody tried GDB commands 'info float' and 'info reg' on a
   system running latest ac kernels. I'm getting coredump from gdb-5.0
   on these commands.

   2.4.0-test1 - seems that all works, no such problem
   2.4.0-test1-ac4 and 2.4.0-test1-ac7  - gdb coredumps on these commands

   It seems to be some stack corruption.

Smells like a kernel bug to me.  Yep it is!  The Pentium III FXSR, SSE
support breaks changes the ABI of the ptrace(GETFPREGS, ...) interface
in an incompatible way.  The size of `struct user_i387_struct' has been
changed, so the kernel writes beyond the space on the stack reserved
by GDB, hence the stack corruption.

The kernel folks will have to find another way to implement this.
Probably by introducing a new ptrace request.  A while back Jim Blandy
implemented support for the SSE registers in GDB, based on a different
kernel patch that implemented a GETXFPREGS requests.  It also
implements support for core dumps in a different way, using an extra
section for the SSE registers.  Take a look at the GDB 5.0 release, or
the following URL:

It would be great, if the interface in the kernel could be compatible
with Jim's implementation, since that would mean instant support for
the SSE registers in GDB once the glibc headers have been updated.

By the way, I suspect that the change to `struct user_i387_struct'
also change the offset of the u_debugreg member of `struct user', and
therefore will break GDB's support for hardware brea/watchpoints.


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