Skip to content

ICE when linking to old libcore #14748

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
mvdnes opened this issue Jun 8, 2014 · 6 comments
Closed

ICE when linking to old libcore #14748

mvdnes opened this issue Jun 8, 2014 · 6 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@mvdnes
Copy link
Contributor

mvdnes commented Jun 8, 2014

Description

I am writing an x86 kernel in rust for my own fun. I am using an myself-compiled libcore to use with this, as the host is x86_64 and I need an i386 lib. This is done with rustc -O --target=i386-unknown-linux ../rust/src/libcore/lib.rs. Sometimes (not always) when I update my host version of rust (using the thestinger Arch repo), I get an ICE. They differ each time, but the latest was:

rustc -L. -O --target i386-unknown-linux --crate-type lib -o main.o --emit obj main_x86.rs
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'assertion failed: start <= end', /build/rust-git/src/rust/src/libcore/slice.rs:540

This is resolved by updating the rust repo, and recompiling the libcore crate. Maybe the failure could give of a more useful error-message?

Version

[mvdnes@vm-arch rust-kernel]$ rustc -v
rustc 0.11.0-pre (fa18328 2014-06-07 15:31:44 -0700)
host: x86_64-unknown-linux-gnu

[mvdnes@vm-arch rust-kernel]$ uname -a
Linux vm-arch 3.14.5-1-ARCH #1 SMP PREEMPT Sun Jun 1 07:36:23 CEST 2014 x86_64 GNU/Linux
@huonw huonw added the I-ICE label Jun 8, 2014
@alexcrichton
Copy link
Member

Could you provide a backtrace of the ICE as well?

@mvdnes
Copy link
Contributor Author

mvdnes commented Jun 8, 2014

[mvdnes@vm-arch rust-kernel (git:master)]$ RUST_BACKTRACE=1 make
rustc -L. -O --target i386-unknown-linux --crate-type lib -o main.o --emit obj main_x86.rs
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'assertion failed: start <= end', /build/rust-git/src/rust/src/libcore/slice.rs:540

