- Don't sanitize __sancov_lowest_stack.
- Don't instrument leaf functions.
- Add CoverageStackDepth to Fuzzer and FuzzerNoLink.
- Only enable on Linux.
Details
- Reviewers
vitalybuka kcc george.karpenkov - Commits
- rG034126e5070a: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
rG2ad8d948b26a: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
rGf42bd3132325: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
rCRT312185: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
rCRT312026: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
rCRT311801: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
rC312185: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
rC312026: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
rC311801: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
rL312185: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
rL312026: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
rL311801: [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
Diff Detail
- Build Status
Buildable 9744 Build 9744: arc lint + arc unit
Event Timeline
Did you check this on something other than the unit tests?
E.g. a couple of benchmarks from fuzzer-test-suite?
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp | ||
---|---|---|
177 | we already have a linear scan in SanitizerCoverageModule::runOnFunction -- don't introduce a second one. You can simply extend the loop in runOnFunction to set a flag if the function has non-intrin calls/ invokes |
Turns out I should have been testing the benchmarks with FUZZING_ENGINE=fsanitize_fuzzer. My mistake.
After adding the weak reference to SanitizerCoverage.cpp, both lcms and proj4 build with fsanitize_fuzzer.
+George, in case he knows about attribute((tls_model("initial-exec"))) on Mac
compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc | ||
---|---|---|
219 | I wonder if this going to work on Mac. |
@kcc I've disabled the relevant test on Mac in r311916, please revert my change once this CR goes through.
- Only enable stack depth tracking on Linux.
- Ignore __sancov_lowest_stack in interface symbols tests.
please use if(SomeCondition) instead of #if
In general: 99% of cases where you may want to use #if -- you shouldn't