mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-10 01:01:33 +00:00
fix travis
This commit is contained in:
parent
d3282ef1fe
commit
f8c0182e16
12
.travis.yml
12
.travis.yml
@ -9,18 +9,18 @@ branches:
|
||||
|
||||
matrix:
|
||||
include:
|
||||
# - os: linux # focal errors every run with a timeout while installing packages
|
||||
# dist: focal
|
||||
# env: NAME="focal-amd64" MODERN="yes" GCC="9"
|
||||
- os: linux
|
||||
dist: focal
|
||||
env: NAME="focal-amd64" MODERN="yes" GCC="9"
|
||||
- os: linux
|
||||
dist: bionic
|
||||
env: NAME="bionic-amd64" MODERN="yes" GCC="7"
|
||||
- os: linux
|
||||
dist: xenial
|
||||
env: NAME="xenial-amd64" MODERN="no" GCC="5" EXTRA="libtool-bin clang-6.0"
|
||||
- os: linux
|
||||
dist: trusty
|
||||
env: NAME="trusty-amd64" MODERN="no" GCC="4.8"
|
||||
# - os: linux # disabled: fatal: unable to access 'https://git.qemu.org/git/capstone/': gnutls_handshake() failed: Handshake failed
|
||||
# dist: trusty
|
||||
# env: NAME="trusty-amd64" MODERN="no" GCC="4.8"
|
||||
- os: linux # until travis can fix this!
|
||||
dist: xenial
|
||||
arch: arm64
|
||||
|
122
examples/analysis_scripts/queue2csv.sh
Executable file
122
examples/analysis_scripts/queue2csv.sh
Executable file
@ -0,0 +1,122 @@
|
||||
#!/bin/bash
|
||||
|
||||
test -z "$1" -o -z "$2" -o "$1" = "-h" -o "$1" = "-hh" -o "$1" = "--help" -o '!' -d "$1" && {
|
||||
echo "Syntax: [-n] $0 out-directory file.csv [\"tools/target --opt @@\"]"
|
||||
echo Option -n will suppress the CSV header.
|
||||
echo If the target execution command is supplied then also edge coverage is gathered.
|
||||
exit 1
|
||||
}
|
||||
|
||||
function getval() {
|
||||
VAL=""
|
||||
if [ "$file" != "${file/$1/}" ]; then
|
||||
TMP="${file/*$1:/}"
|
||||
VAL="${TMP/,*/}"
|
||||
fi
|
||||
}
|
||||
|
||||
SKIP=
|
||||
if [ "$1" = "-n" ]; then
|
||||
SKIP=1
|
||||
shift
|
||||
fi
|
||||
|
||||
test -n "$4" && { echo "Error: too many commandline options. Target command and options including @@ have to be passed within \"\"!"; exit 1; }
|
||||
|
||||
test -d "$1"/queue && OUT="$1/queue" || OUT="$1"
|
||||
|
||||
OK=`ls $OUT/id:000000,time:0,orig:* 2> /dev/null`
|
||||
if [ -n "$OK" ]; then
|
||||
LISTCMD="ls $OUT/id:"*
|
||||
else
|
||||
LISTCMD="ls -tr $OUT/"
|
||||
fi
|
||||
|
||||
ID=;SRC=;TIME=;OP=;POS=;REP=;EDGES=;EDGES_TOTAL=;
|
||||
DIR="$OUT/../stats"
|
||||
rm -rf "$DIR"
|
||||
> "$2" || exit 1
|
||||
mkdir "$DIR" || exit 1
|
||||
> "$DIR/../edges.txt" || exit 1
|
||||
|
||||
{
|
||||
|
||||
if [ -z "$SKIP" ]; then
|
||||
echo "time;\"filename\";id;src;new_cov;edges;total_edges;\"op\";pos;rep;unique_edges"
|
||||
fi
|
||||
|
||||
$LISTCMD | grep -v ,sync: | sed 's/.*id:/id:/g' | while read file; do
|
||||
|
||||
if [ -n "$3" ]; then
|
||||
|
||||
TMP=${3/@@/$OUT/$file}
|
||||
|
||||
if [ "$TMP" = "$3" ]; then
|
||||
|
||||
cat "$OUT/$file" | afl-showmap -o "$DIR/$file" -q -- $3 >/dev/null 2>&1
|
||||
|
||||
else
|
||||
|
||||
afl-showmap -o "$DIR/$file" -q -- $TMP >/dev/null 2>&1
|
||||
|
||||
fi
|
||||
|
||||
{ cat "$DIR/$file" | sed 's/:.*//' ; cat "$DIR/../edges.txt" ; } | sort -nu > $DIR/../edges.txt.tmp
|
||||
mv $DIR/../edges.txt.tmp $DIR/../edges.txt
|
||||
EDGES=$(cat "$DIR/$file" | wc -l)
|
||||
EDGES_TOTAL=$(cat "$DIR/../edges.txt" | wc -l)
|
||||
|
||||
fi
|
||||
|
||||
getval id; ID="$VAL"
|
||||
getval src; SRC="$VAL"
|
||||
getval time; TIME="$VAL"
|
||||
getval op; OP="$VAL"
|
||||
getval pos; POS="$VAL"
|
||||
getval rep; REP="$VAL"
|
||||
if [ "$file" != "${file/+cov/}" ]; then
|
||||
COV=1
|
||||
else
|
||||
COV=""
|
||||
fi
|
||||
|
||||
if [ -n "$3" -a -s "$DIR/../edges.txt" ]; then
|
||||
echo "$TIME;\"$file\";$ID;$SRC;$COV;$EDGES;$EDGES_TOTAL;\"$OP\";$POS;$REP;UNIQUE$file"
|
||||
else
|
||||
echo "$TIME;\"$file\";$ID;$SRC;$COV;;;\"$OP\";$POS;$REP;"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
} | tee "$DIR/../queue.csv" > "$2" || exit 1
|
||||
|
||||
if [ -n "$3" -a -s "$DIR/../edges.txt" ]; then
|
||||
|
||||
cat "$DIR/"* | sed 's/:.*//' | sort -n | uniq -c | egrep '^[ \t]*1 ' | awk '{print$2}' > $DIR/../unique.txt
|
||||
|
||||
if [ -s "$DIR/../unique.txt" ]; then
|
||||
|
||||
ls "$DIR/id:"* | grep -v ",sync:" |sed 's/.*\/id:/id:/g' | while read file; do
|
||||
|
||||
CNT=$(sed 's/:.*//' "$DIR/$file" | tee "$DIR/../tmp.txt" | wc -l)
|
||||
DIFF=$(diff -u "$DIR/../tmp.txt" "$DIR/../unique.txt" | egrep '^-[0-9]' | wc -l)
|
||||
UNIQUE=$(($CNT - $DIFF))
|
||||
sed -i "s/;UNIQUE$file/;$UNIQUE/" "$DIR/../queue.csv" "$2"
|
||||
|
||||
done
|
||||
|
||||
rm -f "$DIR/../tmp.txt"
|
||||
|
||||
else
|
||||
|
||||
sed -i 's/;UNIQUE.*/;/' "$DIR/../queue.csv" "$2"
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
mv "$DIR/../queue.csv" "$DIR/queue.csv"
|
||||
if [ -e "$DIR/../edges.txt" ]; then mv "$DIR/../edges.txt" "$DIR/edges.txt"; fi
|
||||
if [ -e "$DIR/../unique.txt" ]; then mv "$DIR/../unique.txt" "$DIR/unique.txt"; fi
|
||||
|
||||
echo "Created $2"
|
Loading…
x
Reference in New Issue
Block a user