Issue |
81477
|
Summary |
Coverage with `GCOV_PREFIX` not working as expected
|
Labels |
new issue
|
Assignees |
|
Reporter |
dothebart
|
I've chosen a minimal project with cmake to demonstrate this.
My Host is a debian bookworm, however in ubuntu docker containers clang-16 has shown similar behaviour.
The version of the compiler:
```
clang++-16 --version
Debian clang version 16.0.6 (15~deb12u1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
And its set up as the default compiler:
```
/usr/bin/c++ --version
Debian clang version 16.0.6 (15~deb12u1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
along with:
```
/usr/bin/ld --version
Debian LLD 16.0.6 (compatible with GNU linkers)
```
Now the instructions to generate a small c++ project within this environment:
```
git clone https://github.com/arangodb/velocypack
cd velocypack
mkdir build ; cd build
rm -rf * ; cmake .. -DCMAKE_CXX_FLAGS='-fprofile-instr-generate -fcoverage-mapping -mllvm -runtime-counter-relocation --coverage' -DCMAKE_C_FLAGS='-fprofile-instr-generate -fcoverage-mapping -mllvm -runtime-counter-relocation --coverage' -DCMAKE_LD_FLAGS='-fprofile-instr-generate -fcoverage-mapping -mllvm -runtime-counter-relocation --coverage'; make -j 32
export GCOV_PREFIX=/tmp/blub
./tools/fuzzer
export GCOV_PREFIX=/tmp/bluub
./tools/fuzzer
```
It seems that without `--coverage` in the arguments `strings` shows a binary containing `GCOV_PREFIX`, however, the functionality doesn't seem to be enabled, no profile is collected with the information specified above.
And then try to merge the two profile sets demonstrates the error:
```
llvm-profdata-16 merge /tmp/blub /tmp/bluub -o /tmp/234
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Builder.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Builder.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/fpconv.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/fpconv.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Exception.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Exception.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/HexDump.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/HexDump.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Options.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Options.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Value.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Value.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Dumper.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Dumper.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/asm-utf8check.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/asm-utf8check.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Utf8Helper.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Utf8Helper.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/ValueType.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/ValueType.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/xxhash.c.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/xxhash.c.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Slice.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Slice.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Parser.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Parser.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/asm-functions.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/asm-functions.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Validator.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/CMakeFiles/velocypack.dir/src/Validator.cpp.gcda: truncated profile data
warning: /tmp/blub/tmp/velocypack/build/tools/CMakeFiles/fuzzer.dir/fuzzer.cpp.gcda: truncated profile data
warning: /tmp/bluub/tmp/velocypack/build/tools/CMakeFiles/fuzzer.dir/fuzzer.cpp.gcda: truncated profile data
error: no profile can be merged
```
I've seen https://github.com/llvm/llvm-project/issues/50966 but am not sure whether its related.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs