Swatinem / fucov

A GitHub Action that does single-action code coverage generation.
8 stars 3 forks source link

Malformed instrumentation profile date #3

Closed pacman82 closed 2 years ago

pacman82 commented 3 years ago

Hi, first of all thanks for providing such a nice GitHub action.

I used it in my project for a while, but sadly it started failing recently. See here: https://github.com/pacman82/odbc-api/runs/3580154985

It emits warnings about "malformed instrumentation profile data" and goes on to error out on an attempt to merge these. Am I missing anything obvious?

Cheers, Markus

Swatinem commented 3 years ago

I haven't seen this error yet so far. Is it intermittent? Either way, I am away from my devices for yet another week, and check after that.

pacman82 commented 3 years ago

Thanks for the quick reply and no rush. The GitHub action worked reliably at first. I can not tell exactly then, but since it started failing it does so always.

Swatinem commented 3 years ago

I also saw this on the sentry-rust repo that I maintain. I hope I can have a look during the week.

pacman82 commented 3 years ago

FYI: I branched from the last working commit and triggered the Job again resulting in the same error. Since neither the codebase, nor the GitHub Actions changed it is likely that something in the surrounding toolchains changed (maybe Rust nightly?).

Swatinem commented 3 years ago

Yes, that is my understanding as well. So I might reproduce the steps manually. Maybe also the way these things work has changed in Rust which would necessitate changes to the action. Well, it is nightly after all and things might break at any time.

pacman82 commented 3 years ago

In case you get to it, I'll be curious to see what your diagnostics yield. Hm, that sentry-rust repository of yours might also come in handy one day.

Swatinem commented 2 years ago

https://github.com/rust-lang/rust/pull/91424

This adds a bit more diagnostics to guide the Rust developers in diagnosing the root cause of this problem.

pacman82 commented 2 years ago

Nice to see some progres.

Swatinem commented 2 years ago

So the changes to rustc/llvm improved the error reporting a bit:

malformed instrumentation profile data: insufficient padding

I was looking a bit at where that error originates, and ran a few experiments. Turns out splitting up the llvm-profdata merge invocation into batches solved this problem at least for sentry-rust (is combination for adding another %m placeholder: https://github.com/getsentry/sentry-rust/runs/4729270573?check_suite_focus=true

In the end, I might as well retire this action and rather advocate for https://github.com/taiki-e/cargo-llvm-cov#continuous-integration

I’m trying that in CI right now, lets see what kind of results it generates.

pacman82 commented 2 years ago

Thanks for the link to cargo-llv-cov. I'll give it a spin.

pacman82 commented 2 years ago

FYI: cargo-llvm-cov worked like a charm. Thanks again for the link!