Skip to content
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

thread 'main' panicked at 'assertion failed: !require_bitcode', src/tools/cargo/src/cargo/core/compiler/lto.rs:49:9 #8223

Closed
matthiaskrgr opened this issue May 8, 2020 · 6 comments · Fixed by #8226
Labels
C-bug Category: bug

Comments

@matthiaskrgr
Copy link
Member

Problem
Cargo crashed while running cargo test --verbose --release --all -- --nocapture

Steps

  1. git clone https://github.com/matthiaskrgr/cargo-cache
  2. cd cargo-cache
  3. cargo test --verbose --release --all -- --nocapture
thread 'main' panicked at 'assertion failed: !require_bitcode', src/tools/cargo/src/cargo/core/compiler/lto.rs:49:9
stack backtrace:
   0:     0x5576ca9d9414 - backtrace::backtrace::libunwind::trace::hfcd33194db0151d4
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1:     0x5576ca9d9414 - backtrace::backtrace::trace_unsynchronized::hfd1904bbbd5335b5
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2:     0x5576ca9d9414 - std::sys_common::backtrace::_print_fmt::h8476c57b177b254e
                               at src/libstd/sys_common/backtrace.rs:78
   3:     0x5576ca9d9414 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h73acbc5f6d4b1044
                               at src/libstd/sys_common/backtrace.rs:59
   4:     0x5576caa0a01c - core::fmt::write::hdf236390fbd68d3d
                               at src/libcore/fmt/mod.rs:1069
   5:     0x5576ca9d0263 - std::io::Write::write_fmt::h5722fa40bb2afafd
                               at src/libstd/io/mod.rs:1532
   6:     0x5576ca9dd855 - std::sys_common::backtrace::_print::ha468e873aada7c78
                               at src/libstd/sys_common/backtrace.rs:62
   7:     0x5576ca9dd855 - std::sys_common::backtrace::print::h149365a2f029de62
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x5576ca9dd855 - std::panicking::default_hook::{{closure}}::hb4a33f9e05934a52
                               at src/libstd/panicking.rs:198
   9:     0x5576ca9dd592 - std::panicking::default_hook::hc4535d7b0c743abd
                               at src/libstd/panicking.rs:218
  10:     0x5576ca9dde98 - std::panicking::rust_panic_with_hook::haa34a96a6dbd5a2e
                               at src/libstd/panicking.rs:477
  11:     0x5576ca1c795e - std::panicking::begin_panic::h54777bf21989e629
  12:     0x5576ca3fd96d - cargo::core::compiler::lto::calculate::h2c312886d32a1e71
  13:     0x5576ca3fd655 - cargo::core::compiler::lto::calculate::h2c312886d32a1e71
  14:     0x5576ca3fd400 - cargo::core::compiler::lto::generate::hcdd45fe57c462183
  15:     0x5576ca167ced - cargo::core::compiler::context::Context::compile::hf7238f9b1b494d22
  16:     0x5576ca17aacb - cargo::ops::cargo_compile::compile_ws::hdf6433bf0283fe69
  17:     0x5576ca17a829 - cargo::ops::cargo_compile::compile::h97828d679d0d8fb3
  18:     0x5576ca42259d - cargo::ops::cargo_test::run_tests::hc9fee41bd4cdba5f
  19:     0x5576ca0e9f8a - cargo::commands::test::exec::hcb9e98bd91b0a043
  20:     0x5576ca0a3fa9 - cargo::cli::main::h4be78871f8deb501
  21:     0x5576ca1004b9 - cargo::main::h9724f8a40f7eb19e
  22:     0x5576ca0dd813 - std::rt::lang_start::{{closure}}::h8a8f11796b55167b
  23:     0x5576ca9de338 - std::rt::lang_start_internal::{{closure}}::h8ee41efd8ae7ff76
                               at src/libstd/rt.rs:52
  24:     0x5576ca9de338 - std::panicking::try::do_call::h0a4c4514ee6ebbfc
                               at src/libstd/panicking.rs:297
  25:     0x5576ca9de338 - std::panicking::try::h7c2f3858e42d7516
                               at src/libstd/panicking.rs:274
  26:     0x5576ca9de338 - std::panic::catch_unwind::h76c4030fa5655c1e
                               at src/libstd/panic.rs:394
  27:     0x5576ca9de338 - std::rt::lang_start_internal::h1c1398259f72ace6
                               at src/libstd/rt.rs:51
  28:     0x5576ca102a02 - main
  29:     0x7ff6a3efb023 - __libc_start_main
  30:     0x5576ca093029 - <unknown>

Possible Solution(s)

Notes

Output of cargo version:
cargo 1.45.0-nightly (f534844c2 2020-05-06)

@matthiaskrgr matthiaskrgr added the C-bug Category: bug label May 8, 2020
@matthiaskrgr
Copy link
Member Author

The assertion was added in #8192

@matthiaskrgr
Copy link
Member Author

Cargo no longer panics if I remove the lto = field from my Cargo.toml

@hbina
Copy link
Contributor

hbina commented May 8, 2020

I cannot reproduce this on my end.

@matthiaskrgr
Copy link
Member Author

Did you make sure that you are on latest nightly (rustc 1.45.0-nightly (a08c47310 2020-05-07))?

This happens on my GHA setup as well.

@hbina
Copy link
Contributor

hbina commented May 8, 2020

ah yes, cargo +nightly test --verbose --release --all -- --nocapture immediately fails that assertion.

@alexcrichton
Copy link
Member

Thanks for the bug report and reproduction steps! This shoudl be fixed in #8226.

bors added a commit that referenced this issue May 8, 2020
Update assertions in LTO calculations

Turns out a case I thought didn't happen can indeed happen. Units may
depend on other units which are LTO-able because integration tests can
depend on binaries. Handle that case internally and remove a few panics.

Closes #8223
@bors bors closed this as completed in 2a97225 May 8, 2020
bors added a commit to rust-lang-ci/rust that referenced this issue May 9, 2020
…mulacrum

submodules: update cargo from f534844c2 to cb06cb269

Changes:
````
more clippy fixes
Document that bench is unstable in the man page.
Update assertions in LTO calculations
Updated comments in resolve.rs to reflect actual data strcture used.
Try to remove secrets from http.debug.
Revert always computing filename Metadata.
clean -p: call `get_many` once.
Implement new `clean -p` using globs.
Rework how Cargo computes the rustc file outputs.
Add CrateType to replace LibKind.
````

I'd like to get the fix for rust-lang/cargo#8223 into nightly asap.

r? @ehuss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants