cff0b9e5ca
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/Makefile.am (check_PROGRAMS): Add kill_child. (MISC_TESTS): Add kill_child.test.
18 lines
480 B
Bash
Executable File
18 lines
480 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Check whether repeated killing of just forked processes crashes strace.
|
|
|
|
. "${srcdir=.}/init.sh"
|
|
|
|
run_prog "../$NAME"
|
|
|
|
# Run strace until the known corner case is observed
|
|
while :; do
|
|
run_strace -f -qq -esignal=none $args
|
|
|
|
# Printing of "<... SYSCALL resumed>" in strace.c:print_event_exit
|
|
# previously led to segfault if the syscall number hadn't been obtained
|
|
# on syscall entering.
|
|
grep -qE '^[0-9]+ <\.\.\. \?\?\?\? resumed>\) += \?$' "$LOG" && exit 0
|
|
done
|