stack backtrace:
   1:     0x7f6258c4b560 - rt::backtrace::imp::write::hf7f0193b62c10642jft::v0.11.0.pre
   2:     0x7f6258c52c90 - <unknown>
   3:     0x7f625affaf40 - unwind::begin_unwind_inner::hb191b1c2cc278613x2c::v0.11.0.pre
   4:     0x7f625affa9d0 - unwind::begin_unwind_fmt::hd9fbea452e71602eZZc::v0.11.0.pre
   5:     0x7f625affa990 - rust_begin_unwind
   6:     0x7f625b042750 - failure::begin_unwind::h4ff9994309231abcSZv::v0.11.0.pre
   7:     0x7f625b99d850 - middle::trans::callee::trans_fn_ref_with_vtables::hd8b242ee1b42ae55qze::v0.11.0.pre
   8:     0x7f625b998fc0 - middle::trans::callee::trans_fn_ref::h39af25c07898892b7se::v0.11.0.pre
   9:     0x7f625b9a8470 - middle::trans::meth::trans_method_callee::h658977e3db07169cfsw::v0.11.0.pre
  10:     0x7f625b9a8400 - <unknown>
  11:     0x7f625b9a65c0 - middle::trans::callee::trans_call_inner::h16ea36ba3bed6c30aYe::v0.11.0.pre
  12:     0x7f625b9a7d80 - middle::trans::callee::trans_method_call::hb940a5b8c40323edpTe::v0.11.0.pre
  13:     0x7f625b9b11f0 - <unknown>
  14:     0x7f625b9729b0 - middle::trans::expr::trans_into::h9f32507e10bb94f45zf::v0.11.0.pre
  15:     0x7f625b972f50 - middle::trans::controlflow::trans_block::h91c630cfb7b105c2Elc::v0.11.0.pre
  16:     0x7f625ba30600 - middle::trans::base::trans_closure::hfe923026fff94ef6tlq::v0.11.0.pre
  17:     0x7f625b942a00 - middle::trans::base::trans_fn::hd03f25ae32818d32wtq::v0.11.0.pre
  18:     0x7f625b92c220 - middle::trans::inline::maybe_instantiate_inline::h4d0dfbbb4addff01zub::v0.11.0.pre
  19:     0x7f625b99d850 - middle::trans::callee::trans_fn_ref_with_vtables::hd8b242ee1b42ae55qze::v0.11.0.pre
  20:     0x7f625b998fc0 - middle::trans::callee::trans_fn_ref::h39af25c07898892b7se::v0.11.0.pre
  21:     0x7f625b9a8470 - middle::trans::meth::trans_method_callee::h658977e3db07169cfsw::v0.11.0.pre
  22:     0x7f625b9a8400 - <unknown>
  23:     0x7f625b9a65c0 - middle::trans::callee::trans_call_inner::h16ea36ba3bed6c30aYe::v0.11.0.pre
  24:     0x7f625b9a7d80 - middle::trans::callee::trans_method_call::hb940a5b8c40323edpTe::v0.11.0.pre
  25:     0x7f625b9b11f0 - <unknown>
  26:     0x7f625b9b0010 - <unknown>
  27:     0x7f625b974c80 - middle::trans::expr::trans::h3db050fd3914c9d01Df::v0.11.0.pre
  28:     0x7f625b972850 - middle::trans::expr::trans_to_lvalue::h0def187e2f6a431beWf::v0.11.0.pre
  29:     0x7f625b9bd070 - <unknown>
  30:     0x7f625b9b0010 - <unknown>
  31:     0x7f625b974c80 - middle::trans::expr::trans::h3db050fd3914c9d01Df::v0.11.0.pre
  32:     0x7f625b972850 - middle::trans::expr::trans_to_lvalue::h0def187e2f6a431beWf::v0.11.0.pre
  33:     0x7f625b9c3e00 - middle::trans::_match::trans_match::hed8b35749bd94b9bgmu::v0.11.0.pre
  34:     0x7f625b9b11f0 - <unknown>
  35:     0x7f625b9729b0 - middle::trans::expr::trans_into::h9f32507e10bb94f45zf::v0.11.0.pre
  36:     0x7f625b971c50 - middle::trans::controlflow::trans_stmt_semi::hde0b281f73b8ef7eLkc::v0.11.0.pre
  37:     0x7f625b971180 - middle::trans::controlflow::trans_stmt::hb5cb0c042b3019b1xgc::v0.11.0.pre
  38:     0x7f625b972f50 - middle::trans::controlflow::trans_block::h91c630cfb7b105c2Elc::v0.11.0.pre
  39:     0x7f625ba30600 - middle::trans::base::trans_closure::hfe923026fff94ef6tlq::v0.11.0.pre
  40:     0x7f625b942a00 - middle::trans::base::trans_fn::hd03f25ae32818d32wtq::v0.11.0.pre
  41:     0x7f625ba35e50 - middle::trans::meth::trans_impl::hf8b54cf6a401fbfftnw::v0.11.0.pre
  42:     0x7f625b93c1c0 - middle::trans::base::trans_item::h15a7d15d5a1d399aWJq::v0.11.0.pre
  43:     0x7f625b93c1c0 - middle::trans::base::trans_item::h15a7d15d5a1d399aWJq::v0.11.0.pre
  44:     0x7f625b93c1c0 - middle::trans::base::trans_item::h15a7d15d5a1d399aWJq::v0.11.0.pre
  45:     0x7f625ba407e0 - middle::trans::base::trans_crate::h85cec661243570133Cr::v0.11.0.pre
  46:     0x7f625c1ff5b0 - driver::driver::phase_4_translate_to_llvm::h1f0b6f1f8a7ca49eUao::v0.11.0.pre
  47:     0x7f625c1f4bd0 - driver::driver::compile_input::ha940156ba16b48ebvSn::v0.11.0.pre
  48:     0x7f625c2bcef0 - <unknown>
  49:     0x7f625c2bce10 - <unknown>
  50:     0x7f625c2d75d0 - <unknown>
  51:     0x7f625c2d2870 - <unknown>
  52:     0x7f625b342800 - <unknown>
  53:     0x7f625aff84f0 - <unknown>
  54:     0x7f625b05ced0 - rust_try
  55:     0x7f625affa530 - unwind::try::h5e1236a7876941deTQc::v0.11.0.pre
  56:     0x7f625aff8370 - task::Task::run::h10ae6b6004d94ab7qxc::v0.11.0.pre
  57:     0x7f625b3425a0 - <unknown>
  58:     0x7f6258c4a9b0 - <unknown>
  59:     0x7f6258981060 - start_thread
  60:     0x7f625acd1489 - __clone
  61:                0x0 - <unknown>

