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

rustc panic on "let a = [];" -- cat_expr Errd then core dump #25569

Closed
andybalaam opened this issue May 18, 2015 · 4 comments
Closed

rustc panic on "let a = [];" -- cat_expr Errd then core dump #25569

andybalaam opened this issue May 18, 2015 · 4 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@andybalaam
Copy link

I got a crash with a very small program. When I tried to use RUST_BACKTRACE=1 rustc dumped core, but github will not allow me to upload the core file, even 7zipped.

$ cat tmp.rs
fn main()
{
let a = [];
}

$ rustc tmp.rs
tmp.rs:4:13: 4:15 error: internal compiler error: cat_expr Errd
tmp.rs:4 let a = [];
^~
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 'Box', /build/buildd/rust-1.0.0-beta-201504071629b41f2dfvivid/src/libsyntax/diagnostic.rs:131

$ RUST_BACKTRACE=1 rustc tmp.rs
tmp.rs:4:13: 4:15 error: internal compiler error: cat_expr Errd
tmp.rs:4 let a = [];
^~
Illegal instruction (core dumped)

$ gdb /usr/bin/rustc core

Reading symbols from /usr/bin/rustc...(no debugging symbols found)...done.
[New LWP 2214]
[New LWP 2213]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `rustc tmp.rs'.
Program terminated with signal SIGILL, Illegal instruction.
#0 0x00007f65adc50d32 in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/libstd-4e7c5e5c.so

(gdb) where
#0 0x00007f65adc50d32 in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/libstd-4e7c5e5c.so
#1
#2 0x00007f65a5bea630 in ?? ()
#3 0x00007f65adce0907 in backtrace_pcinfo () from /usr/lib/rust/rust-1.0.0-beta/lib/libstd-4e7c5e5c.so
#4 0x00007f65adc3b55c in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/libstd-4e7c5e5c.so
#5 0x00007f65a79305b9 in _Unwind_Backtrace () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#6 0x00007f65adc3ae39 in sys::backtrace::write::h3ac5855d9fa0b426kHC () from /usr/lib/rust/rust-1.0.0-beta/lib/libstd-4e7c5e5c.so
#7 0x00007f65adc66358 in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/libstd-4e7c5e5c.so
#8 0x00007f65adb9dea4 in rt::unwind::begin_unwind_inner::h341bf419a797aa0eCzI () from /usr/lib/rust/rust-1.0.0-beta/lib/libstd-4e7c5e5c.so
#9 0x00007f65aaf24fae in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/libsyntax-4e7c5e5c.so
#10 0x00007f65aaf24f54 in diagnostic::SpanHandler::span_bug::hc13b41cf2fb19457ImB () from /usr/lib/rust/rust-1.0.0-beta/lib/libsyntax-4e7c5e5c.so
#11 0x00007f65ab7de9d4 in session::Session::span_bug::h387971b3ca6d9dafqQq () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc-4e7c5e5c.so
#12 0x00007f65ac89e71e in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_typeck-4e7c5e5c.so
#13 0x00007f65ac89f24b in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_typeck-4e7c5e5c.so
#14 0x00007f65ac899716 in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_typeck-4e7c5e5c.so
#15 0x00007f65ac9344a2 in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_typeck-4e7c5e5c.so
#16 0x00007f65ac92df85 in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_typeck-4e7c5e5c.so
#17 0x00007f65aca079e7 in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_typeck-4e7c5e5c.so
#18 0x00007f65aca01f34 in check_crate::h88daf35079354687asC () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_typeck-4e7c5e5c.so
#19 0x00007f65ae2bb1ee in driver::phase_3_run_analysis_passes::hd95dbb6da23a4f8fgGa () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_driver-4e7c5e5c.so
#20 0x00007f65ae29f046 in driver::compile_input::h646544737bce2e91Qba () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_driver-4e7c5e5c.so
#21 0x00007f65ae3565f6 in run_compiler::h372ae4e1f28ce38fS4b () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_driver-4e7c5e5c.so
#22 0x00007f65ae353f0e in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_driver-4e7c5e5c.so
#23 0x00007f65ae35344a in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_driver-4e7c5e5c.so
#24 0x00007f65adce29e9 in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/libstd-4e7c5e5c.so
#25 0x00007f65adce29d6 in rust_try () from /usr/lib/rust/rust-1.0.0-beta/lib/libstd-4e7c5e5c.so
#26 0x00007f65ae35371c in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/librustc_driver-4e7c5e5c.so
#27 0x00007f65adc51342 in ?? () from /usr/lib/rust/rust-1.0.0-beta/lib/libstd-4e7c5e5c.so
#28 0x00007f65a7b3d6aa in start_thread (arg=0x7f65a5bff700) at pthread_create.c:333
#29 0x00007f65ad805eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

$ rustc --version --verbose
rustc 1.0.0-dev (built 2015-04-07)
binary: rustc
commit-hash: unknown
commit-date: unknown
build-date: 2015-04-07
host: x86_64-unknown-linux-gnu
release: 1.0.0-dev

@pnkfelix
Copy link
Member

what the heck, a core dump after a cat_expr Errd ???

@pnkfelix pnkfelix changed the title rustc panic on "let a = [];" rustc panic on "let a = [];" -- cat_expr Errd then core dump May 18, 2015
@huonw
Copy link
Member

huonw commented May 18, 2015

NB. Your rustc seems to be a month old now, it may be already fixed in the 1.0.0 stable compiler or maybe in the nightlies.

@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label May 18, 2015
@andybalaam
Copy link
Author

Apologies, with recent rust this seems to work fine. I'll try this again on the same machine before I close the issue, but on this (different) machine, with recent rust, I get:

$ rustc tmp.rs
tmp.rs:3:9: 3:15 error: cannot determine a type for this local variable: unconstrained type [E0102]
tmp.rs:3 let a = [];
^~~~~~
error: aborting due to previous error

$ rustc --version --verbose
rustc 1.2.0-dev (2dd5ad0 2015-05-18) (built 2015-05-18)
binary: rustc
commit-hash: 2dd5ad0
commit-date: 2015-05-18
build-date: 2015-05-18
host: x86_64-unknown-linux-gnu
release: 1.2.0-dev

@andybalaam
Copy link
Author

Yes, works in rust built from latest git. Apologies for the noise.

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

No branches or pull requests

4 participants