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

ICE: Option::unwrap() on a None value', compiler/rustc_metadata/src/native_libs.rs:61:48 #109144

Closed
matthiaskrgr opened this issue Mar 14, 2023 · 2 comments · Fixed by #109243
Closed
Assignees
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

#![crate_type = "lib"]
#[link(kind = "static", modifiers = "+whole-archive,+bundle")]
extern  {}

Meta

rustc --version --verbose:

rustc 1.70.0-nightly (22f247c6f 2023-03-13)
binary: rustc
commit-hash: 22f247c6f3ed388cb702d01c2ff27da658a8b353
commit-date: 2023-03-13
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7

Error output

<output>
Backtrace

error[E0459]: `#[link]` attribute requires a `name = "string"` argument
 --> treereduce.out:2:1
  |
2 | #[link(kind = "static", modifiers = "+whole-archive,+bundle")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `name` argument

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/native_libs.rs:61:48
stack backtrace:
   0:     0x7fd78fb6651a - std::backtrace_rs::backtrace::libunwind::trace::h1ac6254167c780d9
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fd78fb6651a - std::backtrace_rs::backtrace::trace_unsynchronized::hec2af85915e24f36
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd78fb6651a - std::sys_common::backtrace::_print_fmt::h58a4e3535fcce206
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fd78fb6651a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5107e13758b8321c
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fd78fbc9c5e - core::fmt::write::h2e851dc027730d81
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/core/src/fmt/mod.rs:1232:17
   5:     0x7fd78fb59375 - std::io::Write::write_fmt::hca00074de9f85084
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/io/mod.rs:1684:15
   6:     0x7fd78fb662e5 - std::sys_common::backtrace::_print::h870053c845cddf24
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fd78fb662e5 - std::sys_common::backtrace::print::hb56add862f96c5fd
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fd78fb6905f - std::panicking::default_hook::{{closure}}::h636d4ba3ff8fdc46
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:271:22
   9:     0x7fd78fb68d9b - std::panicking::default_hook::hf29b58145ee6e43c
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:290:9
  10:     0x7fd792e580c5 - <rustc_driver_impl[74350ec99973fded]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[2011dc7817943e09]::ops::function::FnOnce<(&core[2011dc7817943e09]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7fd78fb6989d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h7342d57f33f6634f
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/alloc/src/boxed.rs:2002:9
  12:     0x7fd78fb6989d - std::panicking::rust_panic_with_hook::hbf9ef936d990c16f
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:696:13
  13:     0x7fd78fb695d2 - std::panicking::begin_panic_handler::{{closure}}::h6be6433dcb901f4b
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:581:13
  14:     0x7fd78fb66986 - std::sys_common::backtrace::__rust_end_short_backtrace::h802b6104a4d80829
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:150:18
  15:     0x7fd78fb69322 - rust_begin_unwind
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:579:5
  16:     0x7fd78fbc5fb3 - core::panicking::panic_fmt::hf7a8a88b9669732e
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/core/src/panicking.rs:64:14
  17:     0x7fd78fbc604d - core::panicking::panic::h23010f9a5cb8b3d2
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/core/src/panicking.rs:114:5
  18:     0x7fd79231318e - rustc_metadata[5ce6e0a8b92ac9d4]::native_libs::find_bundled_library
  19:     0x7fd792311117 - rustc_metadata[5ce6e0a8b92ac9d4]::native_libs::collect
  20:     0x7fd792310af5 - <rustc_metadata[5ce6e0a8b92ac9d4]::rmeta::decoder::cstore_impl::provide::{closure#4} as core[2011dc7817943e09]::ops::function::FnOnce<(rustc_middle[eaae5d2a0b8f0144]::ty::context::TyCtxt, rustc_span[18b84908941c7cdf]::def_id::CrateNum)>>::call_once
  21:     0x7fd792481d95 - rustc_query_system[f881c7f40ee7dcf0]::query::plumbing::try_execute_query::<rustc_query_impl[eb95ff51c492efdd]::queries::native_libraries, rustc_query_impl[eb95ff51c492efdd]::plumbing::QueryCtxt>
  22:     0x7fd7924819eb - <rustc_query_impl[eb95ff51c492efdd]::Queries as rustc_middle[eaae5d2a0b8f0144]::ty::query::QueryEngine>::native_libraries
  23:     0x7fd79210cb4a - <rustc_metadata[5ce6e0a8b92ac9d4]::rmeta::encoder::EncodeContext>::encode_crate_root
  24:     0x7fd7920a2f86 - rustc_metadata[5ce6e0a8b92ac9d4]::rmeta::encoder::encode_metadata_impl
  25:     0x7fd79209d33c - rustc_data_structures[75b47a18491287a9]::sync::join::<rustc_metadata[5ce6e0a8b92ac9d4]::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata[5ce6e0a8b92ac9d4]::rmeta::encoder::encode_metadata::{closure#1}, (), ()>
  26:     0x7fd79209d051 - rustc_metadata[5ce6e0a8b92ac9d4]::rmeta::encoder::encode_metadata
  27:     0x7fd79209c25a - rustc_metadata[5ce6e0a8b92ac9d4]::fs::encode_and_write_metadata
  28:     0x7fd79209589e - rustc_interface[ceda1fd77ec39e1b]::passes::start_codegen
  29:     0x7fd7920923b8 - <rustc_middle[eaae5d2a0b8f0144]::ty::context::GlobalCtxt>::enter::<<rustc_interface[ceda1fd77ec39e1b]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[2011dc7817943e09]::result::Result<alloc[b7ae3602ac956de8]::boxed::Box<dyn core[2011dc7817943e09]::any::Any>, rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>
  30:     0x7fd7920901e4 - <rustc_interface[ceda1fd77ec39e1b]::queries::Queries>::ongoing_codegen
  31:     0x7fd79208ef3c - rustc_span[18b84908941c7cdf]::with_source_map::<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_interface[ceda1fd77ec39e1b]::interface::run_compiler<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_driver_impl[74350ec99973fded]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  32:     0x7fd79208616c - std[1337fb43929788f1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ceda1fd77ec39e1b]::util::run_in_thread_pool_with_globals<rustc_interface[ceda1fd77ec39e1b]::interface::run_compiler<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_driver_impl[74350ec99973fded]::run_compiler::{closure#1}>::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>
  33:     0x7fd792085b9a - <<std[1337fb43929788f1]::thread::Builder>::spawn_unchecked_<rustc_interface[ceda1fd77ec39e1b]::util::run_in_thread_pool_with_globals<rustc_interface[ceda1fd77ec39e1b]::interface::run_compiler<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_driver_impl[74350ec99973fded]::run_compiler::{closure#1}>::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>::{closure#1} as core[2011dc7817943e09]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  34:     0x7fd78fb73793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7e0474dd3b8659fa
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/alloc/src/boxed.rs:1988:9
  35:     0x7fd78fb73793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::heb8c41cf543a5c11
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/alloc/src/boxed.rs:1988:9
  36:     0x7fd78fb73793 - std::sys::unix::thread::Thread::new::thread_start::hc791abe67253fe06
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys/unix/thread.rs:108:17
  37:     0x7fd78f905bb5 - <unknown>
  38:     0x7fd78f987d90 - <unknown>
  39:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.70.0-nightly (22f247c6f 2023-03-13) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [native_libraries] looking up the native libraries of a linked crate
end of query stack
error: aborting due to previous error

For more information about this error, try `rustc --explain E0459`

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Mar 14, 2023
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Mar 15, 2023
@matthiaskrgr
Copy link
Member Author

searched toolchains 585f3ee through 5b8f284

Regression in 51cb561

@langston-barrett
Copy link

@rustbot label +S-bug-has-mcve

@rustbot rustbot added the S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue label Mar 18, 2023
@bors bors closed this as completed in 1f0fcf1 Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants