freebsd-dev/usr.bin/truss
Konstantin Belousov 12f747e6ff truss(1): detach more carefully
When detaching, truss(1) sends SIGSTOP to the traced process to ensure
that it is detaching in the steady state.  But it is possible, for
multithreaded process, that wait() call returns event other than our
SIGSTOP notification.  As result, SIGSTOP might sit in some thread'
sigqueue, which makes SIGCONT a nop.  Then, the process is stopped when
the queued SIGSTOP is acted upon.

To handle this, loop until we drain everything before SIGSTOP,
and see that the process is stopped.

Note that the earlier fix makes it safe to have some more debugging
events longering after SIGSTOP is acted upon.  They will be ignored
after PT_DETACH.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33861
2022-01-12 20:04:41 +02:00
..
extern.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
main.c truss: minor cleanup and pedantic warning fixes 2021-06-16 16:35:55 +01:00
Makefile Rename NO_WERROR -> MK_WERROR=no 2021-01-07 09:31:03 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
setup.c truss(1): detach more carefully 2022-01-12 20:04:41 +02:00
syscall.h Drop cloudabi 2021-09-22 00:18:44 +03:00
syscalls.c truss: remove write-only variable 2022-01-12 20:04:41 +02:00
truss.1 Make truss(1) cross-reference dtrace(1) and bump .Dd. 2017-07-21 13:58:51 +00:00
truss.h truss: improved support for decoding compat32 arguments 2021-03-25 11:14:13 +00:00