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 panic on big-endian PowerPC 64 #41443

Closed
hsivonen opened this issue Apr 21, 2017 · 11 comments
Closed

Compiler panic on big-endian PowerPC 64 #41443

hsivonen opened this issue Apr 21, 2017 · 11 comments
Assignees
Labels
A-metadata Area: Crate metadata I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@hsivonen
Copy link
Member

hsivonen commented Apr 21, 2017

rustc 1.18.0-nightly (ddc5d7b 2017-04-20) on Linux ppc64 (big-endian) panics when compiling a doc test from encoding_rs. No panic on x86_64.

Steps to reproduce:

  1. Use Linux on big-endian PPC 64 and install nightly Rust via rustup. (I used Fedora 25 in qemu; see Linking with panic machinery fails on Linux PPC64 #37996 for how. I used RUSTUP_USE_HYPER=1 to work around rustup having a broken libcurl at the moment.)

  2. Clone encoding_rs and checkout the latest commit at the time of filing this issue: 85f3d89ef81d77f35261f510b56aab023b0b9c46.

  3. Run RUST_BACKTRACE=1 cargo test in the encoding_rs directory.

Expected results:
No compiler panic.

Actual results:

---- src/lib.rs -  (line 38) stdout ----
	thread 'rustc' panicked at 'slice index starts at 2164457473 but ends at 4244', /checkout/src/libcore/slice/mod.rs:678
stack backtrace:
   0: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/panicking.rs:365
   4: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/panicking.rs:549
   5: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/panicking.rs:511
   6: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/panicking.rs:495
   7: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/panicking.rs:471
   8: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libcore/panicking.rs:69
   9: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libcore/slice/mod.rs:678
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>
  15: rust_metadata_rustc_ffd9b1750805273645076f69fba62fdb
  16: rust_metadata_rustc_ffd9b1750805273645076f69fba62fdb
  17: rust_metadata_rustc_ffd9b1750805273645076f69fba62fdb
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>
  23: <unknown>
  24: <unknown>
  25: rust_metadata_rustc_ffd9b1750805273645076f69fba62fdb
  26: rust_metadata_rustc_ffd9b1750805273645076f69fba62fdb
  27: <unknown>
  28: <unknown>
  29: <unknown>
  30: <unknown>
  31: <unknown>
  32: <unknown>
  33: <unknown>
  34: <unknown>
  35: <unknown>
  36: <unknown>
  37: <unknown>
  38: <unknown>
  39: <unknown>
  40: <unknown>
  41: <unknown>
  42: rust_metadata_rustc_ffd9b1750805273645076f69fba62fdb
  43: rust_metadata_rustc_ffd9b1750805273645076f69fba62fdb
  44: rust_metadata_rustc_ffd9b1750805273645076f69fba62fdb
  45: <unknown>
  46: rust_metadata_rustc_ffd9b1750805273645076f69fba62fdb
  47: rust_metadata_rustc_ffd9b1750805273645076f69fba62fdb
  48: <unknown>
  49: <unknown>
  50: <unknown>
  51: <unknown>
  52: <unknown>
  53: rust_metadata_rustdoc_9a3173292f99a3ed50ba39e38caf6298
  54: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libpanic_unwind/lib.rs:98
  55: <unknown>
  56: rust_metadata_rustdoc_9a3173292f99a3ed50ba39e38caf6298
  57: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libpanic_unwind/lib.rs:98
  58: <unknown>
  59: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/liballoc/boxed.rs:650
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84
  60: <unknown>
  61: <unknown>
thread 'rustc' panicked at 'couldn't compile the test', /checkout/src/librustdoc/test.rs:270
stack backtrace:
   0: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/panicking.rs:365
   4: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libstd/panicking.rs:549
   5: rust_metadata_rustdoc_9a3173292f99a3ed50ba39e38caf6298
   6: <unknown>
   7: rust_metadata_rustdoc_9a3173292f99a3ed50ba39e38caf6298
   8: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/libpanic_unwind/lib.rs:98
   9: <unknown>
  10: rust_metadata_std_0ff3d7f6ad2422744699d0f70ff8c1ff
             at /checkout/src/liballoc/boxed.rs:650
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84
  11: <unknown>
  12: <unknown>
@sfackler sfackler added A-metadata Area: Crate metadata I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Apr 21, 2017
@arielb1 arielb1 added I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 23, 2017
@nikomatsakis
Copy link
Contributor

triage: P-high

@nagisa will do some investigation and try to reproduce.

@rust-highfive rust-highfive added P-high High priority and removed I-nominated labels Apr 27, 2017
@nagisa nagisa self-assigned this Apr 27, 2017
@nagisa
Copy link
Member

nagisa commented Apr 29, 2017

I can reproduce this one. Will attempt to reduce.

@nagisa
Copy link
Member

nagisa commented Apr 29, 2017

A proper backtrace

#0  core::panicking::panic_fmt () at /checkout/src/libcore/panicking.rs:69
#1  0x00003fffb7cfe248 in core::slice::slice_index_order_fail () at /checkout/src/libcore/slice/mod.rs:678
#2  0x00003fffb70d1f18 in .rustc_metadata::index::_$LT$impl$u20$rustc_metadata..schema..LazySeq$LT$rustc_metadata..index..Index$GT$$GT$::lookup::h98cc9de9f25fcb8e ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#3  0x00003fffb70ee804 in .rustc_metadata::decoder::_$LT$impl$u20$rustc_metadata..cstore..CrateMetadata$GT$::entry::h2dcb1ac8f24a6d94 ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#4  0x00003fffb70ef1bc in .rustc_metadata::decoder::_$LT$impl$u20$rustc_metadata..cstore..CrateMetadata$GT$::get_variant::h8e6c02c1598ab18e ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#5  0x00003fffb70ef480 in .rustc_metadata::decoder::_$LT$impl$u20$rustc_metadata..cstore..CrateMetadata$GT$::get_adt_def::h522a31389da1ef4c ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#6  0x00003fffb711d864 in .rustc_metadata::cstore_impl::provide::adt_def::h9de3b2f35340a240 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#7  0x00003fffb6c9f69c in .rustc::ty::maps::_$LT$impl$u20$rustc..ty..maps..queries..adt_def$LT$$u27$tcx$GT$$GT$::try_get::hccb13d4030370060 ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc-ce6284c9885418c9.so
#8  0x00003fffb6cbcacc in .rustc::ty::maps::TyCtxtAt::adt_def::h0fd6b5db2c4ae164 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc-ce6284c9885418c9.so
#9  0x00003fffb6cbb0fc in .rustc::ty::maps::_$LT$impl$u20$rustc..ty..context..TyCtxt$LT$$u27$a$C$$u20$$u27$tcx$C$$u20$$u27$lcx$GT$$GT$::adt_def::hcf9928fca26a15cc ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc-ce6284c9885418c9.so
#10 0x00003fffb70ecacc in ._$LT$rustc_metadata..decoder..DecodeContext$LT$$u27$a$C$$u20$$u27$tcx$GT$$u20$as$u20$serialize..serialize..SpecializedDecoder$LT$$RF$$u27$tcx$u20$rustc..ty..AdtDef$GT$$GT$::specialized_decode::h13dbc06777fc5fb3
    () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#11 0x00003fffb70eb0d0 in ._$LT$rustc_metadata..decoder..DecodeContext$LT$$u27$a$C$$u20$$u27$tcx$GT$$u20$as$u20$serialize..serialize..SpecializedDecoder$LT$$RF$$u27$tcx$u20$rustc..ty..TyS$LT$$u27$tcx$GT$$GT$$GT$::specialized_decode::hf545939632440f00 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#12 0x00003fffb70aeb6c in .serialize::serialize::Decoder::read_enum_variant_arg::hb425955af9c5980c () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#13 0x00003fffb70eb748 in ._$LT$rustc_metadata..decoder..DecodeContext$LT$$u27$a$C$$u20$$u27$tcx$GT$$u20$as$u20$serialize..serialize..SpecializedDecoder$LT$$RF$$u27$tcx$u20$rustc..ty..TyS$LT$$u27$tcx$GT$$GT$$GT$::specialized_decode::hf545939632440f00 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#14 0x00003fffb70eab18 in ._$LT$rustc_metadata..decoder..DecodeContext$LT$$u27$a$C$$u20$$u27$tcx$GT$$u20$as$u20$serialize..serialize..SpecializedDecoder$LT$$RF$$u27$tcx$u20$rustc..ty..TyS$LT$$u27$tcx$GT$$GT$$GT$::specialized_decode::hf545939632440f00 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#15 0x00003fffb70f1c08 in .rustc_metadata::decoder::_$LT$impl$u20$rustc_metadata..cstore..CrateMetadata$GT$::get_type::h8b681362772ff2a6 ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#16 0x00003fffb711c91c in .rustc_metadata::cstore_impl::provide::type_of::h2fa72f695a64be56 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_metadata-1c582c40937620b6.so
#17 0x00003fffb6c99f70 in .rustc::ty::maps::_$LT$impl$u20$rustc..ty..maps..queries..type_of$LT$$u27$tcx$GT$$GT$::try_get_with::h574417bcc18bda6a ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc-ce6284c9885418c9.so
#18 0x00003fffb6cbac14 in .rustc::ty::maps::_$LT$impl$u20$rustc..ty..context..TyCtxt$LT$$u27$a$C$$u20$$u27$tcx$C$$u20$$u27$lcx$GT$$GT$::type_of::h9e74d1ddc647e515 ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc-ce6284c9885418c9.so
#19 0x00003fffb750e1c8 in .rustc_typeck::check::FnCtxt::instantiate_value_path::h2e8b3982e4e5835e () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#20 0x00003fffb7504b94 in .rustc_typeck::check::FnCtxt::check_expr_kind::h62f9fa86055e5da9 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#21 0x00003fffb7503864 in .rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref::hfb489b8183d9e21b ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#22 0x00003fffb7504690 in .rustc_typeck::check::FnCtxt::check_expr_kind::h62f9fa86055e5da9 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#23 0x00003fffb7503864 in .rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref::hfb489b8183d9e21b ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#24 0x00003fffb750ca84 in .rustc_typeck::check::FnCtxt::check_decl_initializer::h08160464d5b163d8 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#25 0x00003fffb750cbc4 in .rustc_typeck::check::FnCtxt::check_decl_local::hb662a33c4fc28485 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#26 0x00003fffb750cea0 in .rustc_typeck::check::FnCtxt::check_stmt::h9d95ba21dd56b6fe () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#27 0x00003fffb750d858 in .rustc_typeck::check::FnCtxt::check_block_with_expected::_$u7b$$u7b$closure$u7d$$u7d$::he2d3af3fee8df64c ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#28 0x00003fffb750d2dc in .rustc_typeck::check::FnCtxt::check_block_with_expected::h7b61aaa2c43cbf74 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#29 0x00003fffb7504640 in .rustc_typeck::check::FnCtxt::check_expr_kind::h62f9fa86055e5da9 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#30 0x00003fffb7503864 in .rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref::hfb489b8183d9e21b ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#31 0x00003fffb7500710 in .rustc_typeck::check::FnCtxt::check_return_expr::hfc45bcf017181f2b () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#32 0x00003fffb74f308c in .rustc_typeck::check::check_fn::hadae288080c9dba2 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#33 0x00003fffb74f1b14 in .rustc_typeck::check::typeck_tables_of::h47f169e6f876fdda () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#34 0x00003fffb6cae6e0 in .rustc::ty::maps::_$LT$impl$u20$rustc..ty..maps..queries..typeck_tables_of$LT$$u27$tcx$GT$$GT$::try_get::he76002af05691dcc ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc-ce6284c9885418c9.so
#35 0x00003fffb6cbe1bc in .rustc::ty::maps::TyCtxtAt::typeck_tables_of::h5d3d4fac6d9d48a3 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc-ce6284c9885418c9.so
#36 0x00003fffb6cbbb00 in .rustc::ty::maps::_$LT$impl$u20$rustc..ty..context..TyCtxt$LT$$u27$a$C$$u20$$u27$tcx$C$$u20$$u27$lcx$GT$$GT$::typeck_tables_of::hb7737ac1df5175f0 ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc-ce6284c9885418c9.so
#37 0x00003fffb74f0a74 in .rustc_typeck::check::typeck_item_bodies::h9ad82d5ce3097452 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#38 0x00003fffb6cad930 in .rustc::ty::maps::_$LT$impl$u20$rustc..ty..maps..queries..typeck_item_bodies$LT$$u27$tcx$GT$$GT$::try_get::h8bea64802a8d8cb9 ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc-ce6284c9885418c9.so
#39 0x00003fffb6cbe054 in .rustc::ty::maps::TyCtxtAt::typeck_item_bodies::h4e75c317234befde () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc-ce6284c9885418c9.so
#40 0x00003fffb6cbbaac in .rustc::ty::maps::_$LT$impl$u20$rustc..ty..context..TyCtxt$LT$$u27$a$C$$u20$$u27$tcx$C$$u20$$u27$lcx$GT$$GT$::typeck_item_bodies::hddf0462ee9523eaa ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc-ce6284c9885418c9.so
#41 0x00003fffb7540a48 in .rustc_typeck::check_crate::h16f92e6a986fd98b () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/../lib/librustc_typeck-ad206c419aaafe68.so
#42 0x00003fffb7ec5f88 in .rustc_driver::driver::phase_3_run_analysis_passes::_$u7b$$u7b$closure$u7d$$u7d$::ha83538a03579857c ()
   from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/librustc_driver-0f4024af7b82b2df.so
#43 0x00003fffb7ebbf40 in .rustc_driver::driver::phase_3_run_analysis_passes::hfea44285662197cc () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/librustc_driver-0f4024af7b82b2df.so
#44 0x00003fffb7e90024 in .rustc_driver::driver::compile_input::hc74994fea2a7b3d8 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/librustc_driver-0f4024af7b82b2df.so
#45 0x00003fffb7eebaac in .rustc_driver::run_compiler::hccc057d367b00a4b () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/librustc_driver-0f4024af7b82b2df.so
#46 0x00003fffb7dc3178 in .std::panicking::try::do_call::hbc2a3c31903904db () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/librustc_driver-0f4024af7b82b2df.so
#47 0x00003fffb7ce9bc4 in panic_unwind::__rust_maybe_catch_panic () at /checkout/src/libpanic_unwind/lib.rs:98
#48 0x00003fffb7e105f0 in ._$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::h223b45f4646df348 () from /root/.rustup/toolchains/nightly-powerpc64-unknown-linux-gnu/bin/../lib/librustc_driver-0f4024af7b82b2df.so
#49 0x00003fffb7cdbfe8 in alloc::boxed::{{impl}}::call_once<(),()> () at /checkout/src/liballoc/boxed.rs:658
#50 std::sys_common::thread::start_thread () at /checkout/src/libstd/sys_common/thread.rs:21
#51 std::sys::imp::thread::{{impl}}::new::thread_start () at /checkout/src/libstd/sys/unix/thread.rs:84
#52 0x00003fffb1eabe64 in .start_thread () from /lib64/power8/libpthread.so.0
#53 0x00003fffb7b31534 in .__clone () from /lib64/power8/libc.so.6

@nagisa nagisa added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Apr 29, 2017
@nagisa
Copy link
Member

nagisa commented Apr 29, 2017

Regression range:

FIRST BAD: nightly-2017-03-24 (e703b33 2017-03-23)
LAST GOOD: nightly-2017-03-23 (8c4f2c6 2017-03-22)

COMMITS: 8c4f2c6...e703b33

Commit range:

EDIT: oh wait, I messed up my regression range somehow, rebisecting: All good now

nightly-2017-03-31 (5c94997 2017-03-30) BAD
nightly-2017-03-15 (6f10e2f 2017-03-14) GOOD
nightly-2017-03-26 (49c67bd 2017-03-24) BAD
nightly-2017-03-19 (4853584 2017-03-18) GOOD
nightly-2017-03-21 (134c4a0 2017-03-20) GOOD
nightly-2017-03-23 (8c4f2c6 2017-03-22) GOOD
nightly-2017-03-24 (e703b33 2017-03-23) BAD

@hsivonen
Copy link
Member Author

Not specific to PPC64. I'm seeing this also on 32-bit big-endian MIPS (also in qemu) using revision a40401d02b3eff46c63fce0a3e81a34580a1334e of encoding_rs and rustc 1.18.0-nightly (128aa26 2017-04-28):

---- src/lib.rs -  (line 40) stdout ----
	thread 'rustc' panicked at 'slice index starts at 2667773953 but ends at 4384', /checkout/src/libcore/slice/mod.rs:678
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:365
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:495
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:471
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:69
   9: core::slice::slice_index_order_fail
             at /checkout/src/libcore/slice/mod.rs:678
  10: rustc_metadata::index::<impl rustc_metadata::schema::LazySeq<rustc_metadata::index::Index>>::lookup
  11: rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::entry
  12: rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::get_variant
  13: rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::get_adt_def
  14: rustc_metadata::cstore_impl::provide::adt_def
  15: rustc::ty::maps::<impl rustc::ty::maps::queries::adt_def<'tcx>>::try_get
  16: rustc::ty::maps::TyCtxtAt::adt_def
  17: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::adt_def
  18: <rustc_metadata::decoder::DecodeContext<'a, 'tcx> as serialize::serialize::SpecializedDecoder<&'tcx rustc::ty::AdtDef>>::specialized_decode
  19: <rustc_metadata::decoder::DecodeContext<'a, 'tcx> as serialize::serialize::SpecializedDecoder<&'tcx rustc::ty::TyS<'tcx>>>::specialized_decode
  20: serialize::serialize::Decoder::read_enum_variant_arg
  21: <rustc_metadata::decoder::DecodeContext<'a, 'tcx> as serialize::serialize::SpecializedDecoder<&'tcx rustc::ty::TyS<'tcx>>>::specialized_decode
  22: <rustc_metadata::decoder::DecodeContext<'a, 'tcx> as serialize::serialize::SpecializedDecoder<&'tcx rustc::ty::TyS<'tcx>>>::specialized_decode
  23: rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::get_type
  24: rustc_metadata::cstore_impl::provide::type_of
  25: rustc::ty::maps::<impl rustc::ty::maps::queries::type_of<'tcx>>::try_get_with
  26: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::type_of
  27: rustc_typeck::check::FnCtxt::instantiate_value_path
  28: rustc_typeck::check::FnCtxt::check_expr_kind
  29: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref
  30: rustc_typeck::check::FnCtxt::check_expr_kind
  31: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref
  32: rustc_typeck::check::FnCtxt::check_decl_initializer
  33: rustc_typeck::check::FnCtxt::check_decl_local
  34: rustc_typeck::check::FnCtxt::check_stmt
  35: rustc_typeck::check::FnCtxt::check_block_with_expected::{{closure}}
  36: rustc_typeck::check::FnCtxt::check_block_with_expected
  37: rustc_typeck::check::FnCtxt::check_expr_kind
  38: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref
  39: rustc_typeck::check::FnCtxt::check_return_expr
  40: rustc_typeck::check::check_fn
  41: rustc_typeck::check::typeck_tables_of
  42: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
  43: rustc::ty::maps::TyCtxtAt::typeck_tables_of
  44: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_tables_of
  45: rustc_typeck::check::typeck_item_bodies
  46: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get
  47: rustc::ty::maps::TyCtxtAt::typeck_item_bodies
  48: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies
  49: rustc_typeck::check_crate
  50: rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}
  51: rustc_driver::driver::phase_3_run_analysis_passes
  52: rustc_driver::driver::compile_input
  53: std::panicking::try::do_call
  54: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  55: rustdoc::test::runtest
  56: std::panicking::try::do_call
  57: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  58: <F as alloc::boxed::FnBox<A>>::call_box
  59: std::sys::imp::thread::Thread::new::thread_start
             at /checkout/src/liballoc/boxed.rs:658
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84
  60: <unknown>
