Skip to content

Compiler Panics at 'Box<Any>' while building stm32f0 blinky.rs example. #47858

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
creationix opened this issue Jan 29, 2018 · 4 comments
Closed
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@creationix
Copy link

creationix commented Jan 29, 2018

Rust version: rustc 1.25.0-nightly (21882aad7 2018-01-28) running on x86_64-unknown-linux-gnu

tim@imac:~/Code/stm32f0/stm32f0_hal$ RUST_BACKTRACE=full RUST_BACKTRACE=1 xargo build --target thumbv6m-none-eabi --example blinky --verbose 
+ "rustc" "--print" "sysroot"
+ "rustc" "--print" "target-list"
+ RUSTFLAGS="-C link-arg=-Tlink.x -C linker=arm-none-eabi-ld -Z linker-flavor=ld --sysroot /home/tim/.xargo"
+ "cargo" "build" "--target" "thumbv6m-none-eabi" "--example" "blinky" "--verbose"
       Fresh vcell v0.1.0
       Fresh aligned v0.1.1
       Fresh bare-metal v0.1.1
       Fresh r0 v0.2.2
       Fresh cortex-m-semihosting v0.2.0
       Fresh volatile-register v0.2.0
       Fresh cortex-m v0.3.1
       Fresh cortex-m-rt v0.3.7
       Fresh stm32f0x2 v0.1.0 (file:///home/tim/Code/stm32f0/stm32f0x2)
   Compiling stm32f0_hal v0.1.0 (file:///home/tim/Code/stm32f0/stm32f0_hal)
     Running `rustc --crate-name blinky stm32f0_hal/examples/blinky.rs --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="default"' -C metadata=5103cc9eb8bf5340 -C extra-filename=-5103cc9eb8bf5340 --out-dir /home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/examples --target thumbv6m-none-eabi -C incremental=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/incremental -L dependency=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps -L dependency=/home/tim/Code/stm32f0/target/debug/deps --extern stm32f0x2=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps/libstm32f0x2-c08ab829c67dc473.rlib --extern cortex_m=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps/libcortex_m-9c2e0e94c2fc9d20.rlib --extern cortex_m_rt=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps/libcortex_m_rt-3373606d797ac282.rlib --extern cortex_m_semihosting=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps/libcortex_m_semihosting-b452316abe4afd5d.rlib --extern stm32f0_hal=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps/libstm32f0_hal-6dd2d2115ba27ca7.rlib -C link-arg=-Tlink.x -C linker=arm-none-eabi-ld -Z linker-flavor=ld --sysroot /home/tim/.xargo -L /home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/build/stm32f0_hal-2dbdec0eba977904/out -L /home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/build/cortex-m-rt-1c768f297f245769/out`
error: internal compiler error: librustc_metadata/cstore_impl.rs:131: get_optimized_mir: missing MIR for `DefId(8/0:8 ~ cortex_m_rt[e367]::lang_items[0]::start[0])`

thread 'rustc' panicked at 'Box<Any>', librustc_errors/lib.rs:529:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:380
   3: std::panicking::default_hook
             at libstd/panicking.rs:396
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:576
   5: std::panicking::begin_panic
   6: rustc_errors::Handler::bug
   7: <std::thread::local::LocalKey<T>>::with
   8: rustc::ty::context::tls::with_opt
   9: rustc::session::opt_span_bug_fmt
  10: rustc::session::bug_fmt
  11: rustc_metadata::cstore_impl::provide_extern::optimized_mir
  12: rustc::ty::maps::<impl rustc::ty::maps::queries::optimized_mir<'tcx>>::compute_result
  13: rustc::dep_graph::graph::DepGraph::with_task_impl
  14: rustc_errors::Handler::track_diagnostics
  15: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  16: rustc::ty::maps::<impl rustc::ty::maps::queries::optimized_mir<'tcx>>::force
  17: rustc::ty::maps::<impl rustc::ty::maps::queries::optimized_mir<'tcx>>::try_get
  18: rustc::ty::maps::TyCtxtAt::optimized_mir
  19: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::instance_mir
  20: rustc_mir::monomorphize::collector::collect_items_rec
  21: rustc_mir::monomorphize::collector::collect_crate_mono_items
  22: rustc::util::common::time
  23: rustc_trans::base::collect_and_partition_translation_items
  24: rustc::dep_graph::graph::DepGraph::with_task_impl
  25: rustc_errors::Handler::track_diagnostics
  26: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  27: rustc::ty::maps::<impl rustc::ty::maps::queries::collect_and_partition_translation_items<'tcx>>::force
  28: rustc::ty::maps::<impl rustc::ty::maps::queries::collect_and_partition_translation_items<'tcx>>::try_get
  29: rustc::ty::maps::TyCtxtAt::collect_and_partition_translation_items
  30: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::collect_and_partition_translation_items
  31: <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate
  32: rustc::util::common::time
  33: rustc_driver::driver::phase_4_translate_to_llvm
  34: rustc_driver::driver::compile_input::{{closure}}
  35: <std::thread::local::LocalKey<T>>::with
  36: <std::thread::local::LocalKey<T>>::with
  37: rustc::ty::context::TyCtxt::create_and_enter
  38: rustc_driver::driver::compile_input
  39: rustc_driver::run_compiler

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 (21882aad7 2018-01-28) running on x86_64-unknown-linux-gnu

error: Could not compile `stm32f0_hal`.

Caused by:
  process didn't exit successfully: `rustc --crate-name blinky stm32f0_hal/examples/blinky.rs --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg feature="default" -C metadata=5103cc9eb8bf5340 -C extra-filename=-5103cc9eb8bf5340 --out-dir /home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/examples --target thumbv6m-none-eabi -C incremental=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/incremental -L dependency=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps -L dependency=/home/tim/Code/stm32f0/target/debug/deps --extern stm32f0x2=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps/libstm32f0x2-c08ab829c67dc473.rlib --extern cortex_m=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps/libcortex_m-9c2e0e94c2fc9d20.rlib --extern cortex_m_rt=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps/libcortex_m_rt-3373606d797ac282.rlib --extern cortex_m_semihosting=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps/libcortex_m_semihosting-b452316abe4afd5d.rlib --extern stm32f0_hal=/home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/deps/libstm32f0_hal-6dd2d2115ba27ca7.rlib -C link-arg=-Tlink.x -C linker=arm-none-eabi-ld -Z linker-flavor=ld --sysroot /home/tim/.xargo -L /home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/build/stm32f0_hal-2dbdec0eba977904/out -L /home/tim/Code/stm32f0/target/thumbv6m-none-eabi/debug/build/cortex-m-rt-1c768f297f245769/out` (exit code: 101)
@creationix
Copy link
Author

creationix commented Jan 29, 2018

I also reported at the stm32f0 project in case they have any ideas pollen-robotics/stm32f0#29 (comment)

@creationix creationix changed the title Compiler Panics as 'Box<And>' while building stm32f0 blinky.rs example. Compiler Panics at 'Box<And>' while building stm32f0 blinky.rs example. Jan 29, 2018
@creationix creationix changed the title Compiler Panics at 'Box<And>' while building stm32f0 blinky.rs example. Compiler Panics at 'Box<Any>' while building stm32f0 blinky.rs example. Jan 29, 2018
@creationix
Copy link
Author

If I downgrade nightly to nightly-2017-12-25, I don't get the panic, so this seems to be a fairly recent regression.

@TimNN TimNN added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-target-specs Area: Compile-target specifications and removed A-target-specs Area: Compile-target specifications labels Jan 30, 2018
@japaric
Copy link
Member

japaric commented Feb 25, 2018

Same issue as #48519. There I explained what the real problem is.

@creationix
Copy link
Author

Thanks, I'll close this one to avoid duplicates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants