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

no MIR available for DefId #92755

Closed
msshhp opened this issue Jan 11, 2022 · 8 comments · Fixed by #92781
Closed

no MIR available for DefId #92755

msshhp opened this issue Jan 11, 2022 · 8 comments · Fixed by #92781
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@msshhp
Copy link

msshhp commented Jan 11, 2022

EDIT (ehuss) Reproduction:
Clone https://github.com/bytecodealliance/wasmtime
cd crates/cranelift
cargo build

Code

https://github.com/massalabs/massa/wiki/run

Meta

rustc --version --verbose:

rustc 1.60.0-nightly (89b9f7b28 2022-01-10)
binary: rustc
commit-hash: 89b9f7b284aacc5f8613438b80e4dd7bdd10549e
commit-date: 2022-01-10
host: x86_64-unknown-linux-gnu
release: 1.60.0-nightly
LLVM version: 13.0.0

Error output

error: internal compiler error: compiler/rustc_monomorphize/src/collector.rs:966:9: no MIR available for DefId(20:9953 ~ cranelift_codegen[5733]::machinst::buffer::{impl#3}::get_srclocs_sorted)

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1169:9
Backtrace

   Compiling hyper v0.14.16
   Compiling wasmer-compiler v2.1.1
   Compiling cranelift-frontend v0.76.0
   Compiling wasmer-engine v2.1.1
   Compiling wasmer-object v2.1.1
error: internal compiler error: compiler/rustc_monomorphize/src/collector.rs:966:9: no MIR available for DefId(20:9953 ~ cranelift_codegen[5733]::machinst::buffer::{impl#3}::get_srclocs_sorted)

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1169:9
stack backtrace:
   0:     0x7faba428de2c - std::backtrace_rs::backtrace::libunwind::trace::hee56aa883c63acb5
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7faba428de2c - std::backtrace_rs::backtrace::trace_unsynchronized::he7cac0994dc78c4c
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7faba428de2c - std::sys_common::backtrace::_print_fmt::hdc12a102f76753bd
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7faba428de2c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf7faa06c147903ce
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7faba42eeb1c - core::fmt::write::h66e8369cb6d370fa
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/core/src/fmt/mod.rs:1168:17
   5:     0x7faba427d273 - std::io::Write::write_fmt::h74797452eefbc651
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/io/mod.rs:1653:15
   6:     0x7faba42922f2 - std::sys_common::backtrace::_print::h82e64c28f7109909
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7faba42922f2 - std::sys_common::backtrace::print::hef2d97a7e889059a
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7faba42922f2 - std::panicking::default_hook::{{closure}}::hc4f2f631c593350e
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/panicking.rs:211:50
   9:     0x7faba4291ed5 - std::panicking::default_hook::he01061695065e502
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/panicking.rs:228:9
  10:     0x7faba4a827a1 - rustc_driver[124b6e8ee7de516c]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fab93aa0059 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h00f3561862254d21
  12:     0x7fab93aa2fdb - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h63e29122066ffecb
  13:     0x7faba4292aa5 - std::panicking::rust_panic_with_hook::h3ad36e38c2432eec
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/panicking.rs:610:17
  14:     0x7faba5bd435b - std[916c2bf46ef025b0]::panicking::begin_panic::<rustc_errors[106e1e27ea6e8b93]::ExplicitBug>::{closure#0}
  15:     0x7faba5bd42d6 - std[916c2bf46ef025b0]::sys_common::backtrace::__rust_end_short_backtrace::<std[916c2bf46ef025b0]::panicking::begin_panic<rustc_errors[106e1e27ea6e8b93]::ExplicitBug>::{closure#0}, !>
  16:     0x7faba5bd85df - std[916c2bf46ef025b0]::panicking::begin_panic::<rustc_errors[106e1e27ea6e8b93]::ExplicitBug>
  17:     0x7faba5be314d - std[916c2bf46ef025b0]::panic::panic_any::<rustc_errors[106e1e27ea6e8b93]::ExplicitBug>
  18:     0x7faba5be23dd - <rustc_errors[106e1e27ea6e8b93]::HandlerInner>::bug
  19:     0x7faba5be1ec0 - <rustc_errors[106e1e27ea6e8b93]::Handler>::bug
  20:     0x7faba5a6ef59 - rustc_middle[c28a39089ade0ee0]::ty::context::tls::with_opt::<rustc_middle[c28a39089ade0ee0]::util::bug::opt_span_bug_fmt<rustc_span[e53caedf36619d5c]::span_encoding::Span>::{closure#0}, ()>
  21:     0x7faba5a6fae0 - rustc_middle[c28a39089ade0ee0]::util::bug::opt_span_bug_fmt::<rustc_span[e53caedf36619d5c]::span_encoding::Span>
  22:     0x7faba5a6fa56 - rustc_middle[c28a39089ade0ee0]::util::bug::bug_fmt
  23:     0x7faba5dcfd50 - rustc_monomorphize[2b914775a192fc39]::collector::collect_neighbours
  24:     0x7faba5dc7ab5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  25:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  26:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  27:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  28:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  29:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  30:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  31:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  32:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  33:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  34:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  35:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  36:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  37:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  38:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  39:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  40:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  41:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  42:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  43:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  44:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  45:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  46:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  47:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  48:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  49:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  50:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  51:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  52:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  53:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  54:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  55:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  56:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  57:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  58:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  59:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  60:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  61:     0x7faba5dc7bf5 - rustc_monomorphize[2b914775a192fc39]::collector::collect_items_rec
  62:     0x7faba6ade82f - <rustc_session[10fb4eff5f95d231]::session::Session>::time::<(), rustc_monomorphize[2b914775a192fc39]::collector::collect_crate_mono_items::{closure#1}>
  63:     0x7faba6ae7039 - rustc_monomorphize[2b914775a192fc39]::collector::collect_crate_mono_items
  64:     0x7faba6ae57f3 - rustc_monomorphize[2b914775a192fc39]::partitioning::collect_and_partition_mono_items
  65:     0x7faba6dfff78 - rustc_query_system[9128b41c1b585745]::query::plumbing::try_execute_query::<rustc_query_impl[1a0f6329139f4bdf]::plumbing::QueryCtxt, rustc_query_system[9128b41c1b585745]::query::caches::DefaultCache<(), (&std[916c2bf46ef025b0]::collections::hash::set::HashSet<rustc_span[e53caedf36619d5c]::def_id::DefId, core[764d4fa4047e6cd7]::hash::BuildHasherDefault<rustc_hash[e786982ea05e1693]::FxHasher>>, &[rustc_middle[c28a39089ade0ee0]::mir::mono::CodegenUnit])>>
  66:     0x7faba6e4ed10 - rustc_query_system[9128b41c1b585745]::query::plumbing::get_query::<rustc_query_impl[1a0f6329139f4bdf]::queries::collect_and_partition_mono_items, rustc_query_impl[1a0f6329139f4bdf]::plumbing::QueryCtxt>
  67:     0x7faba6e9291e - <rustc_query_impl[1a0f6329139f4bdf]::Queries as rustc_middle[c28a39089ade0ee0]::ty::query::QueryEngine>::collect_and_partition_mono_items
  68:     0x7faba69bb4ca - <rustc_codegen_llvm[4f8001fe24439afd]::LlvmCodegenBackend as rustc_codegen_ssa[a8846c18ea6747a9]::traits::backend::CodegenBackend>::codegen_crate
  69:     0x7faba6971b17 - <rustc_session[10fb4eff5f95d231]::session::Session>::time::<alloc[fda8cd89518443b]::boxed::Box<dyn core[764d4fa4047e6cd7]::any::Any>, rustc_interface[11117f0be3129212]::passes::start_codegen::{closure#0}>
  70:     0x7faba6957116 - <rustc_interface[11117f0be3129212]::queries::Queries>::ongoing_codegen
  71:     0x7faba6931544 - <rustc_interface[11117f0be3129212]::interface::Compiler>::enter::<rustc_driver[124b6e8ee7de516c]::run_compiler::{closure#1}::{closure#2}, core[764d4fa4047e6cd7]::result::Result<core[764d4fa4047e6cd7]::option::Option<rustc_interface[11117f0be3129212]::queries::Linker>, rustc_errors[106e1e27ea6e8b93]::ErrorReported>>
  72:     0x7faba691310c - rustc_span[e53caedf36619d5c]::with_source_map::<core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>, rustc_interface[11117f0be3129212]::interface::create_compiler_and_run<core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>, rustc_driver[124b6e8ee7de516c]::run_compiler::{closure#1}>::{closure#1}>
  73:     0x7faba69308ce - rustc_interface[11117f0be3129212]::interface::create_compiler_and_run::<core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>, rustc_driver[124b6e8ee7de516c]::run_compiler::{closure#1}>
  74:     0x7faba691466b - <scoped_tls[f562bb10605cb79e]::ScopedKey<rustc_span[e53caedf36619d5c]::SessionGlobals>>::set::<rustc_interface[11117f0be3129212]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[11117f0be3129212]::interface::run_compiler<core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>, rustc_driver[124b6e8ee7de516c]::run_compiler::{closure#1}>::{closure#0}, core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>>::{closure#0}::{closure#0}, core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>>
  75:     0x7faba6914465 - std[916c2bf46ef025b0]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[11117f0be3129212]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[11117f0be3129212]::interface::run_compiler<core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>, rustc_driver[124b6e8ee7de516c]::run_compiler::{closure#1}>::{closure#0}, core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>>::{closure#0}, core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>>
  76:     0x7faba6940e89 - <<std[916c2bf46ef025b0]::thread::Builder>::spawn_unchecked<rustc_interface[11117f0be3129212]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[11117f0be3129212]::interface::run_compiler<core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>, rustc_driver[124b6e8ee7de516c]::run_compiler::{closure#1}>::{closure#0}, core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>>::{closure#0}, core[764d4fa4047e6cd7]::result::Result<(), rustc_errors[106e1e27ea6e8b93]::ErrorReported>>::{closure#1} as core[764d4fa4047e6cd7]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  77:     0x7faba429dff3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2bcfd99b08705230
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/alloc/src/boxed.rs:1854:9
  78:     0x7faba429dff3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0f130cf6103d60eb
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/alloc/src/boxed.rs:1854:9
  79:     0x7faba429dff3 - std::sys::unix::thread::Thread::new::thread_start::h6f8833ccf099272e
                               at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/sys/unix/thread.rs:108:17
  80:     0x7faba41d0609 - start_thread
  81:     0x7faba40ea293 - clone
  82:                0x0 - <unknown>

note: 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.60.0-nightly (89b9f7b28 2022-01-10) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C embed-bitcode=no --crate-type lib

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

query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: could not compile `wasmer-compiler-cranelift`
warning: build failed, waiting for other jobs to finish...
error: build failed

@msshhp msshhp added C-bug Category: This is a bug. 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. labels Jan 11, 2022
@gilescope
Copy link
Contributor

We are seeing this too on rustc 1.60.0-nightly (89b9f7b 2022-01-10) running on aarch64-apple-darwin

@Patrick-Poitras
Copy link
Contributor

@rustbot label +I-prioritize

@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jan 11, 2022
@ehuss ehuss changed the title rustc 1.60.0-nightly (89b9f7b28 2022-01-10) unexpectedly panicked no MIR available for DefId Jan 11, 2022
@ehuss ehuss pinned this issue Jan 11, 2022
@ehuss
Copy link
Contributor

ehuss commented Jan 11, 2022

cc @lambinoo @petrochenkov This seems to have regressed starting with #87487.

@lambinoo
Copy link
Contributor

I'm taking a look

@lambinoo
Copy link
Contributor

lambinoo commented Jan 11, 2022

I can reproduce and I did find some differences in the access level table.
get_srclocs_sorted seems to be missing when it's supposed to be Reachable in the good version. I'll investigate further

Updates: Actually, the whole Impl seems to be missing. It should be marked as Reachable but is not even there.
@rustbot claim

@camelid camelid added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Jan 11, 2022
@camelid camelid added this to the 1.60.0 milestone Jan 11, 2022
@inquisitivecrystal
Copy link
Contributor

Marking as P-critical, as discussed by the prioritization working group.

@inquisitivecrystal inquisitivecrystal added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jan 11, 2022
@binadamu-isiyoonekana
Copy link

binadamu-isiyoonekana commented Jan 12, 2022

We are seeing this too on rustc 1.60.0-nightly (89b9f7b 2022-01-10) running on aarch64-apple-darwin

Same on Mac, on x86_64-apple-darwin as well, same toolchain version (rustc 1.60.0-nightly (89b9f7b 2022-01-10))

@inquisitivecrystal
Copy link
Contributor

inquisitivecrystal commented Jan 12, 2022

As an update for those watching: currently, the best workaround is to use an older nightly. The good news is that a fix PR is open (#92781), with people working on getting it in shape to be merged.

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. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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.

9 participants