tests fail when building afl-fuzz 2.52b with gcc-7.3 on xubuntu-18.04

664 views
Skip to first unread message

Dominique Pellé

unread,
May 5, 2018, 2:55:51 PM5/5/18
to afl-...@googlegroups.com
Hi

I recently installed xubuntu-18.04 and
tried to build the latest afl-fuzz 2.52b.
It fails as follows:

==
$ make clean
$ make
[*] Checking for the ability to compile x86 code...
[+] Everything seems to be working, ready to compile.
cc -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
set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $i; done
cc -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
cc -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
cc -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
cc -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
cc -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
cc -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
ln -sf afl-as as
[*] Testing the CC wrapper and instrumentation output...
unset AFL_USE_ASAN AFL_USE_MSAN; AFL_QUIET=1 AFL_INST_RATIO=100 AFL_PATH=.
./afl-gcc -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
echo 0 | ./afl-showmap -m none -q -o .test-instr0 ./test-instr
echo 1 | ./afl-showmap -m none -q -o .test-instr1 ./test-instr

Oops, the instrumentation does not seem to be behaving correctly!

Please ping <lca...@google.com> to troubleshoot the issue.

Makefile:90: recipe for target 'test_build' failed
make: *** [test_build] Error 1
==

Is this a known issue?
This is with the default compiler on ubuntu-18.04 i.e. gcc-7.3.
I wonder whether others can reproduce this issue.

Anyway, it's not blocking me, as I found that everything
works fine when building afl-fuzz with clang-6.0 instead
of gcc-7.3 as follows:

$ make clean
$ export CC=clang-6.0
$ make
...snip...
[+] All right, the instrumentation seems to be working!
[+] LLVM users: see llvm_mode/README.llvm for a faster alternative to
afl-gcc.
[+] All done! Be sure to review README - it's pretty short and useful.

Regards
Dominique

Daniel Stender

unread,
May 5, 2018, 3:17:35 PM5/5/18
to afl-users
Hi Dominique,

that's a recent problem we have [1] with the latest packages of gcc-7 (>= gcc-7.3.0-16) in
Debian [2]. Unfortunately, the (for afl) problematic packages made it into Ubuntu 18.04. This is
a problem with the deb packages and is going to be solved there, please watch out for updates.

Best,
Daniel Stender

[1] https://bugs.debian.org/895618 (FTBFS: the instrumentation does not seem to be behaving correctly)

[2] https://bugs.debian.org/896057 (gcc-7: doesn't look for "as" in dir specified by -B)


--
4096R/DF5182C8
Freier Devops Engineer
Tel.: +49 (0)160 9130 8437
Homepage: http://www.danielstender.com/

Jakub Wilk

unread,
May 5, 2018, 3:34:05 PM5/5/18
to afl-...@googlegroups.com
* Dominique Pellé <dominiq...@gmail.com>, 2018-05-05, 18:55:
>I found that everything works fine when building afl-fuzz with
>clang-6.0 instead of gcc-7.3 as follows:
>
>$ make clean
>$ export CC=clang-6.0
>$ make
>...snip...
>[+] All right, the instrumentation seems to be working!
>[+] LLVM users: see llvm_mode/README.llvm for a faster alternative to afl-gcc.
>[+] All done! Be sure to review README - it's pretty short and useful.

Note that if you set CC to clang, AFL's build system tests only
afl-clang's instrumentation, and that succeeds. But your afl-gcc is
still broken.

--
Jakub Wilk

Daniel Stender

unread,
May 9, 2018, 6:11:18 AM5/9/18
to afl-users
On 05/05/2018 09:17 PM, Daniel Stender wrote:
> Hi Dominique,
>
> that's a recent problem we have [1] with the latest packages of gcc-7 (>= gcc-7.3.0-16) in
> Debian [2]. Unfortunately, the (for afl) problematic packages made it into Ubuntu 18.04. This is
> a problem with the deb packages and is going to be solved there, please watch out for updates.
>
> Best,
> Daniel Stender
>
> [1] https://bugs.debian.org/895618 (FTBFS: the instrumentation does not seem to be behaving correctly)
>
> [2] https://bugs.debian.org/896057 (gcc-7: doesn't look for "as" in dir specified by -B)

gcc-7 7.3.0-18 solved the problem [1]. Thx to Jakub Wilk for spotting the problem and reporting
the bug against gcc-7.

Best,
Daniel Stender

[1] https://tracker.debian.org/media/packages/g/gcc-7/changelog-7.3.0-18

--
4096R/DF5182C8 (ste...@debian.org)
http://www.danielstender.com/

Bob McChesney

unread,
Sep 28, 2018, 6:48:37 AM9/28/18
to afl-users
Hello,

Just wanted to report that this appears to be fixed in Ubuntu 18.04. Updates to gcc-7 (7.3.0-27ubuntu1~18.04) in bionic-updates allow a working afl-gcc build. The update is still being phased by Canonical (only applied to 30% of users) so it needs to be manually updated with `apt upgrade gcc`. Output from build below:

[*] Checking for the ability to compile x86 code...
[+] Everything seems to be working, ready to compile.
cc -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
set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $i; done
cc -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
cc -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
cc -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
cc -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
cc -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
cc -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
ln -sf afl-as as
[*] Testing the CC wrapper and instrumentation output...
unset AFL_USE_ASAN AFL_USE_MSAN; AFL_QUIET=1 AFL_INST_RATIO=100 AFL_PATH=. ./afl-gcc -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
echo 0 | ./afl-showmap -m none -q -o .test-instr0 ./test-instr
echo 1 | ./afl-showmap -m none -q -o .test-instr1 ./test-instr
[+] All right, the instrumentation seems to be working!
[+] LLVM users: see llvm_mode/README.llvm for a faster alternative to afl-gcc.
[+] All done! Be sure to review README - it's pretty short and useful.

Regards,
Bob
Reply all
Reply to author
Forward
0 new messages