Skip to content

[ICE]: unsupported instrumentation profile format version #139198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 4 tasks
yuhui518 opened this issue Apr 1, 2025 · 7 comments
Closed
1 of 4 tasks

[ICE]: unsupported instrumentation profile format version #139198

yuhui518 opened this issue Apr 1, 2025 · 7 comments
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@yuhui518
Copy link

yuhui518 commented Apr 1, 2025

Code

Affected release channels

  • Previous Stable
  • Current Stable
  • Current Beta
  • Current Nightly

Rust Version

rustc --version --verbose
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-unknown-linux-gnu
release: 1.81.0
LLVM version: 18.1.7

Current error output

My issue is:
warning: /tmp/.tmpfHs8e8/cov-21560-15860613078634779016_0_1.profraw: unsupported instrumentation profile format version
error: no profile can be merged
12:42:34 [ERROR] Error while executing llvm tools: Failure while running "/linux/llvm/bin/llvm-profdata" "merge" "-f" "-" "-sparse" "-o" "/tmp/.tmpfHs8e8/0/grcov.profdata"

[root@localhost ut]# cargo -V
warning: /root/.cargo/config is deprecated in favor of config.toml
note: if you need to support cargo 1.38 or earlier, you can symlink config to config.toml
cargo 1.81.0 (2dbb1af80 2024-08-20)

[root@localhost bin]#./llvm-profdata show --version
LLVM (http://llvm.org/):
LLVM version 15.0.4
Optimized build.
Default target: x86_64-unknown-linux-gnu

[root@localhost bin]# ./clang --version
clang version 15.0.4 (llvm-project 9176a70a8154b7ab1764e6e94f6ab58bc9f9b189)
Target: x86_64-unknown-linux-gnu

Llvm-profdata and clang is same version,I don't know why this problem occurred?

Backtrace

1:build my code
RUSTFLAGS="-C instrument-coverage -C link-arg=--target=aarch64-unknown-linux-ohos -C linker=/home/llvm/bin/clang -C link-arg=-lpixman-1" cargo test --workspace --target=aarch64-unknown-linux-ohos --features "boot_time" --exclude mod_test --exclude ozone --no-run
2.run my binary file
export STRATOVIRT_COV=on  && export LLVM_PROFILE_FILE=/data/coverage/mst/profraw/cov-%%p-%%m.profraw
./boot_time --test-threads=1
3.put /data/coverage/mst/profraw/cov-%%p-%%m.profraw to my directory
4.grcov ../profraw -s . --binary-path ./target/aarch64-unknown-linux-ohos/debug --llvm-path /home/llvm/bin/ -t html -o ../ut-cov

Anything else?

No response

@yuhui518 yuhui518 added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 1, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 1, 2025
@yuhui518
Copy link
Author

yuhui518 commented Apr 1, 2025

My llvm-tool version is not 18.1.7,
it is 15.0.4

@moxian
Copy link
Contributor

moxian commented Apr 1, 2025

@rustbot label: +A-code-coverage -I-ICE +A-llvm

@rustbot rustbot added A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Apr 1, 2025
@moxian
Copy link
Contributor

moxian commented Apr 1, 2025

My llvm-tool version is not 18.1.7,
it is 15.0.4

If I were to guess, this is exactly the problem. Rust internally bundles in LLVM, which is newer than the one you have on your system. You will need to either upgrade your system llvm to 18, or downgrade rustc to the version that bundles LLVM 15, which would be rustc-1.69.0 or earlier

@yuhui518
Copy link
Author

yuhui518 commented Apr 1, 2025

My llvm-tool version is not 18.1.7,
it is 15.0.4

If I were to guess, this is exactly the problem. Rust internally bundles in LLVM, which is newer than the one you have on your system. You will need to either upgrade your system llvm to 18, or downgrade rustc to the version that bundles LLVM 15, which would be rustc-1.69.0 or earlier

Thanks for your reply.I will try it according to your method.And then,come over and reply.

@yuhui518
Copy link
Author

yuhui518 commented Apr 8, 2025

@moxian
May I ask if the versions of RUST and LLVM must correspond one-to-one?
Or LLVM's version may be higher than RUST's version?

@moxian
Copy link
Contributor

moxian commented Apr 8, 2025

I don't know - I'm not an expert here.

I assume llvm can be higher version, but that's only an educated guess.

@yuhui518
Copy link
Author

Now,I have solved this problem.
My grcov command is:
grcov ../profraw -s . --binary-path ./target/aarch64-unknown-linux-ohos/debug --llvm-path /home/llvm/bin/ -t html -o ../ut-cov
but now is:
grcov ../profraw -s . --binary-path ./target/aarch64-unknown-linux-ohos/debug -t html -o ../ut-cov
I removed the "--llvm-path" parameter,then this error has disappeared.
Thanks for your reply.@moxian

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants