Repository navigation
Compiler panic on building Redox #32783
Copy link
Copy link
Closed
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
I tried to build current Redox OS HEAD with last available rustc-nightly and got an ICE.
Meta
rustc --version --verbose:
rustc 1.9.0-nightly (241a9d0dd 2016-04-05)
binary: rustic
commit-hash: 241a9d0ddf99fd40d273c615e9b1e8ce6052d94a
commit-date: 2016-04-05
host: x86_64-apple-darwin
release: 1.9.0-nightly
Backtrace:
❯❯❯ make qemu ⏎ master
RUST_BACKTRACE=1 rustc --target=i386-unknown-redox.json -L build/i386-unknown-redox/debug -C no-prepopulate-passes -C no-stack-check -C opt-level=2 -Z no-landing-pads -A dead_code -C ar=i386-elf-ar -C linker=i386-elf-gcc -o build/i386-unknown-redox/debug/libstd.rlib libstd/src/lib.rs -L native=libc/lib/
error: internal compiler error: ../src/librustc_metadata/encoder.rs:220: encode_symbol: id not found 49044
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<Any>', ../src/libsyntax/errors/mod.rs:575
stack backtrace:
1: 0x110b66978 - std::sys::backtrace::tracing::imp::write::h714760a4c8c0cdd8
2: 0x110b72dc5 - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hff309ab1d83ffd90
3: 0x110b728fd - std::panicking::default_hook::h08ad3bb09872855b
4: 0x110b36196 - std::sys_common::unwind::begin_unwind_inner::h406d5f1a330b854b
5: 0x110113cea - std::sys_common::unwind::begin_unwind::hb10e2b9ef92fd4a6
6: 0x110113b19 - syntax::errors::Handler::bug::h112319de7e910c9e
7: 0x10f494c9c - rustc::session::opt_span_bug_fmt::_$u7b$$u7b$closure$u7d$$u7d$::h2c926d3e6a2eb430
8: 0x10f494b01 - rustc::session::opt_span_bug_fmt::he2c7fbeab8bf3d1d
9: 0x10f4a36a9 - rustc::session::bug_fmt::h9f67e9cd7aa5a073
10: 0x10cab64f0 - rustc_metadata::encoder::encode_symbol::h165ac8a162612975
11: 0x10cac310b - rustc_metadata::encoder::encode_info_for_item::hfab1a46f9bf30c3c
12: 0x10cac9c71 - rustc::front::map::Map::with_path_next::h6ba163a93b4eab46
13: 0x10cac9ca4 - rustc::front::map::Map::with_path_next::h6ba163a93b4eab46
14: 0x10cac9ca4 - rustc::front::map::Map::with_path_next::h6ba163a93b4eab46
15: 0x10caccd4e - _<encoder..EncodeVisitor<'a, 'b, 'c, 'tcx> as rustc_front..intravisit..Visitor<'tcx>>::visit_item::h1cde6db68ffd78b8
16: 0x10cad3f5d - rustc_metadata::encoder::encode_metadata_inner::hcfb24759120a6c88
17: 0x10cacfb19 - rustc_metadata::encoder::encode_metadata::ha3e422357afb6bf6
18: 0x10cb2c07f - rustc_metadata::csearch::_<impl rustc..middle..cstore..CrateStore<'tcx> for cstore..CStore>::encode_metadata::h88a2f338ac9ea48a
19: 0x10ccafee2 - rustc_trans::base::trans_crate::_$u7b$$u7b$closure$u7d$$u7d$::h6042c55692ac48ec
20: 0x10cca1dfd - rustc_trans::base::trans_crate::h45d3e3b1384148fb
21: 0x10c24fce0 - rustc_driver::driver::phase_4_translate_to_llvm::h8d5ab3a4d94eae6a
22: 0x10c24e434 - rustc_driver::driver::compile_input::_$u7b$$u7b$closure$u7d$$u7d$::hd32acfaba89541b2
23: 0x10c24b02d - rustc_driver::driver::phase_3_run_analysis_passes::_$u7b$$u7b$closure$u7d$$u7d$::h1692b932d4d7b15b
24: 0x10c2451a5 - rustc::ty::context::TyCtxt::create_and_enter::h926ea4fe45f15d00
25: 0x10c241ba5 - rustc_driver::driver::phase_3_run_analysis_passes::h3c035e5cf4758407
26: 0x10c215af1 - rustc_driver::driver::compile_input::h650fe5b01cb8d74d
27: 0x10c1fc04f - rustc_driver::run_compiler::h68d23e0e9b7b247d
28: 0x10c1f93e2 - std::sys_common::unwind::try::try_fn::h67fde221a73148bc
29: 0x110b63fdb - __rust_try
30: 0x110b63f63 - std::sys_common::unwind::inner_try::h4e97625a08807651
31: 0x10c1f9c79 - _<F as std..boxed..FnBox<A>>::call_box::hc8936fa120642c49
32: 0x110b71c88 - std::sys::thread::Thread::new::thread_start::h74af400293164137
33: 0x7fff9f86399c - _pthread_body
34: 0x7fff9f863919 - _pthread_start
make: *** [build/i386-unknown-redox/debug/libstd.rlib] Error 101
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Activity
jackpot51 commentedon Apr 7, 2016
We are getting this in Redox travis too:
https://travis-ci.org/redox-os/redox/builds/121316042
It looks like it affects OS X and FreeBSD as well as Linux
https://github.com/redox-os/redox/issues/606#issuecomment-206649111
Viknet commentedon Apr 7, 2016
Older version of rustc doesn't have this error:
rustc --version --verbosejohalun commentedon Apr 7, 2016
Got problems here as well.
johalun commentedon Apr 7, 2016
make all in redox succeeds
make all in redox fails
pthariensflame commentedon Apr 8, 2016
Same here.
rustc -Vresponds withrustc 1.9.0-nightly (7979dd608 2016-04-07)andmake allproduces:Current redox commit is
53146f4ee9e5030b467990baae214c3ebeb37c98.joeabbey commentedon Apr 9, 2016
FWIW, also seeing the above reported issue
nikomatsakis commentedon Apr 12, 2016
What is the simplest way for me to reproduce this problem? Does anyone have a narrowed test case of any kind? The instructions at https://github.com/redox-os/redox seem complex (run some script, run qemu etc) -- it'd be great if there were some rust file I could build without all those steps. Any tips?
Viknet commentedon Apr 12, 2016
I'm sure, you can just clone Redox repo (git clone git@github.com:redox-os/redox.git --origin upstream --recursive; git submodule update --recursive --init), install nasm and try to build project (make all).
It will fail pretty early on compiling redox/libstd.
pmarcelll commentedon Apr 13, 2016
Based on @yohanesu75's comment, I examined the commits between the two nightlies, and the most suspicious was #32742. I've built a version of rustc based on e8ab71f (right before the merge), compiled Redox succesfully, built another version based on 953c3b5 (merge commit of #32742), with which I was able to reproduce the ICE.
cc @eddyb
jackpot51 commentedon Apr 14, 2016
Very interesting @pmarcelll. I am working to find the code in libstd that triggers it
jackpot51 commentedon Apr 14, 2016
I found it, it is alloc_system.rs
Trying to find a fix, the file can be seen here: https://github.com/redox-os/redox/blob/master/libstd/src/alloc_system.rs
eddyb commentedon Apr 14, 2016
@pmarcelll I see what the problem is. Writing the test is going to be the tricky part, I believe I need two
extern { fn ... }items using the same symbol, exported from the crate and used in another crate.