thread 'rustc' panicked at 'couldn't compile the test', /checkout/src/librustdoc/test.rs:273
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:365
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
   6: rustdoc::test::runtest
   7: std::panicking::try::do_call
   8: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
   9: <F as alloc::boxed::FnBox<A>>::call_box
  10: std::sys::imp::thread::Thread::new::thread_start
             at /checkout/src/liballoc/boxed.rs:658
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84
  11: <unknown>

---- src/lib.rs -  (line 55) stdout ----
	thread 'rustc' panicked at 'slice index starts at 2667773953 but ends at 4384', /checkout/src/libcore/slice/mod.rs:678
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:365
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:495
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:471
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:69
   9: core::slice::slice_index_order_fail
             at /checkout/src/libcore/slice/mod.rs:678
  10: rustc_metadata::index::<impl rustc_metadata::schema::LazySeq<rustc_metadata::index::Index>>::lookup
  11: rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore for rustc_metadata::cstore::CStore>::item_children
  12: rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver<'a>>::populate_module_if_necessary
  13: rustc_resolve::resolve_imports::<impl rustc_resolve::Resolver<'a>>::resolve_ident_in_module
  14: rustc_resolve::Resolver::resolve_path
  15: rustc_resolve::Resolver::resolve_qpath
  16: rustc_resolve::Resolver::smart_resolve_path_fragment
  17: rustc_resolve::Resolver::smart_resolve_path
  18: syntax::ast::Pat::walk
  19: rustc_resolve::Resolver::resolve_arm
  20: syntax::visit::walk_expr
  21: rustc_resolve::Resolver::resolve_expr
  22: rustc_resolve::Resolver::resolve_block
  23: rustc_resolve::Resolver::resolve_expr
  24: rustc_resolve::Resolver::resolve_block
  25: rustc_resolve::Resolver::resolve_expr
  26: rustc_resolve::Resolver::resolve_block
  27: <rustc_resolve::Resolver<'a> as syntax::visit::Visitor<'tcx>>::visit_fn
  28: syntax::visit::walk_item
  29: rustc_resolve::Resolver::resolve_item
  30: rustc_resolve::Resolver::resolve_crate
  31: rustc_driver::driver::phase_2_configure_and_expand
  32: rustc_driver::driver::compile_input
  33: std::panicking::try::do_call
  34: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  35: rustdoc::test::runtest
  36: std::panicking::try::do_call
  37: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  38: <F as alloc::boxed::FnBox<A>>::call_box
  39: std::sys::imp::thread::Thread::new::thread_start
             at /checkout/src/liballoc/boxed.rs:658
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84
  40: <unknown>