Makefile:25: recipe for target 'main.o' failed
make: *** [main.o] Error 101

@mvdnes mvdnes changed the title ICE when using linking to old libcore ICE when linking to old libcore Jun 8, 2014
@frewsxcv
Copy link
Member

@mvdnes Have you been able to reproduce this ICE recently?

@mvdnes
Copy link
Contributor Author

mvdnes commented Feb 15, 2015

Yes, not very often but two days ago I did. Steps to reproduce:

// hello.rs
#![feature(io)]
fn main() {
    println!("Hello, World!");
}

Next we download the compiler from 14 febuary and the libraries of 8.

wget http://static.rust-lang.org/dist/2015-02-14/rustc-nightly-x86_64-unknown-linux-gnu.tar.gz
tar -xf rustc-nightly-x86_64-unknown-linux-gnu.tar.gz
wget http://static.rust-lang.org/dist/2015-02-08/rustc-nightly-i686-unknown-linux-gnu.tar.gz
tar -xf rustc-nightly-i686-unknown-linux-gnu.tar.gz

RUST_BACKTRACE=1 LD_LIBRARY_PATH="rustc-nightly-x86_64-unknown-linux-gnu/lib" ./rustc-nightly-x86_64-unknown-linux-gnu/bin/rustc --target=i686-unknown-linux-gnu -L rustc-nightly-i686-unknown-linux-gnu/lib/rustlib/i686-unknown-linux-gnu/lib/ hello.rs

This produces:

error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Expected("Expected label \"ty\" but found \"predicates\"")', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/result.rs:743

