rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
94.9k stars 12.23k forks source link

bulid panic #125971

Open yylq opened 1 month ago

yylq commented 1 month ago
Compiling tokio-util v0.7.11
   Compiling want v0.3.1
   Compiling syn v1.0.109
   Compiling tinyvec v1.6.0
thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/decoder.rs:712:36:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7f8752b9a892 - std::backtrace_rs::backtrace::libunwind::trace::he4ee80166a02c846
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x7f8752b9a892 - std::backtrace_rs::backtrace::trace_unsynchronized::h476faccf57e88641
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f8752b9a892 - std::sys_common::backtrace::_print_fmt::h430c922a77e7a59c
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f8752b9a892 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hffecb437d922f988
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f8752beba6c - core::fmt::rt::Argument::fmt::hf3df69369399bfa9
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/rt.rs:142:9
   5:     0x7f8752beba6c - core::fmt::write::hd9a8d7d029f9ea1a
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/mod.rs:1153:17
   6:     0x7f8752b8f78f - std::io::Write::write_fmt::h0e1226b2b8d973fe
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/io/mod.rs:1843:15
   7:     0x7f8752b9a664 - std::sys_common::backtrace::_print::hd2df4a083f6e69b8
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f8752b9a664 - std::sys_common::backtrace::print::he907f6ad7eee41cb
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f8752b9d35b - std::panicking::default_hook::{{closure}}::h3926193b61c9ca9b
  10:     0x7f8752b9d0b3 - std::panicking::default_hook::h25ba2457dea68e65
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:292:9
  11:     0x7f874f95745d - std[e4dfbc2c3f4b09f1]::panicking::update_hook::<alloc[1adba907b9db1888]::boxed::Box<rustc_driver_impl[24a943716c49befe]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f8752b9dac0 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h022ca2c0d8c21c9e
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2034:9
  13:     0x7f8752b9dac0 - std::panicking::rust_panic_with_hook::h0ad14d90dcf5224f
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:783:13
  14:     0x7f8752b9d7c9 - std::panicking::begin_panic_handler::{{closure}}::h4a1838a06f542647
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:649:13
  15:     0x7f8752b9ad66 - std::sys_common::backtrace::__rust_end_short_backtrace::h77cc4dc3567ca904
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f8752b9d534 - rust_begin_unwind
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
  17:     0x7f8752be7f85 - core::panicking::panic_fmt::h940d4fd01a4b4fd1
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
  18:     0x7f8752be8043 - core::panicking::panic::h8ddd58dc57c2dc00
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:145:5
  19:     0x7f8752be7d16 - core::option::unwrap_failed::hf59153bb1e2fc334
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/option.rs:1985:5
  20:     0x7f8751619648 - <rustc_metadata[70192afe97828208]::locator::CrateLocator>::extract_one
  21:     0x7f87516188cb - <rustc_metadata[70192afe97828208]::locator::CrateLocator>::extract_lib
  22:     0x7f87516181de - <rustc_metadata[70192afe97828208]::creader::CrateLoader>::load
  23:     0x7f875160f153 - <rustc_metadata[70192afe97828208]::creader::CrateLoader>::maybe_resolve_crate
  24:     0x7f875160d4e5 - <rustc_metadata[70192afe97828208]::creader::CrateLoader>::maybe_process_path_extern
  25:     0x7f87511af604 - <rustc_resolve[e749dedf3894f9b6]::Resolver>::early_resolve_ident_in_lexical_scope
  26:     0x7f87511c2441 - <rustc_resolve[e749dedf3894f9b6]::Resolver>::resolve_path_with_ribs
  27:     0x7f87511a436d - <rustc_resolve[e749dedf3894f9b6]::Resolver as rustc_expand[af7ad4d1f9fa58f8]::base::ResolverExpand>::resolve_imports
  28:     0x7f875109f929 - <rustc_expand[af7ad4d1f9fa58f8]::expand::MacroExpander>::fully_expand_fragment
  29:     0x7f8751840991 - <rustc_expand[af7ad4d1f9fa58f8]::expand::MacroExpander>::expand_crate
  30:     0x7f87510d2e12 - rustc_interface[ba2b6dc4c96cb491]::passes::resolver_for_lowering_raw
  31:     0x7f87510d22db - rustc_query_impl[e4152ad88c3d6c78]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e4152ad88c3d6c78]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[fda44fdb505d3e7f]::query::erase::Erased<[u8; 16usize]>>
  32:     0x7f87510d22c9 - <rustc_query_impl[e4152ad88c3d6c78]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2} as core[836963c7c1decc11]::ops::function::FnOnce<(rustc_middle[fda44fdb505d3e7f]::ty::context::TyCtxt, ())>>::call_once
  33:     0x7f87518abc7b - rustc_query_system[475239fef39bf53f]::query::plumbing::try_execute_query::<rustc_query_impl[e4152ad88c3d6c78]::DynamicConfig<rustc_query_system[475239fef39bf53f]::query::caches::SingleCache<rustc_middle[fda44fdb505d3e7f]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[e4152ad88c3d6c78]::plumbing::QueryCtxt, false>
  34:     0x7f87518ab7a4 - rustc_query_impl[e4152ad88c3d6c78]::query_impl::resolver_for_lowering_raw::get_query_non_incr::__rust_end_short_backtrace
  35:     0x7f875172b6d4 - rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler::<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}
  36:     0x7f8751a6db6e - std[e4dfbc2c3f4b09f1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ba2b6dc4c96cb491]::util::run_in_thread_with_globals<rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>
  37:     0x7f8751a6d9ca - <<std[e4dfbc2c3f4b09f1]::thread::Builder>::spawn_unchecked_<rustc_interface[ba2b6dc4c96cb491]::util::run_in_thread_with_globals<rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#1} as core[836963c7c1decc11]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  38:     0x7f8752ba7145 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h19b9e642d37e7272
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2020:9
  39:     0x7f8752ba7145 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h97265befc434d3ae
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2020:9
  40:     0x7f8752ba7145 - std::sys::pal::unix::thread::Thread::new::thread_start::h420dad5cf01a9f35
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys/pal/unix/thread.rs:108:17
  41:     0x7f874c50eea5 - start_thread
  42:     0x7f874c237b0d - clone
  43:                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.78.0 (9b00956e5 2024-04-29) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [resolver_for_lowering_raw] getting the resolver for lowering
end of query stack
error: could not compile `tinyvec` (lib)
samundra commented 1 month ago

How is this a bug? you are trying to use .unwrap() on None value. Some reproducible could would help developers?

zachs18 commented 1 month ago

@samundra

How is this a bug? you are trying to use .unwrap() on None value.

This error message is coming from the compiler itself. There is code in the compiler itself which used .unwrap() on a None value, not in the code being compiled.

saethlin commented 1 month ago

@yylq is it possible for you to tell us what project you were compiling so that we can reproduce the crash?

(To others: Note the lack of -Cincremental in the flags)