]> granicus.if.org Git - strace/commit
tests: add kill_child test
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 1 Feb 2019 10:04:51 +0000 (11:04 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 11 Feb 2019 23:35:07 +0000 (23:35 +0000)
commit99d8edef0078cfbaa34ff6596509ed5fccac6022
treee8a18dfddf92760a3d47a08b1a332fef8f97f741
parent898f0ad0bc498c45734bc95917b74cfdc6466c26
tests: add kill_child test

This tests repeatedly creates and kills children, so some corner
cases in handling of not-quite-existing processes can be observed.

Previously, strace was crashing in the following situation:

    13994 ????( <unfinished ...>
    ...
    13994 <... ???? resumed>) = ?

as tcp->s_ent wasn't initialised on syscall entering and
strace.c:print_event_exit segfaulted when tried to access
tcp->s_ent->sys_name.

* tests/kill_child.c: New file.
* tests/kill_child.test: New test.
* tests/.gitignore: Add kill_child.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(MISC_TESTS): Add kill_child.test.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
tests/.gitignore
tests/Makefile.am
tests/kill_child.c [new file with mode: 0644]
tests/kill_child.test [new file with mode: 0755]