Repository: google/oss-fuzz

Issue #2289: All the projects where AFL is used as a fuzzing engine seem to be broken
Created: 2019-04-04T10:43:08Z
To judge from the logs at https://oss-fuzz-build-logs.storage.googleapis.com/index.html, afl seems to be failing to compile:
Step #29: Already have image: gcr.io/oss-fuzz/systemd
Step #29: ---------------------------------------------------------------
Step #29: ar: creating /usr/lib/libFuzzingEngine.a
Step #29: Compiling afl to /usr/lib/libFuzzingEngine.a ...rm -f afl-gcc afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze afl-as as afl-g++ afl-clang afl-clang++ *.o *~ a.out core core.[1-9][0-9]* *.stackdump test .test test-instr .test-instr0 .test-instr1 qemu_mode/qemu-2.10.0.tar.bz2 afl-qemu-trace
Step #29: rm -rf out_dir qemu_mode/qemu-2.10.0
Step #29: make -C llvm_mode clean
Step #29: make[1]: Entering directory '/src/afl/llvm_mode'
Step #29: rm -f *.o *.so *~ a.out core core.[1-9][0-9]* test-instr .test-instr0 .test-instr1 
Step #29: rm -f ../afl-clang-fast ../afl-llvm-pass.so ../afl-llvm-rt.o ../afl-llvm-rt-32.o ../afl-llvm-rt-64.o ../afl-clang-fast++
Step #29: make[1]: Leaving directory '/src/afl/llvm_mode'
Step #29: make -C libdislocator clean
Step #29: make[1]: Entering directory '/src/afl/libdislocator'
Step #29: rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
Step #29: rm -f libdislocator.so
Step #29: make[1]: Leaving directory '/src/afl/libdislocator'
Step #29: make -C libtokencap clean
Step #29: make[1]: Entering directory '/src/afl/libtokencap'
Step #29: rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
Step #29: rm -f libtokencap.so
Step #29: make[1]: Leaving directory '/src/afl/libtokencap'
Step #29: [*] Checking for the ability to compile x86 code...
Step #29: [+] Everything seems to be working, ready to compile.
Step #29: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-gcc.c -o afl-gcc -ldl
Step #29: set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $i; done
Step #29: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-fuzz.c -o afl-fuzz -ldl
Step #29: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-showmap.c -o afl-showmap -ldl
Step #29: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-tmin.c -o afl-tmin -ldl
Step #29: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-gotcpu.c -o afl-gotcpu -ldl
Step #29: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-analyze.c -o afl-analyze -ldl
Step #29: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-as.c -o afl-as -ldl
Step #29: ln -sf afl-as as
Step #29: [*] Testing the CC wrapper and instrumentation output...
Step #29: unset AFL_USE_ASAN AFL_USE_MSAN; AFL_QUIET=1 AFL_INST_RATIO=100 AFL_PATH=. ./afl-clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" test-instr.c -o test-instr -ldl
Step #29: echo 0 | ./afl-showmap -m none -q -o .test-instr0 ./test-instr
Step #29: echo 1 | ./afl-showmap -m none -q -o .test-instr1 ./test-instr
Step #29: make: *** [test_build] Error 1
Step #29: 
Step #29: Oops, the instrumentation does not seem to be behaving correctly!
Step #29: 
Step #29: Please ping <lcamtuf@google.com> to troubleshoot the issue.
Step #29: 
Step #29: Makefile:90: recipe for target 'test_build' failed
Finished Step #29
ERROR
ERROR: build step 29 "gcr.io/oss-fuzz/systemd" failed: exit status 2

Duplicate issue #2290: All builds broken due to AFL instrumentation breakage
Created: 2019-04-04T13:43:37Z
All oss-fuzz builds are broken
Looks like it's breaking when it tries to build afl-clang:
Step #20: Compiling afl to /usr/lib/libFuzzingEngine.a ...rm -f afl-gcc afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze afl-as as afl-g++ afl-clang afl-clang++ *.o *~ a.out core core.[1-9][0-9]* *.stackdump test .test test-instr .test-instr0 .test-instr1 qemu_mode/qemu-2.10.0.tar.bz2 afl-qemu-trace
Step #20: rm -rf out_dir qemu_mode/qemu-2.10.0
Step #20: make -C llvm_mode clean
Step #20: make[1]: Entering directory '/src/afl/llvm_mode'
Step #20: rm -f *.o *.so *~ a.out core core.[1-9][0-9]* test-instr .test-instr0 .test-instr1 
Step #20: rm -f ../afl-clang-fast ../afl-llvm-pass.so ../afl-llvm-rt.o ../afl-llvm-rt-32.o ../afl-llvm-rt-64.o ../afl-clang-fast++
Step #20: make[1]: Leaving directory '/src/afl/llvm_mode'
Step #20: make -C libdislocator clean
Step #20: make[1]: Entering directory '/src/afl/libdislocator'
Step #20: rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
Step #20: rm -f libdislocator.so
Step #20: make[1]: Leaving directory '/src/afl/libdislocator'
Step #20: make -C libtokencap clean
Step #20: make[1]: Entering directory '/src/afl/libtokencap'
Step #20: rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
Step #20: rm -f libtokencap.so
Step #20: make[1]: Leaving directory '/src/afl/libtokencap'
Step #20: [*] Checking for the ability to compile x86 code...
Step #20: [+] Everything seems to be working, ready to compile.
Step #20: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-gcc.c -o afl-gcc -ldl
Step #20: set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $i; done
Step #20: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-fuzz.c -o afl-fuzz -ldl
Step #20: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-showmap.c -o afl-showmap -ldl
Step #20: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-tmin.c -o afl-tmin -ldl
Step #20: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-gotcpu.c -o afl-gotcpu -ldl
Step #20: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-analyze.c -o afl-analyze -ldl
Step #20: clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-as.c -o afl-as -ldl
Step #20: ln -sf afl-as as
Step #20: [*] Testing the CC wrapper and instrumentation output...
Step #20: unset AFL_USE_ASAN AFL_USE_MSAN; AFL_QUIET=1 AFL_INST_RATIO=100 AFL_PATH=. ./afl-clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" test-instr.c -o test-instr -ldl
Step #20: echo 0 | ./afl-showmap -m none -q -o .test-instr0 ./test-instr
Step #20: echo 1 | ./afl-showmap -m none -q -o .test-instr1 ./test-instr
Step #20: make: *** [test_build] Error 1
Step #20: 
Step #20: Oops, the instrumentation does not seem to be behaving correctly!
Step #20: 
Step #20: Please ping <lcamtuf@google.com> to troubleshoot the issue.
Step #20: 
Step #20: Makefile:90: recipe for target 'test_build' failed
Finished Step #20
ERROR
ERROR: build step 20 "gcr.io/oss-fuzz/cppcheck" failed: exit status 2

Thanks @kjlubick for pointing this out!

Closing comment (2019-04-04T14:10:48Z): Duplicate of #2289