fix centos6 build failures
[trinity.git] / scripts / test-all-syscalls-sequentially.sh
blob14fb4c30c03ecb4bbf3c491047bb68e79853785a
1 #!/bin/bash
3 # This is a useful test to run occasionally, to see which syscalls are
4 # causing trinity to segfault.
6 TRINITY_PATH=${TRINITY_PATH:-.}
7 TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
9 check_tainted()
11 if [ "$(cat /proc/sys/kernel/tainted)" != $TAINT ]; then
12 echo ERROR: Taint flag changed $(cat /proc/sys/kernel/tainted)
13 exit
17 TAINT=$(cat /proc/sys/kernel/tainted)
19 while [ 1 ]
21 for syscall in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $3 }' | sort -u)
23 chmod 755 $TRINITY_TMP
24 pushd $TRINITY_TMP
26 if [ ! -f $TRINITY_PATH/trinity ]; then
27 echo lost!
28 pwd
29 exit
32 MALLOC_CHECK_=2 $TRINITY_PATH/trinity -q -c $syscall -N 99999 -l off -C 64
33 popd
35 check_tainted
36 echo
37 echo
38 done
39 check_tainted
40 done