stack backtrace:
   1:     0x7fc30de91490 - sys::backtrace::write::h49b06c4e5fa1765dZTA
   2:     0x7fc30deb6120 - failure::on_fail::h128a61ca90111ec2JFJ
   3:     0x7fc30de0d350 - rt::unwind::begin_unwind_inner::h142cc6242e7988934jJ
   4:     0x7fc30de0de60 - rt::unwind::begin_unwind_fmt::h9f6d3c7c640c0421AiJ
   5:     0x7fc30deb5f80 - rust_begin_unwind
   6:     0x7fc30df00540 - panicking::panic_fmt::h21faf6f60b06c77cSvw
   7:     0x7fc30be50950 - middle::astencode::reader..Decoder<'a>.rbml_decoder_decoder_helpers<'tcx>::read_type_scheme::hfbdcf75b538c3875okc
   8:     0x7fc30be709e0 - middle::astencode::decode_side_tables::closure.75211
   9:     0x7fc30bccd4f0 - middle::astencode::decode_inlined_item::h1be258f0a7eb2ea8Xqa
  10:     0x7fc30caf6b20 - trans::inline::instantiate_inline::closure.40385
  11:     0x7fc30c0ed9d0 - metadata::decoder::maybe_get_item_ast::h727a4975347bffd4JMk
  12:     0x7fc30bf10bd0 - metadata::csearch::maybe_get_item_ast::h1ce89de91301f293Egn
  13:     0x7fc30caf50b0 - trans::inline::instantiate_inline::h2ef566630855f9886nd
  14:     0x7fc30cb41030 - trans::callee::trans_fn_ref_with_substs::h5afdf505fb7c2ad0DDg
  15:     0x7fc30cb3f970 - trans::callee::trans_fn_ref::h779769ec72c3a506Mrg
  16:     0x7fc30cb3cb40 - trans::callee::trans::haf8f9c5fe9575300rgg
  17:     0x7fc30cb535a0 - trans::callee::trans_call_inner::h4488088470999471523
  18:     0x7fc30cb5bde0 - trans::expr::trans_rvalue_dps_unadjusted::h8e987a8cff8d69eeYZi
  19:     0x7fc30cb5b200 - trans::expr::trans_unadjusted::h5a418a30ac3a6b40tri
  20:     0x7fc30cb12ea0 - trans::expr::trans::hf1cde9ec5fb37335sJh
  21:     0x7fc30cb4d030 - trans::callee::trans_args::hce224e809afff6ae7ih
  22:     0x7fc30cb535a0 - trans::callee::trans_call_inner::h4488088470999471523
  23:     0x7fc30cb5bde0 - trans::expr::trans_rvalue_dps_unadjusted::h8e987a8cff8d69eeYZi
  24:     0x7fc30cb11d10 - trans::expr::trans_into::h30d9a8cb700b6c4cYFh
  25:     0x7fc30cb111b0 - trans::controlflow::trans_stmt_semi::h3cef538536ab6888Zde
  26:     0x7fc30cb12320 - trans::controlflow::trans_block::h710fedd9b6aa6013Qee
  27:     0x7fc30cbdfa30 - trans::base::trans_closure::he63c8fb49d6fa9e5ofu
  28:     0x7fc30cafd280 - trans::base::trans_fn::h16e5caa2531e2efeEqu
  29:     0x7fc30caf8420 - trans::base::trans_item::h04c6251e8dd304b9tPu
  30:     0x7fc30cbe7100 - trans::base::trans_crate::he0f846e22b2c2665NMv
  31:     0x7fc30e4c4040 - driver::phase_4_translate_to_llvm::he7c9038b456ca0d5wPa
  32:     0x7fc30e49cf60 - driver::compile_input::ha2540a3e586cc4ecEba
  33:     0x7fc30e570d60 - run_compiler::h15054257f14a11945bc
  34:     0x7fc30e56f3c0 - thunk::F.Invoke<A, R>::invoke::h12452595225713592450
  35:     0x7fc30e56e2b0 - rt::unwind::try::try_fn::h15446000090453491186
  36:     0x7fc30df22810 - rust_try_inner
  37:     0x7fc30df22800 - rust_try
  38:     0x7fc30e56e560 - thunk::F.Invoke<A, R>::invoke::h7454813734411192152
  39:     0x7fc30dea1d90 - sys::thread::thread_start::h76415ad3898ce7eaaOE
  40:     0x7fc307e562b0 - start_thread
  41:     0x7fc30da95249 - __clone
  42:                0x0 - <unknown>

This is again resolved by updating the libraries for i686, but a more helpful message would be better.

@tamird
Copy link
Contributor

tamird commented Apr 22, 2015

@alexcrichton this must be the 5th instance of this issue today :(

I suggest we close this - it seems not actionable.

@alexcrichton
Copy link
Member

I agree, thanks @tamird!

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
Show type alias layout

This PR expands on rust-lang#13490 to allow displaying layout data on hover for type aliases.
flip1995 added a commit to flip1995/rust that referenced this issue May 15, 2025
Violets are red,
Roses are blue,
It’s wrong on purpose —
We don’t break tradition.

<hr>

This is cat-penguin of this release [nominated
by](rust-lang/rust-clippy#12224 (comment))
@xFrednet some time ago:

![image](https://github.com/user-attachments/assets/49bd7783-9d56-4a15-b026-1c7e799ea7ba)

Cats for the next release can be traditionally nominated in the comments
:D
Please be more active and cat-minded 😻

<hr>

changelog: none

r? flip1995
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

5 participants