Skip to content

ICE with &[str] #24707

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
beeandbo opened this issue Apr 23, 2015 · 10 comments
Closed

ICE with &[str] #24707

beeandbo opened this issue Apr 23, 2015 · 10 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@beeandbo
Copy link

Hi Folks,

Just ran into a compiler panic. I'm still learning rust, so it's probably related to a stupid syntax error on my part, but rustc suggested I file a bug report, so here I am...

Here's the error:

thread 'rustc' panicked at 'assertion failed: slice_layout_is_correct(cx, &member_llvm_types[..], element_type)', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_trans/trans/debuginfo.rs:2810

Here's the code I was writing:

    pub fn aggregate(&self, group_column: &str, sum_columns: &[str]) {

    }

Here's the backtrace:

   1:     0x7f2103105f39 - sys::backtrace::write::h7638fca3b07af337rVs
   2:     0x7f210310dbb6 - panicking::on_panic::h64a1f0366c6b8a23mkx
   3:     0x7f21030ca912 - rt::unwind::begin_unwind_inner::hcaa5609c9e3078adwZw
   4:     0x7f2101e5b28e - rt::unwind::begin_unwind::h15509594317540694492
   5:     0x7f2101f5a843 - trans::debuginfo::vec_slice_metadata::hfcdfde7a231fb874ehy
   6:     0x7f2101f460bc - trans::debuginfo::type_metadata::hadf1ae524fc7b529Kpy
   7:     0x7f2101f5add0 - trans::debuginfo::subroutine_type_metadata::hd6ba8b12e5430450kly
   8:     0x7f2101f45a94 - trans::debuginfo::type_metadata::hadf1ae524fc7b529Kpy
   9:     0x7f2101eb39a6 - trans::debuginfo::create_function_debug_context::h4a389096a1ba01b1I1w
  10:     0x7f2101eb1f7f - trans::base::new_fn_ctxt::h5648354326e8de67tkh
  11:     0x7f2101ebaf72 - trans::base::trans_closure::h0dc61076718b152eBDh
  12:     0x7f2101ebef8a - trans::base::trans_fn::h017a63e4b4f1d383jOh
  13:     0x7f2101ec2ad4 - trans::base::trans_item::h694a5c0c3e92277bvci
  14:     0x7f2101ec2948 - trans::base::trans_item::h694a5c0c3e92277bvci
  15:     0x7f2101ec2948 - trans::base::trans_item::h694a5c0c3e92277bvci
  16:     0x7f2101ed03bd - trans::base::trans_crate::h93b35940c9d58579v1i
  17:     0x7f2103675d5a - driver::phase_4_translate_to_llvm::h0cea9caf6133630enOa
  18:     0x7f210364e05b - driver::compile_input::h4642f691e22278cbQba
  19:     0x7f210370e331 - run_compiler::he528ba831532b90aF4b
  20:     0x7f210370bf82 - boxed::F.FnBox<A>::call_box::h13568337174014462877
  21:     0x7f210370b4b9 - rt::unwind::try::try_fn::h15381261312250239500
  22:     0x7f2103185528 - rust_try_inner
  23:     0x7f2103185515 - rust_try
  24:     0x7f210370b768 - boxed::F.FnBox<A>::call_box::h6713016946069099629
  25:     0x7f210310cac1 - sys::thread::create::thread_start::hbe89fbdfc755452dxjw
  26:     0x7f20fd1b7181 - start_thread
  27:     0x7f2102d4347c - __clone
  28:                0x0 - <unknown>

Other Details:

rustc --version --verbose
rustc 1.0.0-nightly (2baf34825 2015-04-21) (built 2015-04-22)
binary: rustc
commit-hash: 2baf3482537f5a245a9c17ca730398f1a8b001d7
commit-date: 2015-04-21
build-date: 2015-04-22
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Apr 23, 2015
@steveklabnik
Copy link
Member

so it's probably related to a stupid syntax error on my part, but rustc suggested I file a bug report, so here I am

Yup! even syntax errors shouldn't crash the compiler. thanks for reporting.

@laumann
Copy link
Contributor

laumann commented Apr 23, 2015

I cannot reproduce this from the given code in nightly: http://is.gd/XgQ75P (nor beta)

@tzeskimo I think you need to provide more context from the code you wrote

@jdm
Copy link
Contributor

jdm commented Apr 23, 2015

Note that any attempt to reproduce should ensure that debuginfo is being generated.

@laumann
Copy link
Contributor

laumann commented Apr 23, 2015

@jdm Right - I'm probably missing something

@nagisa
Copy link
Member

nagisa commented Apr 23, 2015

Reproducible running

echo '#![crate_type="lib"]; fn a(_: &[str]){}' | rustc - -g

This should fail at typecheck, I think, because str is unsized and slice of unsized items is a borderline wrong.

@beeandbo
Copy link
Author

Sorry, just got back from out of town. @laumann Given the comment from @nagisa do you have enough to reproduce, or would you still like more context?

@laumann
Copy link
Contributor

laumann commented Apr 28, 2015

@tzeskimo Yes, I think @nagisa's example is a good minimal example - the important thing is the -g flag (as @jdm also pointed out)

@arielb1
Copy link
Contributor

arielb1 commented May 16, 2015

cc #25470

@arielb1
Copy link
Contributor

arielb1 commented May 16, 2015

cc #25388

@arielb1
Copy link
Contributor

arielb1 commented Aug 14, 2015

Fixed by #27641.

@arielb1 arielb1 closed this as completed Aug 14, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

6 participants