thread 'rustc' panicked at 'couldn't compile the test', /checkout/src/librustdoc/test.rs:273
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:365
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
   6: rustdoc::test::runtest
   7: std::panicking::try::do_call
   8: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
   9: <F as alloc::boxed::FnBox<A>>::call_box
  10: std::sys::imp::thread::Thread::new::thread_start
             at /checkout/src/liballoc/boxed.rs:658
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84
  11: <unknown>

@nagisa
Copy link
Member

nagisa commented Apr 29, 2017

cc @michaelwoerister you sure your from_le in #40518 are okay? Or metadata changes in general?

@michaelwoerister
Copy link
Member

@nagisa It certainly looks like a hot candidate! @eddyb, the words_to_bytes function doesn't seem to do any endianness conversion, but reading from those bytes again does. Is there any deeper reason why it is that way? Otherwise that's probably the bug.

@arielb1
Copy link
Contributor

arielb1 commented Apr 30, 2017

@nagisa

Alignment trouble? That's not a a segfault

@eddyb
Copy link
Member

eddyb commented Apr 30, 2017

@michaelwoerister The endianness conversion is done ahead of time, to avoid having the byte <-> words conversion functions do any work.

EDIT: What's likely the problem here is a missing .to_le() when writing this length.

nagisa added a commit to nagisa/rust that referenced this issue May 1, 2017
I compiled this on PPC to check and it seems to work, but not sure whether I didn't mess up
anything in a major way.

