Issue |
126242
|
Summary |
Corrupted profile header, while building coverage for PostgreSQL with `%p` in `LLVM_PROFILE_FILE`
|
Labels |
new issue
|
Assignees |
|
Reporter |
nataraj-hates-MS-for-stealing-github
|
I am PostgreSQL developer, I am trying to build coverage for PosrtgreSQL tests with clang, and meet "corrupted profile header" error when I am using `%p` in `LLVM_PROFILE_FILE`.
How to reproduce:
```
git clone git://git.postgresql.org/git/postgresql.git -b REL_17_STABLE
cd postgres
CC=clang LD=clang CXX=clang++ CFLAGS="-fprofile-instr-generate -fcoverage-mapping" ./configure --enable-debug --enable-cassert --enable-tap-tests
make world-bin -j8
rm -rf `pwd`/../profile
mkdir `pwd`/../profile
LLVM_PROFILE_FILE=`pwd`/../profile/%p_%m.profraw make check-world
llvm-profdata merge -output=../merged.profdata ../profile/*
```
You will get error message like
```
warning: ../profile/559020_695054008901113306_0.profraw: invalid instrumentation profile data (file header is corrupt)
warning: ../profile/578083_695054008901113306_0.profraw: invalid instrumentation profile data (file header is corrupt)
warning: ../profile/558952_695054008901113306_0.profraw: invalid instrumentation profile data (file header is corrupt)
error: no profile can be merged
```
And your profile dir will be as large as 9Gb
After https://github.com/llvm/llvm-project/pull/123963 fix have been merged into main branch, you can replace `%p` with` %b` in `LLVM_PROFILE_FILE` variable, configure postgres with `-Wl,--build-id ` added to `CFLAGS`, and will get `profile` dir as large as 7Mb, and you can build proper html coverage from it.
But still if you add `%p` to `LLVM_PROFILE_FILE` everything will stop working the same way, it did not work before. `%p_%m_%b` leads to same corrupted headers.
`%p` is not compatible with PostgreSQL tests somehow, and I guess this indicates to some problem that should be fixed.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs