Once a signal's siginfo was copied to 'td_si' as part of the signal
exchange in issignal(), it was never cleared. This caused future
thread events that are reported as SIGTRAP events without signal
information to report the stale siginfo in 'td_si'. For example, if a
debugger created a new process and used SIGSTOP to stop it after
PT_ATTACH, future system call entry / exit events would set PL_FLAG_SI
with the SIGSTOP siginfo in pl_siginfo. This broke 'catch syscall' in
current versions of gdb as it assumed PL_FLAG_SI with SIGTRAP
indicates a breakpoint or single step trap.
Details
Details
- the test fails without the patch and passes with it
- do 'gdb /bin/ls', 'catch syscall write', 'run'. Without the patch, gdb reports a spurious SIGTRAP on each system call entry/exit. With the patch gdb properly ignores syscall events for syscalls that aren't write and reports syscall events for write.
- I do have a patch for gdb as well that I plan to upstream where it requires pl_flags == PL_FLAG_SI instead of pl_flags & PL_FLAG_SI when checking SIGTRAP events for breakpoints and single step traps, but wanted to also fix the kernel.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable