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

compiler unexpectedly panicked. "this is a bug." #27181

Closed
davidpbrown opened this issue Jul 21, 2015 · 3 comments
Closed

compiler unexpectedly panicked. "this is a bug." #27181

davidpbrown opened this issue Jul 21, 2015 · 3 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

@davidpbrown
Copy link

Two sets of this error:

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)', ../src/librustc_trans/trans/debuginfo/metadata.rs:577

from running cargo test against
./src/libs.rs that is

pub fn anagrams_for(word: &str, inputs: &[str]) -> Vec<&'static str> {
let outputs = vec!["abc","def"];
outputs
}

and ./tests/anagram.rs that is

extern crate anagram;

#[test]
fn test_no_matches() {
    let inputs = ["hello", "world", "zombies", "pants"];
    let outputs: Vec<&str> = vec![];
    assert_eq!(anagram::anagrams_for("diaper", &inputs), outputs);
}

I don't know what I was expecting.. I'm a noob ;p
I set RUST_BACKTRACE=1 but it's not a --bin so couldn't do cargo run easily; cargo build and test don't seem to offer any backtrace that I can see.

Meta

rustc 1.3.0-nightly (118a5c4c3 2015-07-21)
binary: rustc
commit-hash: 118a5c4c342883606fd96b121d741b133caa0347
commit-date: 2015-07-21
host: i686-unknown-linux-gnu
release: 1.3.0-nightly
@davidpbrown
Copy link
Author

So I just found backtrace runs with

RUST_BACKTRACE=1 cargo run

giving:

stack backtrace:
   1: 0xb72eaee0 - sys::backtrace::write::hd817a303213a89c3Sws
   2: 0xb72f4090 - panicking::on_panic::h7a02169f9432305bclx
   3: 0xb72b0a61 - rt::unwind::begin_unwind_inner::h48154f91ae6f6ed5Q0w
   4: 0xb6aa951a - rt::unwind::begin_unwind::h2710919888498253672
   5: 0xb6b8c5c0 - trans::debuginfo::metadata::vec_slice_metadata::h1830ebfd90bf1646CGx
   6: 0xb6b8a140 - trans::debuginfo::metadata::type_metadata::h2648f426ad2ac74cVOx
   7: 0xb6afac6f - trans::debuginfo::create_function_debug_context::h08d8c7facfa94772vVz
   8: 0xb6af86bf - trans::base::new_fn_ctxt::hdee0c565c2428ddcEdi
   9: 0xb6b04597 - trans::base::trans_closure::h5edb680ad908f55ajxi
  10: 0xb6b08486 - trans::base::trans_fn::h958058ddc7c313246Gi
  11: 0xb6b0b8ea - trans::base::trans_item::hf3d1d3047a9fc247h6i
  12: 0xb6b18dd2 - trans::base::trans_crate::h089a808187a5b003eUj
  13: 0xb764eb9c - driver::phase_4_translate_to_llvm::h8438b1d41574c31f5Oa
  14: 0xb764928c - driver::phase_3_run_analysis_passes::closure.16370
  15: 0xb764351c - middle::ty::ctxt<'tcx>::create_and_enter::h715714199811497514
  16: 0xb763e04d - driver::phase_3_run_analysis_passes::h17597039431132956485
  17: 0xb7624640 - driver::compile_input::h5014aac93408544aTba
  18: 0xb77133ed - run_compiler::h77b31ce882f200a2A7b
  19: 0xb771090e - boxed::F.FnBox<A>::call_box::h12138022694166688879
  20: 0xb7710221 - rt::unwind::try::try_fn::h9887116421262948572
  21: 0xb738073a - rust_try_inner
  22: 0xb7380713 - rust_try
  23: 0xb72dd8ec - rt::unwind::try::inner_try::h59ce709208f4b3feJWw
  24: 0xb771042d - boxed::F.FnBox<A>::call_box::h13050231780628061829
  25: 0xb72f2b34 - sys::thread::Thread::new::thread_start::h08638e0fe4db24abw6v
  26: 0xb2ee2f6f - start_thread
  27: 0xb716cbed - clone
  28:        0x0 - <unknown>

@jdm jdm added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jul 21, 2015
@Stebalien
Copy link
Contributor

Dup of #24707 (it should be inputs: &[&str], not inputs: &[str] but this is still a bug).

@huonw
Copy link
Member

huonw commented Jul 21, 2015

Closing as a dupe, thanks for filing.

@huonw huonw closed this as completed Jul 21, 2015
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

4 participants