[compiler-rt] [libFuzzer] Fix incorrect coverage number in fork mode (PR #82335)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 02:26:19 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Scallop Ye (yescallop)

<details>
<summary>Changes</summary>

Closes #<!-- -->82307.

I tried to build LLVM and test the changes but failed with the following error:
```
/usr/bin/ld: cannot find /home/ye/work/llvm-project/build/lib/clang/19/lib/linux/libclang_rt.fuzzer-x86_64.a: No such file or directory
/usr/bin/ld: cannot find /home/ye/work/llvm-project/build/lib/clang/19/lib/linux/libclang_rt.fuzzer_interceptors-x86_64.a: No such file or directory
/usr/bin/ld: cannot find /home/ye/work/llvm-project/build/lib/clang/19/lib/linux/libclang_rt.ubsan_standalone-x86_64.a: No such file or directory
/usr/bin/ld: cannot find /home/ye/work/llvm-project/build/lib/clang/19/lib/linux/libclang_rt.ubsan_standalone_cxx-x86_64.a: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```
I have no idea how to fix this. It'd be nice if you could help me with testing the changes.

---
Full diff: https://github.com/llvm/llvm-project/pull/82335.diff


1 Files Affected:

- (modified) compiler-rt/lib/fuzzer/FuzzerFork.cpp (+1-1) 


``````````diff
diff --git a/compiler-rt/lib/fuzzer/FuzzerFork.cpp b/compiler-rt/lib/fuzzer/FuzzerFork.cpp
index c248a1d246a306..e544cd846e4db5 100644
--- a/compiler-rt/lib/fuzzer/FuzzerFork.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerFork.cpp
@@ -349,7 +349,7 @@ void FuzzWithFork(Random &Rand, const FuzzingOptions &Options,
                         &NewFeatures, Env.Cov, &NewCov, CFPath,
                         /*Verbose=*/false, /*IsSetCoverMerge=*/false);
     Env.Features.insert(NewFeatures.begin(), NewFeatures.end());
-    Env.Cov.insert(NewFeatures.begin(), NewFeatures.end());
+    Env.Cov.insert(NewCov.begin(), NewCov.end());
     RemoveFile(CFPath);
   }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/82335


More information about the llvm-commits mailing list