-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
coverage: Avoid ICE when coverage_cx
is unexpectedly unavailable
#132395
Conversation
cc @orlp |
a827383
to
cef4697
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
cef4697
to
8dddd1a
Compare
r? jieyouxu |
coverage: Avoid ICE when `coverage_cx` is unexpectedly unavailable In rust-lang#132124, `coverage_cx()` was changed to panic if the context was unavailable, under the assumption that it would always be available whenever coverage instrumentation is enabled. However, there have been reports of this change causing ICEs in `polars` CI. I don't yet understand why this is happening, but for now it seems wisest to revert that part of the change, restoring the two early returns that had been replaced with panics.
I think this occurs when instrumented code is MIR-inlined into a crate that is being built without coverage. (This is an uncommon configuration, because cargo makes it hard to do mixed-coverage builds, and usually people want their leaf crates to be instrumented. But it can happen when enabling coverage via RUSTFLAGS, and then running doctests, because the doctests ignore the normal RUSTFLAGS and get built without coverage, then inline code from the main crates that has coverage instrumentation.) |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#130693 (Add `minicore` test auxiliary and support `//@ add-core-stubs` directive in ui/assembly/codegen tests) - rust-lang#132316 (CI: use free runners for 3 fast windows jobs) - rust-lang#132354 (Add `lp64e` RISC-V ABI) - rust-lang#132395 (coverage: Avoid ICE when `coverage_cx` is unexpectedly unavailable) - rust-lang#132396 (CI: use free runners for x86_64-gnu-tools and x86_64-rust-for-linux) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132395 - Zalathar:coverage-cx-ice, r=jieyouxu coverage: Avoid ICE when `coverage_cx` is unexpectedly unavailable In rust-lang#132124, `coverage_cx()` was changed to panic if the context was unavailable, under the assumption that it would always be available whenever coverage instrumentation is enabled. However, there have been reports of this change causing ICEs in `polars` CI. I don't yet understand why this is happening, but for now it seems wisest to revert that part of the change, restoring the two early returns that had been replaced with panics.
After thinking some more, it’s not just MIR inlining. Any time code from crate A (coverage on) appears in crate B (coverage off) for any reason (e.g. I don’t think there’s a good solution for this in the foreseeable future, but we at least want to not ICE when it happens. |
…r=jieyouxu coverage: Regression test for inlining into an uninstrumented crate Regression test for rust-lang#132395, after I was able to figure out a simple way to reproduce it. See also rust-lang#132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
…r=jieyouxu coverage: Regression test for inlining into an uninstrumented crate Regression test for rust-lang#132395, after I was able to figure out a simple way to reproduce it. See also rust-lang#132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
…r=jieyouxu coverage: Regression test for inlining into an uninstrumented crate Regression test for rust-lang#132395, after I was able to figure out a simple way to reproduce it. See also rust-lang#132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
…r=jieyouxu coverage: Regression test for inlining into an uninstrumented crate Regression test for rust-lang#132395, after I was able to figure out a simple way to reproduce it. See also rust-lang#132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
…r=jieyouxu coverage: Regression test for inlining into an uninstrumented crate Regression test for rust-lang#132395, after I was able to figure out a simple way to reproduce it. See also rust-lang#132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
…r=jieyouxu coverage: Regression test for inlining into an uninstrumented crate Regression test for rust-lang#132395, after I was able to figure out a simple way to reproduce it. See also rust-lang#132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
…r=jieyouxu coverage: Regression test for inlining into an uninstrumented crate Regression test for rust-lang#132395, after I was able to figure out a simple way to reproduce it. See also rust-lang#132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
…r=jieyouxu coverage: Regression test for inlining into an uninstrumented crate Regression test for rust-lang#132395, after I was able to figure out a simple way to reproduce it. See also rust-lang#132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
…r=jieyouxu coverage: Regression test for inlining into an uninstrumented crate Regression test for rust-lang#132395, after I was able to figure out a simple way to reproduce it. See also rust-lang#132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
Rollup merge of rust-lang#132437 - Zalathar:inline-mixed-regression, r=jieyouxu coverage: Regression test for inlining into an uninstrumented crate Regression test for rust-lang#132395, after I was able to figure out a simple way to reproduce it. See also rust-lang#132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
In #132124,
coverage_cx()
was changed to panic if the context was unavailable, under the assumption that it would always be available whenever coverage instrumentation is enabled.However, there have been reports of this change causing ICEs in
polars
CI.I don't yet understand why this is happening, but for now it seems wisest to revert that part of the change, restoring the two early returns that had been replaced with panics.