You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The profile runtime checks __llvm_profile_raw_version at runtime so that if you compile something with a version of LLVM that doesn't match that of the profile runtime, the runtime aborts. This is fine if all your compiled code comes from the same compiler, but falls apart when combining them.
For example, as of writing, rustc stable through nightly use LLVM 13. We used in combination of clang trunk (currently 14), things can go pretty badly without noticing until it's too late:
Here, the profile runtime found __llvm_profile_raw_version from the C object file rather than the one from the rust library. (Ideally, the linker would complain that all the linked in __llvm_profile_raw_version symbols don't have the same content... but it probably isn't allowed to).
The result seemingly worked... until you try to actually use the resulting profile:
$ llvm-profdata show default_15853215676058847363_0.profraw
error: default_15853215676058847363_0.profraw: malformed instrumentation profile data: counter offset 666194 is greater than the maximum number of counters 2
The text was updated successfully, but these errors were encountered:
Any updates? I got the same issue during ClickHouse PGO optimization with Clang. Is there a way to avoid this problem?
Error:
llvm-profdata merge -o converted_profile.profdata profile_with_out_of_memory.profraw
warning: profile_with_out_of_memory.profraw: malformed instrumentation profile data: counter offset 42403480 is greater than the maximum counter offset 41111143
error: no profile can be merged
(Ideally, the linker would complain that all the linked in __llvm_profile_raw_version symbols don't have the same content... but it probably isn't allowed to).
Agree. The upper 32 bits of __llvm_profile_raw_version are reserved for other variant modes of profile, only the lower 32 bits indicate the real version number. I'm not sure when different modes are used if it's valid to mix them together. If it's valid, maybe we need another symbol to indicate the real version number.
The profile runtime checks
__llvm_profile_raw_version
at runtime so that if you compile something with a version of LLVM that doesn't match that of the profile runtime, the runtime aborts. This is fine if all your compiled code comes from the same compiler, but falls apart when combining them.For example, as of writing, rustc stable through nightly use LLVM 13. We used in combination of clang trunk (currently 14), things can go pretty badly without noticing until it's too late:
Here, the profile runtime found
__llvm_profile_raw_version
from the C object file rather than the one from the rust library. (Ideally, the linker would complain that all the linked in__llvm_profile_raw_version
symbols don't have the same content... but it probably isn't allowed to).The result seemingly worked... until you try to actually use the resulting profile:
The text was updated successfully, but these errors were encountered: