freebsd-skq/tests/sys/kern
Mariusz Zaborski 8e49361164 procdesc: allow to collect status through wait(1) if process is traced
The debugger like truss(1) depends on the wait(2) syscall. This syscall
waits for ALL children. When it is waiting for ALL child's the children
created by process descriptors are not returned. This behavior was
introduced because we want to implement libraries which may pdfork(1).

The behavior of process descriptor brakes truss(1) because it will
not be able to collect the status of processes with process descriptors.

To address this problem the status is returned to parent when the
child is traced. While the process is traced the debugger is the new parent.
In case the original parent and debugger are the same process it means the
debugger explicitly used pdfork() to create the child. In that case the debugger
should be using kqueue()/pdwait() instead of wait().

Add test case to verify that. The test case was implemented by markj@.

Reviewed by:	kib, markj
Discussed with:	jhb
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D20362
2019-11-25 18:33:21 +00:00
..
acct DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
execve DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
pipe Revert r337929 2018-08-16 22:04:00 +00:00
coredump_phnum_helper.c Add test case for >65535 segment coredumps 2016-11-01 19:18:16 +00:00
coredump_phnum_test.sh coredump_phnum_test: handle full file system gracefully 2019-10-11 21:23:46 +00:00
kcov.c Allow the kcov buffer to be mmaped multiple times. 2019-02-21 10:11:15 +00:00
kern_copyin.c Revert r337929 2018-08-16 22:04:00 +00:00
kern_descrip_test.c Fix problems in the kern_maxfiles__increase test 2019-10-08 13:43:05 +00:00
kill_zombie.c Add a test for kill() on a zombie 2019-08-06 21:17:22 +00:00
libkern_crc32.c Separate kernel crc32() implementation to its own header (gsb_crc32.h) and 2019-06-17 19:49:08 +00:00
Makefile Add linux-compatible memfd_create 2019-09-25 18:03:18 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
Makefile.inc Add include Makefiles for tests/sys/{fs,kern,kqueue,mac}/... 2017-01-14 20:21:21 +00:00
memfd_test.c Further normalize copyright notices 2019-09-26 16:19:22 +00:00
pdeathsig_helper.c Rename PROC_PDEATHSIG_SET -> PROC_PDEATHSIG_CTL and PROC_PDEATHSIG_GET 2018-04-20 15:19:27 +00:00
pdeathsig.c sys.kern.pdeathsig.signal_delivered_ptrace: fix startup. 2019-08-19 09:33:09 +00:00
ptrace_test.c procdesc: allow to collect status through wait(1) if process is traced 2019-11-25 18:33:21 +00:00
reaper.c Reparent a child of pdfork(2) to its reaper when the procdesc is closed. 2018-10-16 20:06:56 +00:00
sigaltstack.c Maybe make gcc happy 2018-11-30 23:47:57 +00:00
sys_getrandom.c Appease GCC 4.2 2018-03-21 04:44:19 +00:00
unix_passfd_test.c Fix a bug in r353332 that snuck in with a last-minute adjustment. 2019-10-08 23:52:04 +00:00
unix_seqpacket_test.c Send all of data, not just a portion of it 2017-05-28 09:21:28 +00:00
unix_socketpair_test.c Drop "All rights reserved" from the files I own 2019-03-11 22:23:56 +00:00
waitpid_nohang.c wait: Do not copyout uninitialized status/rusage/wrusage. 2016-09-09 21:58:48 +00:00