Strange behavior of sigstep-threads.exp?

Andreas Arnez arnez@linux.vnet.ibm.com
Wed Nov 21 18:47:00 GMT 2012


Pedro Alves <palves@redhat.com> writes:

> linux-nat.c always gives preference to a SIGTRAP over other signals,
> so it's unexpected that a trap could be lost.  Maybe while GDB goes
> about stopping all threads with SIGSTOP (in effect, only the
> single-stepped thread), the single step has actually completed, but
> the kernel manages to report the SIGSTOP first, for some bizarre
> reason?  IOW, the kernel loses the trap.

Right, the kernel loses the trap.

While processing the SIGUSR1 from thread #2, GDB stops all other threads
with SIGSTOP -- in this case the single-stepped thread #1.  Now if the
SIGSTOP is sent after thread #1 has received the single-step exception,
but before the kernel has decided what signals to present, the kernel
suppresses the SIGTRAP and just delivers the SIGSTOP instead.

Discussed this with the s390 kernel maintainer.  A kernel patch is on
the way.



More information about the Gdb mailing list