When strace sees its child process die from a signal, it sends itself
the same signal in order to propagate the exit status accurately.
Unfortunately, if the child process left a core dump, it gets
overwritten by a useless core dump showing how strace committed suicide.
Work around this by running strace in a subdirectory and getting the
child process to run back in the parent.
Also see Debian bug #656389.
-## End of the test, now run the server.
+## End of the test, now run the server. There's an awful hack here. If a
+## process running under strace exits with a signal, then strace will kill
+## itself with the same signal -- and therefore clobber the original
+## process's core file. So we arrange to run strace in one directory and
+## have the child process run in another.
- strace -f -o tripe.trace TRIPE $2 >server-output 2>server-errors
+ (cd strace-hack/
+ ulimit -c hard >/dev/null 2>&1
+ strace -f -o ../tripe.trace \
+ TRIPE -d.. $2 >../server-output 2>../server-errors)
stat=$?
echo $stat >server-status
if test $stat -ne 0; then
stat=$?
echo $stat >server-status
if test $stat -ne 0; then