File: threads-execve.test

package info (click to toggle)
strace 4.26-0.2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 35,988 kB
  • sloc: ansic: 95,598; sh: 7,155; makefile: 2,489; awk: 335; perl: 267; sed: 6
file content (32 lines) | stat: -rwxr-xr-x 826 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
#
# Check decoding of threads when a non-leader thread invokes execve.
#
# Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
# Copyright (c) 2016-2018 The strace developers.
# All rights reserved.
#
# SPDX-License-Identifier: GPL-2.0-or-later

. "${srcdir=.}/init.sh"

# Check that PTRACE_EVENT_EXEC support in kernel is good enough.
# The kernel before commit v3.1-rc1~308^2~7 reported 0 instead of old pid.
require_min_kernel_version_or_skip 3.1

check_prog diff
run_prog > /dev/null

set -- -a21 -f -esignal=none -e trace=execve,exit,nanosleep,rt_sigsuspend $args

# Due to probabilistic nature of the test, try it several times.
i=0
while [ $i -le 19 ]; do
	i="$(($i+1))"
	run_strace "$@" > "$EXP"
	sed 1d < "$LOG" > "$OUT"
	diff -- "$EXP" "$OUT" || continue
	exit 0
done

fail_ "$STRACE $* output mismatch"