File: cra.sh

package info (click to toggle)
qbe 1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,004 kB
  • sloc: ansic: 13,368; yacc: 843; ml: 466; sh: 379; python: 232; makefile: 100
file content (38 lines) | stat: -rwxr-xr-x 503 bytes parent folder | download
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
33
34
35
36
37
38
#!/bin/sh

DIR=`cd $(dirname "$0"); pwd`
QBE=$DIR/../qbe
BUGF=/tmp/bug.id
FIND=$1
FIND=${FIND:-afl-find}

if ! test -f $BUGF
then
	echo 1 > $BUGF
fi

while true
do
	ID=`cat $BUGF`

	if test `ls $FIND/crashes/id* | wc -l` -lt $ID
	then
		rm -f bug.ssa
		echo "All done!"
		exit 0
	fi

	BUG=`ls $FIND/crashes/id* | sed -ne "${ID}{p;q}"`

	echo "*** Crash $ID"
	cp $BUG bug.ssa

	$QBE bug.ssa > /dev/null
	RET=$?
	if test \( $RET -ne 0 \) -a \( $RET -ne 1 \)
	then
		exit 1
	fi

	expr $ID + 1 > $BUGF
done