make travis green again (floating point testcase), but all laf testcases need AFL_DEBUG=1 (that is another bug)

This commit is contained in:
hexcoder-
2020-07-30 13:46:52 +02:00
parent ffe5619a9d
commit 5ce55d87ec
2 changed files with 11 additions and 5 deletions

View File

@ -14,8 +14,13 @@ int main(void) {
while (__AFL_LOOP(INT_MAX)) { while (__AFL_LOOP(INT_MAX)) {
if (__AFL_FUZZ_TESTCASE_LEN != sizeof(float)) return 1; int len = __AFL_FUZZ_TESTCASE_LEN;
/* 15 + 1/2 + 1/8 + 1/32 + 1/128 */ if (len != sizeof(float)) return 1;
/* 15 + 1/2 = 15.5 */
/* 15 + 1/2 + 1/8 = 15.625 */
/* 15 + 1/2 + 1/8 + 1/32 = 15.65625 */
/* 15 + 1/2 + 1/8 + 1/32 + 1/128 = 15.6640625 */
if ((-*magic == 15.0 + 0.5 + 0.125 + 0.03125 + 0.0078125)) abort(); if ((-*magic == 15.0 + 0.5 + 0.125 + 0.03125 + 0.0078125)) abort();
} }

View File

@ -385,17 +385,18 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && {
CODE=1 CODE=1
} }
rm -f test-compcov.compcov test.out rm -f test-compcov.compcov test.out
AFL_LLVM_INSTRUMENT=AFL AFL_LLVM_LAF_ALL=1 ../afl-clang-fast -o test-floatingpoint test-floatingpoint.c > test.out 2>&1 AFL_LLVM_INSTRUMENT=AFL AFL_DEBUG=1 AFL_LLVM_LAF_ALL=1 ../afl-clang-fast -o test-floatingpoint test-floatingpoint.c
test -e test-floatingpoint && { test -e test-floatingpoint && {
mkdir -p in mkdir -p in
echo ZZ > in/in echo ZZZZ > in/in
$ECHO "$GREY[*] running afl-fuzz with floating point splitting, this will take max. 30 seconds" $ECHO "$GREY[*] running afl-fuzz with floating point splitting, this will take max. 30 seconds"
{ {
AFL_BENCH_UNTIL_CRASH=1 AFL_NO_UI=1 ../afl-fuzz -s 123 -V30 -m ${MEM_LIMIT} -i in -o out -- ./test-floatingpoint >>errors 2>&1 AFL_BENCH_UNTIL_CRASH=1 AFL_NO_UI=1 ../afl-fuzz -s 1 -V30 -m ${MEM_LIMIT} -i in -o out -- ./test-floatingpoint >>errors 2>&1
} >>errors 2>&1 } >>errors 2>&1
test -n "$( ls out/crashes/id:* 2>/dev/null )" && { test -n "$( ls out/crashes/id:* 2>/dev/null )" && {
$ECHO "$GREEN[+] llvm_mode laf-intel floatingpoint splitting feature works correctly" $ECHO "$GREEN[+] llvm_mode laf-intel floatingpoint splitting feature works correctly"
} || { } || {
cat errors
$ECHO "$RED[!] llvm_mode laf-intel floatingpoint splitting feature failed" $ECHO "$RED[!] llvm_mode laf-intel floatingpoint splitting feature failed"
CODE=1 CODE=1
} }