Closed Minoru closed 10 months ago
I also see this. I guess it's a result of LLVM version skew in the first instance, that rustc doesn't ship with the LLVM distribution it links against for use by end-users in the second instance, but the wider problem is that there is no tested, supported coverage tooling for Rust. This is a frustrating situation.
Almost the same issue, with the same project, this time caused by Rust's upgrade to LLVM 12:
searched nightlies: from nightly-2021-03-01 to nightly-2021-03-10 regressed nightly: nightly-2021-03-05 searched commits: from https://github.com/rust-lang/rust/commit/476acbf1e9965b5e95c90f0d7d658709812b7003 to https://github.com/rust-lang/rust/commit/45b3c28518e4c45dfd12bc2c4400c0d0e9639927 regressed commit: https://github.com/rust-lang/rust/commit/409920873cf8a95739a55dc5fe5adb05e1b4758e
This time it segfaults all over the place: in Rust's stdlib, in gcov, or it just hangs waiting for something inside pthreads.
Compiling C++ with Clang 12 works around the issue. Still can't provide a minimal reproducer because the causes for SIGSEGV are all different and seem to be intertwined with the test harness (Catch2). So building my project seems the only way to reproduce this :(
Triage: Can you still reproduce this?
My CI still uses Clang 12 and up-to-date Nightly, and I haven't seen that config fail since March 2021. So at least this doesn't happen every time rustc bumps its LLVM version.
Would you like me to reproduce with Clang 8 and current Nightly?
For my repro of this issue:
rustc doesn't ship with the LLVM distribution it links against for use by end-users in the second instance,
I think this was mostly ameliorated by rustup shipping llvm-tools (#85658).
but the wider problem is that there is no tested, supported coverage tooling for Rust.
I now use https://crates.io/crates/cargo-llvm-cov for this, which is a significantly improved experience over driving the llvm tools myself, and insulates me from worrying about LLVM version skew.
Sorry for being unclear! I meant "can you reproduce with the latest versions of everything?". Sounds as if the answer is "no"? Then we close this issue I believe?
Well, the original issue didn't happen when everything was at latest versions -- it only occurred when Clang was older than the LLVM used by rustc. But given that modern rustc doesn't seem to have any problems with (slightly old) Clang 12, I think this issue is no longer important and can indeed be closed.
I have a program where C++ code calls into Rust code. To calculate test coverage, I compile the Rust part with a Nightly, and C++ part with Clang 8. I then run a C++ test suite. This worked fine until recently, but now segfaults. C++ test suite receives SIGSEGV while writing out the coverage info:
I observe this behaviour with Clang 8 and 9. With Clang 10, things are simply bizarre: the test suite reports numerous SIGSEGVs and then declares that all tests passed; I can't explain such behaviour. With Clang 11, the test suite passes without issue.
bisect-rustc narrowed this down to a recent upgrade to LLVM 11:
searched nightlies: from nightly-2020-08-23 to nightly-2020-08-29 regressed nightly: nightly-2020-08-24 searched commits: from https://github.com/rust-lang/rust/commit/663d2f5cd3163f17eddb74ee1e028d542255f21a to https://github.com/rust-lang/rust/commit/5180f3da5fd72627a8d38558ad1297df38793acd regressed commit: https://github.com/rust-lang/rust/commit/7ce71c362be9a89e7897ac066aba6e3e6f747800
bisected with cargo-bisect-rustc v0.5.2
Host triple: x86_64-unknown-linux-gnu Reproduce with: ```bash cargo bisect-rustc --preserve --with-cargo --host x86_64-unknown-linux-gnu --script ./evaluate.sh ```The
evaluate.sh
is:The project in question can be cloned from https://github.com/newsboat/newsboat.git I failed to write a small reproducer: it appears that I do need the Catch2 test framework and a lot of other code to trigger this.