[Bug 1770342] [NEW] afl no longer builds from source with gcc-7; doesn't look for "as" in dir specified by -B

Bob McChesney 1770342 at bugs.launchpad.net
Thu May 10 07:42:35 UTC 2018


Public bug reported:

This issue began upstream recently before Ubuntu 18.04 was released,
when 7.3.0-16 was introduced and fixed the following issue:

* Use triplet-prefixed as and ld (Helmut Grohne). Addresses: #895251.

As can be seen in the continuous integration for afl
(https://ci.debian.net/packages/a/afl/unstable/amd64/), the build failed
tests from 2018-04-12 until 2018-05-08 (when version 7.3.0-18 arrived).

A bug report for the issue was raised (https://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=896057) and has been closed with the release of
7.3.0-18.

The symptom looks as follows by building afl from source (from
http://lcamtuf.coredump.cx/afl/):

bob at BOB2:~/afl-2.52b$ 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 <lcamtuf at google.com> to troubleshoot the issue.

Makefile:90: recipe for target 'test_build' failed
make: *** [test_build] Error 1
bob at BOB2:~/afl-2.52b$

I've tested Debian before and after and can confirm that 7.3.0-18
resolves the problem.

It would be very desirable to have this fixed in Ubuntu 18.04 as it's
supported for 5 years, and afl is a popular tool that benefits from
being rebuilt from source periodically.

Anything I'm doing wrong here in reporting this issue, please don't
hesitate to berate. I'm keen for this to get resolved and I'm willing to
do some work helping to fix. If that involves proposing a patch, that's
fine but I might need some guidance about how to make the proposal.

Thanks.

** Affects: gcc-7 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: afl afl-gcc as gcc-7 ld triplet-prefixed

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-7 in Ubuntu.
https://bugs.launchpad.net/bugs/1770342

Title:
  afl no longer builds from source with gcc-7; doesn't look for "as" in
  dir specified by -B

Status in gcc-7 package in Ubuntu:
  New

Bug description:
  This issue began upstream recently before Ubuntu 18.04 was released,
  when 7.3.0-16 was introduced and fixed the following issue:

  * Use triplet-prefixed as and ld (Helmut Grohne). Addresses: #895251.

  As can be seen in the continuous integration for afl
  (https://ci.debian.net/packages/a/afl/unstable/amd64/), the build
  failed tests from 2018-04-12 until 2018-05-08 (when version 7.3.0-18
  arrived).

  A bug report for the issue was raised (https://bugs.debian.org/cgi-
  bin/bugreport.cgi?bug=896057) and has been closed with the release of
  7.3.0-18.

  The symptom looks as follows by building afl from source (from
  http://lcamtuf.coredump.cx/afl/):

  bob at BOB2:~/afl-2.52b$ 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 <lcamtuf at google.com> to troubleshoot the issue.

  Makefile:90: recipe for target 'test_build' failed
  make: *** [test_build] Error 1
  bob at BOB2:~/afl-2.52b$

  I've tested Debian before and after and can confirm that 7.3.0-18
  resolves the problem.

  It would be very desirable to have this fixed in Ubuntu 18.04 as it's
  supported for 5 years, and afl is a popular tool that benefits from
  being rebuilt from source periodically.

  Anything I'm doing wrong here in reporting this issue, please don't
  hesitate to berate. I'm keen for this to get resolved and I'm willing
  to do some work helping to fix. If that involves proposing a patch,
  that's fine but I might need some guidance about how to make the
  proposal.

  Thanks.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-7/+bug/1770342/+subscriptions



More information about the foundations-bugs mailing list