[PATCH] D30307: Fix insertion of `sanitizer_cov_trace_pc_guard` insertion in optimized code with debug info

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 13:03:46 PST 2017


mehdi_amini added a comment.

In https://reviews.llvm.org/D30307#684976, @kcc wrote:

> LGTM
>  (but not claiming to understand the problem)


OK, so this patch might not be needed (even though having a better failure here could be helpful). I returned to my original test case to have another look. The verifier is crashing so no need for llc, I updated the test-case. What is needed is the *definition* for the runtime function. This seems to indicate that I'm instrumenting the runtime, which does not seem correct.
My clang is crashing when building for running `make check-fuzzer` right now, this is how I hit this.

The crash happened in llvm/lib/Fuzzer/FuzzerTracePC.cpp with this invocation:

/Users/mehdi_amini/projects/vanilla/clang/ReleaseAssert/bin/clang++   -DLLVM_BUILD_GLOBAL_ISEL -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Fuzzer -I/Users/mehdi_amini/projects/vanilla/clang/llvm-project/llvm/lib/Fuzzer -Iinclude -I/Users/mehdi_amini/projects/vanilla/clang/llvm-project/llvm/include -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -fno-omit-frame-pointer -O1 -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp -fcolor-diagnostics -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters -Werror  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -MD -MT lib/Fuzzer/CMakeFiles/LLVMFuzzerNoMainObjects.dir/FuzzerTracePC.cpp.o -MF lib/Fuzzer/CMakeFiles/LLVMFuzzerNoMainObjects.dir/FuzzerTracePC.cpp.o.d -o lib/Fuzzer/CMakeFiles/LLVMFuzzerNoMainObjects.dir/FuzzerTracePC.cpp.o -c /Users/mehdi_amini/projects/vanilla/clang/llvm-project/llvm/lib/Fuzzer/FuzzerTracePC.cpp    -g

See the `-fsanitize-coverage=trace-pc-guard,..` without `trace-pc-guard` being present in the `-fno-sanitize-coverage`. I think I'm faulty as I was playing with the CMakefiles right now.


https://reviews.llvm.org/D30307





More information about the llvm-commits mailing list