freebsd-dev/tests/sys
Mariusz Zaborski fd631bcd95 procdesc: fix reparenting when the debugger is attached
The process is reparented to the debugger while it is attached.
  B          B
 /   ---->   |
A          A D

Every time when the process is reparented, it is added to the orphan list
of the previous parent:

A->orphan = B
D->orphan = NULL

When the A process will close the process descriptor to the B process,
the B process will be reparented to the init process.
  B            B - init
  |   ---->
A D          A   D

A->orphan = B
D->orphan = B

In this scenario, the B process is in the orphan list of A and D.

When the last process descriptor is closed instead of reparenting
it to the reaper let it stay with the debugger process and set
our previews parent to the reaper.

Add test case for this situation.
Notice that without this patch the kernel will crash with this test case:
panic: orphan 0xfffff8000e990530 of 0xfffff8000e990000 has unexpected oppid 1

Reviewed by:	markj, kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D20361
2019-08-05 20:15:46 +00:00
..
acl Add a very basic regression test for setfacl -R with NFSv4 ACLs. 2018-10-26 21:20:04 +00:00
aio Revert r337929 2018-08-16 22:04:00 +00:00
audit Fix and simplify code by using ATF_REQUIRE_FEATURE macro 2019-04-01 14:21:32 +00:00
auditpipe Introduce test program for auditpipe(4) 2018-07-26 00:16:41 +00:00
capsicum Integrate capsicum-test into the FreeBSD test suite 2019-04-01 21:24:50 +00:00
cddl Remove duplicate ${PACKAGE}FILES+= cleanup.ksh line 2019-03-16 03:37:47 +00:00
common tests: Move common (vnet) test functions into a common file 2019-03-04 18:15:06 +00:00
devrandom random(4): Fortuna: allow increased concurrency 2019-06-17 20:29:13 +00:00
fifo other: Fix several typos and minor errors 2017-12-27 03:23:58 +00:00
file Revert r337929 2018-08-16 22:04:00 +00:00
fs Fix sys.fs.tmpfs.mknod_test.{char, block} by reverting r321967 2018-07-21 20:14:01 +00:00
geom Remove tests for the deprecated algorithms in r348206 2019-05-31 04:29:29 +00:00
kern procdesc: fix reparenting when the debugger is attached 2019-08-05 20:15:46 +00:00
kqueue Temporarily skip flakey test cases 2018-12-06 09:22:35 +00:00
mac DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
mqueue DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
net Add test cases for epair 2019-06-13 05:05:58 +00:00
netinet Skip sys.netinet.socket_afinet.socket_afinet_bind_zero temporarily because it 2019-06-23 19:37:12 +00:00
netipsec ipsec tests: Skip if ipsec.ko is not loaded 2019-05-16 02:18:57 +00:00
netmap netmap: add test cases for multiple host rings 2019-04-13 12:50:47 +00:00
netpfil Add common firewall test suite 2019-08-05 11:47:34 +00:00
opencrypto Correct definitions in sys.opencrypto.runtests.main for 32bit platform 2019-07-10 01:08:08 +00:00
pjdfstest DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
posixshm Revert r337929 2018-08-16 22:04:00 +00:00
sys Improve tree(3) tests by using ATF_REQUIRE where applicable. 2019-05-20 18:35:23 +00:00
vfs vfs_lookup: Allow PATH_MAX-1 symlinks 2017-11-17 19:25:39 +00:00
vm Add a few regression tests for mlock(2). 2019-05-01 15:28:23 +00:00
Makefile random(4): Add regression tests for uint128 implementation, Chacha CTR 2019-06-17 14:59:45 +00:00
Makefile.depend DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
Makefile.inc Use MK_CHECK_USE_SANDBOX in tests/..., to deal with the fact that 2017-08-02 22:24:08 +00:00