[PATCH] D37631: [libFuzzer] Support using libc++

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 08:48:17 PST 2017


phosek added a comment.

In https://reviews.llvm.org/D37631#947770, @vitalybuka wrote:

> In https://reviews.llvm.org/D37631#947752, @phosek wrote:
>
> > Turned out the problem was an incompatibility between libc++abi (which libc++ assumes as the default C++ ABI) and libstdc++ (which is what is being used when linking against libstdc++). Setting `-DLIBCXX_CXX_ABI=none` seems to be the solution. I'm still trying to figure what's the best way to tests against libc++, simply linking them isn't enough because `libc++.so.1` is not in the default dynamic linker search path.
>
>
> I assume because of this the patch is not finished yet?
>
> If I apply the patch, check-fuzzer does not work for me. I see output like following and I don't see test command-line has path to libc++
>
>   FAIL: LLVMFuzzer :: fuzzer-customcrossover.test (19 of 147)
>   ******************** TEST 'LLVMFuzzer :: fuzzer-customcrossover.test' FAILED ********************
>   Script:
>   --
>   ./bin/clang -std=c++11 -lstdc++ -gline-tables-only  -fsanitize=address,fuzzer -Icompiler-rt/lib/fuzzer compiler-rt/test/fuzzer/CustomCrossOverTest.cpp -o projects/compiler-rt/test/fuzzer/Output/fuzzer-customcrossover.test.tmp-CustomCrossOverTest
>   not projects/compiler-rt/test/fuzzer/Output/fuzzer-customcrossover.test.tmp-CustomCrossOverTest -seed=1 -runs=1000000                2>&1 | FileCheck compiler-rt/test/fuzzer/fuzzer-customcrossover.test --check-prefix=CHECK_CO
>   projects/compiler-rt/test/fuzzer/Output/fuzzer-customcrossover.test.tmp-CustomCrossOverTest -seed=1 -runs=1000000 -cross_over=0 2>&1 | FileCheck compiler-rt/test/fuzzer/fuzzer-customcrossover.test --check-prefix=CHECK_NO_CO
>   --
>   Exit Code: 1
>  
>   Command Output (stderr):
>   --
>   compiler-rt/test/fuzzer/fuzzer-customcrossover.test:8:11: error: expected string not found in input
>   CHECK_CO: BINGO
>             ^
>   <stdin>:9:30: note: scanning from here
>   In LLVMFuzzerCustomCrossover uncaught_exceptions not yet implemented
>                                ^
>   <stdin>:17:142: note: possible intended match here
>    #6 0x45a425 in std::uncaught_exceptions() (projects/compiler-rt/test/fuzzer/Output/fuzzer-customcrossover.test.tmp-CustomCrossOverTest+0x45a425)
>                                                                                                                                               ^
>


Yes, I'm still debugging the test failures. I see the same error, but only when using GCC as a host compiler. There's another issue when using Clang with libc++ as the host C++ library. These errors are related to exceptions implementation which uses non-versioned types unlike the rest of libc++'s implementation which is something that @EricWF mentioned in his comment. I'm trying to figure if I could disable exceptions altogether from the private libc++ since those shouldn't be needed for libFuzzer.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D37631





More information about the llvm-commits mailing list