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

error: internal compiler error: unexpected panic #25170

Closed
halseth opened this issue May 7, 2015 · 4 comments
Closed

error: internal compiler error: unexpected panic #25170

halseth opened this issue May 7, 2015 · 4 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@halseth
Copy link

halseth commented May 7, 2015

This code:

fn main() {
    println!("Hello, world!");
}

fn cost(ordering: Vec<u32>, g : &[[bool]]) -> u32{
    0
}

causes cargo run to panic. I expected the compiler to tell me why the code won't compile (as I'm new to Rust and just messing around), but instead got this:

error: internal compiler error: unexpected panic
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: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'assertion failed: slice_layout_is_correct(cx, &member_llvm_types[..], element_type)', /Users/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-mac/build/src/librustc_trans/trans/debuginfo.rs:2810

Could not compile `ola`.

Caused by:
  Process didn't exit successfully: `rustc src/main.rs --crate-name ola --crate-type bin -g --out-dir <path>/ola/target/debug --emit=dep-info,link -L dependency=<path>/ola/target/debug -L dependency=<path>/ola/target/debug/deps` (exit code: 101)

Here is the stack backtrace:
stack backtrace:

   1:        0x11271233f - sys::backtrace::write::h0f2fc53eb11eb814gWr
   2:        0x11271a942 - panicking::on_panic::hd617a4042e8486fciUv
   3:        0x1126d7375 - rt::unwind::begin_unwind_inner::hd84dfec22ac3667d1Bv
   4:        0x10f75323f - rt::unwind::begin_unwind::h4294986180400934817
   5:        0x10f85ea1a - trans::debuginfo::vec_slice_metadata::hdd5577b95b4fcd19cgy
   6:        0x10f8498ae - trans::debuginfo::type_metadata::h17dfbfd8870335c6Ioy
   7:        0x10f85efb9 - trans::debuginfo::subroutine_type_metadata::h85c55e1f06d6171biky
   8:        0x10f84924d - trans::debuginfo::type_metadata::h17dfbfd8870335c6Ioy
   9:        0x10f7b0655 - trans::debuginfo::create_function_debug_context::had01a2eea7dd420bG0w
  10:        0x10f7ae9b4 - trans::base::new_fn_ctxt::hfb3c72b1665f71f2Djh
  11:        0x10f7b7818 - trans::base::trans_closure::h018968a5559105aaLCh
  12:        0x10f7bbcee - trans::base::trans_fn::hc6f0e8480688cfc5tNh
  13:        0x10f7bf258 - trans::base::trans_item::h71c2fefdc1d6f826Fbi
  14:        0x10f7ce040 - trans::base::trans_crate::h08afcbe814944b6eF0i
  15:        0x10f258dce - driver::phase_4_translate_to_llvm::h0ce111a767622842hOa
  16:        0x10f231124 - driver::compile_input::hd958766b5aa38359Qba
  17:        0x10f2f8923 - run_compiler::h9bcb9536763d6c28z4b
  18:        0x10f2f644a - boxed::F.FnBox<A>::call_box::h2309050189455115330
  19:        0x10f2f58e7 - rt::unwind::try::try_fn::h4927022999322665723
  20:        0x11279b7c8 - rust_try_inner
  21:        0x11279b7b5 - rust_try
  22:        0x10f2f5bc0 - boxed::F.FnBox<A>::call_box::h5709674458622256774
  23:        0x11271948d - sys::thread::create::thread_start::h499b3be451a7bbb8AZu
  24:     0x7fff8f1c9267 - _pthread_body
  25:     0x7fff8f1c91e4 - _pthread_start

Additional info:

rustc 1.0.0-beta.4 (850151a75 2015-04-30) (built 2015-04-30)
binary: rustc
commit-hash: 850151a75709f146addd30bbbf1f23d384f0b381
commit-date: 2015-04-30
build-date: 2015-04-30
host: x86_64-apple-darwin
release: 1.0.0-beta.4
@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label May 7, 2015
@jdm jdm added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label May 7, 2015
@jdm
Copy link
Contributor

jdm commented May 7, 2015

By the backtrace it's clearly related to g : &[[bool]] for some reason; the workaround right now is to only build release or disable extended debug symbol generation using --debuginfo=1 if invoking rustc by hand.

@jdm
Copy link
Contributor

jdm commented May 7, 2015

That being said, you likely want &[&[bool]] instead, since [bool] is an unsized value.

@michaelwoerister
Copy link
Member

Shouldn't this type be rejected during type checking already. I don't see how one could construct a non-empty &[[bool]] value. But maybe I'm missing something.

@Stebalien
Copy link
Contributor

dup of #24707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

6 participants