Maybe a good shot at rust-lang#41443
bors added a commit that referenced this issue May 1, 2017
Try fixing bigendian metadata serialisation

I compiled this on PPC to check and it seems to work, but not sure whether I didn't mess up
anything in a major way.

Maybe a good shot at #41443

The easiest way to *really* test this is to land the patch (a high priority would be good, since I quite literally am just twiddling my thumbs on this now), wait for nightly, and, if the nightly works, backport this to beta.
@nagisa
Copy link
Member

nagisa commented May 2, 2017

The most recent nightly seems to have fixed this.

@nagisa nagisa closed this as completed May 2, 2017
@hsivonen
Copy link
Member Author

hsivonen commented May 3, 2017

Verified fixed in rustc 1.19.0-nightly (6a5fc9e 2017-05-02) on both PPC64 and mips (32-bit big-endian).

Thank you.

cuviper pushed a commit to cuviper/rust that referenced this issue May 9, 2017
I compiled this on PPC to check and it seems to work, but not sure whether I didn't mess up
anything in a major way.

Maybe a good shot at rust-lang#41443
brson pushed a commit to brson/rust that referenced this issue May 10, 2017
I compiled this on PPC to check and it seems to work, but not sure whether I didn't mess up
anything in a major way.

Maybe a good shot at rust-lang#41443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-metadata Area: Crate metadata I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants