Closed Quessou closed 1 year ago
Aha I see it now, so when a program is compiled with LLVM coverage instrumentation, it's up to the compiler to insert some LLVM IR instructions to annotate regions and locations etc which then gets turned into instrumentation and the compiler bundles in a runtime to handle collecting and emitting the data.
The specific bug looks to be in a branch region, something which the rust compiler currently doesn't use as it only outputs line information. Whereas clang will likely output everything given it has first class support for this stuff - and has had it a lot longer
Also, don't worry about nightly failures - looks like Rust has updated it's llvm version and I need to add support to it (at least just test files). For 1.60 it says that a dependency has bumped the MSRV so change it to 1.64 and I'll just bump my minimum version as well (1.64 feels old enough to be a conservative bump)
Aha I see it now, so when a program is compiled with LLVM coverage instrumentation, it's up to the compiler to insert some LLVM IR instructions to annotate regions and locations etc which then gets turned into instrumentation and the compiler bundles in a runtime to handle collecting and emitting the data.
The specific bug looks to be in a branch region, something which the rust compiler currently doesn't use as it only outputs line information. Whereas clang will likely output everything given it has first class support for this stuff - and has had it a lot longer
Ok, that explains everything, thanks for the insight :D Since the bug seemed to happen only in what looked like edge cases from the outside, I did not look thoroughly into the parsing algorithm, thinking that if there was an issue there, it would've appeared much earlier, while using profparser on vaguely complex rust programs. Huge mistake from my side lmao
Bump version is done btw
Cool LGTM!
... new byte from bytes buffer in parse_mapping_regions.
The crash is gone, the output seem relevant to me, but a double check on this may be more than welcome !
However I'm a bit curious about how the entire llvm-profparser could even remotely work even though counter parsing was apparently quite dysfunctional and was causing parsing offsets, a bit of enlightenment for my own culture here would be welcome ! :)