Skip to content

ICE with RUST_LOG=debug and dependency rand #36622

Closed
@Eroc33

Description

@Eroc33

UPDATE: Note that @eddyb would like to mentor and wrote out some steps to fix this in a comment below.


cargo 0.13.0-nightly (2ef3cde 2016-09-04)
rustc 1.13.0-nightly (cbe4de78e 2016-09-05)

repro steps:

  1. Create a new cargo project with cargo new --bin whatever
  2. add rand to the dependencies
  3. compile with RUST_LOG=debug cargo run

(Edit: RUST_LOG=debug cargo build also triggers the ICE)

(Note that using various different crates as dependencies will also cause various different ICEs)

(Also note that most of these ICEs do not occur if not setting RUST_LOG while compiling)

full log: ice_log.txt

Relevant excerpt:

INFO:rustc_trans::base: trans_closure(..., <I as std::iter::IntoIterator><std::iter::Chain<std::iter::Map<std::slice::Iter<u64>, [closure@C:\Users\euan\.cargo\registry\src\github.com-1ecc6299db9ec823\rand-0.3.14\src\isaac.rs:462:41: 462:47]>, std::iter::Repeat<u64>>>::into_iter)
INFO:rustc_trans::base: trans_closure(..., <I as std::iter::IntoIterator><std::iter::Map<std::ops::Range<usize>, [closure@C:\Users\euan\.cargo\registry\src\github.com-1ecc6299db9ec823\rand-0.3.14\src\isaac.rs:378:47: 378:56]>>::into_iter)
INFO:rustc_trans::base: trans_closure(..., <I as std::iter::IntoIterator><std::iter::Zip<std::slice::IterMut<std::num::Wrapping<u64>>, std::iter::Chain<std::iter::Map<std::slice::Iter<u64>, [closure@C:\Users\euan\.cargo\registry\src\github.com-1ecc6299db9ec823\rand-0.3.14\src\isaac.rs:462:41: 462:47]>, std::iter::Repeat<u64>>>>::into_iter)
INFO:rustc_trans::base: trans_closure(..., <&'a T as std::fmt::Display><str>::fmt)
INFO:rustc_trans::base: trans_closure(..., <std::rc::Rc<T> as std::ops::Drop><std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>>::drop)
INFO:rustc_trans::base: trans_closure(..., <std::rc::Rc<T> as std::ops::Deref><std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>>::deref)
INFO:rustc_trans::base: trans_closure(..., <std::rc::Rc<std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>> as std::rc::RcBoxPtr<std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>>>::dec_strong)
INFO:rustc_trans::base: trans_closure(..., <std::rc::Rc<std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>> as std::rc::RcBoxPtr<std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>>>::inc_strong)
INFO:rustc_trans::base: trans_closure(..., ERROR:rbml::reader: failed to find block with tag 143
error: internal compiler error: unexpected panic

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 'explicit panic', ../src/librbml/lib.rs:436
stack backtrace:
   0:     0x7ffa3ff56fda - <std::rand::OsRng as rand::Rng>::fill_bytes::h076068e3d5c70638
   1:     0x7ffa3ff54d40 - std::panicking::Location::line::h1d71b2da86bcc037
   2:     0x7ffa3ff557cd - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
   3:     0x7ffa44651273 - <unknown>
   4:     0x7ffa4465302c - rbml::reader::get_doc::hf109ec97c202ad64
   5:     0x7ffa3d024707 - rustc_metadata::decoder::get_generics::hf99308a6734a6c62
   6:     0x7ffa3d04409f - rustc_metadata::csearch::<impl rustc::middle::cstore::CrateStore<'tcx> for rustc_metadata::cstore::CStore>::item_generics::h44e6e64c15136301
   7:     0x7ffa3780a432 - rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::lookup_generics::h5d0ec4d9f7a8a996
   8:     0x7ffa378122b2 - rustc::util::ppaux::parameterized::hfe6ba681ef424d4e
   9:     0x7ffa3fbc61aa - <rustc_trans::monomorphize::Instance<'tcx> as core::fmt::Display>::fmt::h4bb5172b1516f67e
  10:     0x7ffa3ff85694 - core::fmt::write::h300d6e605e327781
  11:     0x7ffa3ff85392 - <core::fmt::Arguments<'a> as core::fmt::Debug>::fmt::h1da25a9952bf0c75
  12:     0x7ffa3ff85694 - core::fmt::write::h300d6e605e327781
  13:     0x7ffa3ff337dd - <std::io::stdio::Stderr as std::io::Write>::write_fmt::h559a8ee8db54dc03
  14:     0x7ffa4ae41fbc - <log::DefaultLogger as log::Logger>::log::h514ee6b9954c2db7
  15:     0x7ffa4ae42d85 - log::log::h551356a60d785f61
  16:     0x7ffa3fb2f1a6 - rustc_trans::base::<impl rustc_trans::common::FunctionContext<'blk, 'tcx>>::build_return_block::hc40c124e6ced672c
  17:     0x7ffa3fb54cf1 - <rustc_trans::cleanup::UnwindKind as core::cmp::PartialEq>::eq::h586cba4e1cacdefe
  18:     0x7ffa3fbbdec2 - <rustc_trans::mir::operand::OperandRef<'tcx> as core::fmt::Debug>::fmt::hebcdf3c5cd4db77c
  19:     0x7ffa3fbaa046 - <rustc_trans::mir::analyze::CleanupKind as core::cmp::PartialEq>::ne::ha52631b54e0dcbae
  20:     0x7ffa3fba725f - <rustc_trans::mir::CachedMir<'mir, 'tcx> as core::ops::Deref>::deref::h6f4e0d0cf4c71518
  21:     0x7ffa3fb2f409 - rustc_trans::base::<impl rustc_trans::common::FunctionContext<'blk, 'tcx>>::build_return_block::hc40c124e6ced672c
  22:     0x7ffa3fbcf025 - rustc_trans::trans_item::TransItem::define::h159a1f0a8708f3d3
  23:     0x7ffa3fb33221 - rustc_trans::base::trans_crate::hf067cf9d0a8bcbf2
  24:     0x7ffa4024deb4 - rustc_driver::driver::phase_4_translate_to_llvm::he9d5d0022988d46e
  25:     0x7ffa4029d483 - rustc_driver::main::h5a1049f207c7c577
  26:     0x7ffa40280641 - rustc_driver::main::h5a1049f207c7c577
  27:     0x7ffa401be5d2 - <unknown>
  28:     0x7ffa4023dadf - rustc_driver::driver::compile_input::h7dacd98cd2fd7d2b
  29:     0x7ffa4026a5e9 - rustc_driver::run_compiler::h37c4294ab73436f7
  30:     0x7ffa4018b051 - <unknown>
  31:     0x7ffa3ff5fa31 - _rust_maybe_catch_panic
  32:     0x7ffa401a84f4 - <unknown>
  33:     0x7ffa3ff529ce - std::sys::thread::Thread::new::h117e066ad5633902
  34:     0x7ffa65788363 - BaseThreadInitThunk

INFO:cargo::ops::cargo_rustc::job_queue: end: rand v0.3.14 => Target(lib)/Profile(build) => Host
DEBUG:cargo: handle_error; err=CliError { error: Some(ChainedError { error: Could not compile `rand`., cause: Process didn't exit successfully: `rustc C:\Users\euan\.cargo\registry\src\github.com-1ecc6299db9ec823\rand-0.3.14\src\lib.rs --crate-name rand --crate-type lib -g -C metadata=49a08859d086fffe -C extra-filename=-49a08859d086fffe --out-dir D:\dev\rust\testing\target\debug\deps --emit=dep-info,link -L dependency=D:\dev\rust\testing\target\debug\deps --extern libc=D:\dev\rust\testing\target\debug\deps\liblibc-1417726cb94dbc83.rlib --cap-lints allow` (exit code: 101) }), unknown: false, exit_code: 101 }
error: Could not compile `rand`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions