Skip to content

[Internal compiler error] missing MIR for DefId(7/0:8 ~ cortex_m_rt[ba29]::lang_items[0]::start[0]) #48519

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

Closed
niklasad1 opened this issue Feb 24, 2018 · 3 comments

Comments

@niklasad1
Copy link

Summary

Hi,
I tried building the crate cortex-m-quickstart

Issue

By using the following option

$ xargo build --target thumbv7m-none-eabi --example hello

The compiler crashes

Backtrace

error: internal compiler error: librustc_metadata/cstore_impl.rs:131: get_optimized_mir: missing MIR for `DefId(7/0:8 ~ cortex_m_rt[ba29]::lang_items[0]::start[0])`

thread 'rustc' panicked at 'Box<Any>', librustc_errors/lib.rs:535:9
stack backtrace:
   0:     0x7f91f34a0dd3 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h8b81594645a24a27
                               at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x7f91f3498284 - std::sys_common::backtrace::_print::h9bc07d566820e560
                               at libstd/sys_common/backtrace.rs:71
   2:     0x7f91f349d9dd - std::panicking::default_hook::{{closure}}::h8061f115b067df97
                               at libstd/sys_common/backtrace.rs:59
                               at libstd/panicking.rs:380
   3:     0x7f91f349d6e2 - std::panicking::default_hook::hd067eb3eb1a62c48
                               at libstd/panicking.rs:396
   4:     0x7f91f349de50 - std::panicking::rust_panic_with_hook::h45183031f05ee04c
                               at libstd/panicking.rs:576
   5:     0x7f91ef035458 - std::panicking::begin_panic::h70fa20d14e5a4ddc
   6:     0x7f91ef0570e5 - rustc_errors::Handler::bug::h2904d9bdcd541660
   7:     0x7f91f020883f - rustc::session::opt_span_bug_fmt::{{closure}}::h4c61b14203cd7ef9
   8:     0x7f91f02bfb35 - rustc::ty::context::tls::with_opt::{{closure}}::ha844ec3aba1227ce
   9:     0x7f91eff076af - <std::thread::local::LocalKey<T>>::try_with::hcb9878a339eb8184
  10:     0x7f91eff07246 - <std::thread::local::LocalKey<T>>::with::h0e7a6f77ef5003ad
  11:     0x7f91f02bf846 - rustc::ty::context::tls::with::h76fef2b9234bce83
  12:     0x7f91f02bfae7 - rustc::ty::context::tls::with_opt::hcffffd6da58fec15
  13:     0x7f91f0208744 - rustc::session::opt_span_bug_fmt::h2670479fe31ed596
  14:     0x7f91f0208606 - rustc::session::bug_fmt::hcb5a7103fba7bc90
  15:     0x7f91f1bf5559 - rustc_metadata::cstore_impl::provide_extern::optimized_mir::h2b8092d8086279cf
  16:     0x7f91f00b1839 - rustc::dep_graph::graph::DepGraph::with_task_impl::hea0bff9ad23e8d9d
  17:     0x7f91f0378909 - rustc::ty::maps::<impl rustc::ty::maps::queries::optimized_mir<'tcx>>::force::h2a013a1ceee4a829
  18:     0x7f91f0379466 - rustc::ty::maps::<impl rustc::ty::maps::queries::optimized_mir<'tcx>>::try_get::he58f4a5856cbcfcd
  19:     0x7f91f04871da - rustc::ty::maps::TyCtxtAt::optimized_mir::hf8d473ea184aa7da
  20:     0x7f91f02d750d - rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::instance_mir::h05068563e01c8813
  21:     0x7f91f0ed3845 - rustc_mir::monomorphize::collector::collect_items_rec::hb5c49ef42474d3b7
  22:     0x7f91f0ed3053 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h43e3331c1491c656
  23:     0x7f91e86c36b1 - rustc_trans::base::collect_and_partition_translation_items::h667c557b0c893845
  24:     0x7f91f0098afc - rustc::dep_graph::graph::DepGraph::with_task_impl::h7d3113ca1706e263
  25:     0x7f91f045eca1 - rustc::ty::maps::<impl rustc::ty::maps::queries::collect_and_partition_translation_items<'tcx>>::force::hdb41ca31cf6c6f5d
  26:     0x7f91f045f823 - rustc::ty::maps::<impl rustc::ty::maps::queries::collect_and_partition_translation_items<'tcx>>::try_get::h866a092f65a06f6b
  27:     0x7f91f048c775 - rustc::ty::maps::TyCtxtAt::collect_and_partition_translation_items::h034204a218ee8b34
  28:     0x7f91f048573e - rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::collect_and_partition_translation_items::h73a73cb71fea4e24
  29:     0x7f91e86bf07b - rustc_trans::base::trans_crate::ha8659d307fbf5033
  30:     0x7f91e871bd27 - <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate::he1083cc248ab0e98
  31:     0x7f91f3852562 - rustc_driver::driver::phase_4_translate_to_llvm::hfdc184ff560761c5
  32:     0x7f91f384b80e - rustc_driver::driver::compile_input::{{closure}}::ha4254b2145dd86d8
  33:     0x7f91f37e68fe - rustc::ty::context::TyCtxt::create_and_enter::he3e4f3930d406ef0
  34:     0x7f91f38497bb - rustc_driver::driver::compile_input::hd2a6444b7fba6805
  35:     0x7f91f38665fa - rustc_driver::run_compiler::h23eec633cdb60fc2
  36:     0x7f91f379271a - std::sys_common::backtrace::__rust_begin_short_backtrace::h8832fd8a58b18629
  37:     0x7f91f34b6b8e - __rust_maybe_catch_panic
                               at libpanic_unwind/lib.rs:102
  38:     0x7f91f37cb896 - <F as alloc::boxed::FnBox<A>>::call_box::hbb7d5a5401bfb959
  39:     0x7f91f34ade1b - std::sys::unix::thread::Thread::new::thread_start::hdd261da30813e955
                               at /checkout/src/liballoc/boxed.rs:798
                               at libstd/sys_common/thread.rs:24
                               at libstd/sys/unix/thread.rs:90
  40:     0x7f91ee3987fb - start_thread
  41:     0x7f91f3166b5e - clone
  42:                0x0 - <unknown>

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.25.0-nightly (4d2d3fc5d 2018-02-13) running on x86_64-unknown-linux-gnu

Meta

Tested toolchains:

  • rustc 1.24.0-nightly (8e7a609e6 2018-01-04)
  • rustc 1.25.0-nightly (4d2d3fc5d 2018-02-13)
$ xargo -V                           
xargo 0.3.8
cargo 0.24.0 (45043115c 2017-12-05)

cc @japaric

@japaric
Copy link
Member

japaric commented Feb 24, 2018

I tried building the crate cortex-m-quickstart

What version of cortex-m-quickstart are you building? The issue you are reporting has been fixed in cortex-m-quickstart some time ago.

@niklasad1
Copy link
Author

niklasad1 commented Feb 24, 2018

Thanks, it was 1.9.0 seems to work better with 0.2.4

@japaric
Copy link
Member

japaric commented Feb 25, 2018

I would suggest closing this issue as it's not actionable: stuff that compiled with last year nightly will certainly not compile with today's nightly.

If you want to make this issue actionable: the problem is that the new-ish Termination stuff crashes the compiler when misused (as explained in #47040 (comment)) so the issue should request the misuse reporting a proper error message instead of crashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants