Bug#1070358: clang-16: -fsanitize=fuzzer not working on trixie (but working on bookworm)

Theodore Y. Ts'o tytso at mit.edu
Sat May 4 14:52:02 BST 2024


Package: clang-16
Version: 1:16.0.6-26
Severity: normal

Dear Maintainer,

I was trying to track down a regression reported by the ClusterFuzz
service, and when I try to build the fuzzing reproducer on trixie, it
fails.  However, it works on Bookworm.  So while I can work around the
problem by using the Bookworm chroot, this is not a great long-term
solution.

There are two problems; the first is that clang isn't finding the
algorithm header file.   Using e2fsprogs sources with:

configure CC=clang-16 CFLAGS=-g CXX=clang++-16 --enable-fuzzing --enable-ubsan

% cd tests/fuzz
% make V=1 ext2fs_image_read_write_fuzzer
clang++-16 -c -I. -I../../lib -I/usr/projects/e2fsprogs/e2fsprogs/lib -fsanitize=undefined   -g -I/usr/include/fuse3  -pthread  -DHAVE_CONFIG_H -fsanitize=fuzzer /usr/projects/e2fsprogs/e2fsprogs/tests/fuzz/ext2fs_image_read_write_fuzzer.cc -o ext2fs_image_read_write_fuzzer.o
In file included from /usr/projects/e2fsprogs/e2fsprogs/tests/fuzz/ext2fs_image_read_write_fuzzer.cc:27:
/usr/lib/llvm-16/lib/clang/16/include/fuzzer/FuzzedDataProvider.h:16:10: fatal error: 
      'algorithm' file not found
#include <algorithm>
         ^~~~~~~~~~~
1 error generated.

The second problem is that it's not finding -lstdc++:
% make V=1 ext2fs_check_directory_fuzzer
clang++-16 -fsanitize=undefined   -pthread    -fsanitize=fuzzer -o ext2fs_check_directory_fuzzer ext2fs_check_directory_fuzzer.o  ../../lib/libsupport.a ../../lib/libe2p.a ../../lib/libext2fs.a ../../lib/libcom_err.a  -lpthread
/bin/ld: cannot find -lstdc++: No such file or directory
/bin/ld: cannot find -lstdc++: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:392: ext2fs_check_directory_fuzzer] Error 1

Now, this works on bookworm, using clang-14.  I've also tried using
clang-14 on trixie, and it's failing there too.  I'm guessing it's some
kind of missing package, but it's really unclear what the package should
be.  I do have libc++16-dev and libc++--dev installed, which is what I
*think* should be the right package to get stdc++, but it's apparently
not being found.   Help?

-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (900, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.6.15-amd64 (SMP w/20 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages clang-16 depends on:
ii  binutils                2.42-4
ii  libc6                   2.37-19
ii  libc6-dev               2.37-19
ii  libclang-common-16-dev  1:16.0.6-26
ii  libclang-cpp16t64       1:16.0.6-26
ii  libclang1-16t64         1:16.0.6-26
ii  libgcc-13-dev           13.2.0-24
ii  libllvm16t64            1:16.0.6-26
ii  libobjc-13-dev          13.2.0-24
ii  libstdc++-13-dev        13.2.0-24
ii  libstdc++6              14-20240330-1
ii  llvm-16-linker-tools    1:16.0.6-26

Versions of packages clang-16 recommends:
ii  llvm-16-dev  1:16.0.6-26
ii  python3      3.11.8-1

Versions of packages clang-16 suggests:
pn  clang-16-doc  <none>
pn  wasi-libc     <none>

-- no debconf information



More information about the Pkg-llvm-team mailing list