Skip to content

ICE in collect_and_partition_mono_items #57430

Closed
@vorner

Description

@vorner

I don't really know where to start minimizing this thing. The code is a nasty beast and not everything in the repository compiles right now (I'm currently struggling with HRTBs in there and such). Anyway:

  • Clone the https://github.com/vorner/spirit repository
  • Check out the commit 0ce253e4ec35a8accaf4924f17180cd0a9696e78
  • Run cargo +nightly-2019-01-07 run --package spirit-reqwest --example make_request
  • The following ICE falls out:
error: internal compiler error: src/librustc_mir/monomorphize/collector.rs:747: Cannot create local mono-item for DefId(21/0:300 ~ config[6427]::file[0]::{{impl}}[0]::from_str[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:590:9
stack backtrace:
   0:     0x7fd0230b01a3 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h1492ea7cec121a33
                               at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1:     0x7fd0230a8808 - std::sys_common::backtrace::_print::h28383da39102314d
                               at src/libstd/sys_common/backtrace.rs:70
   2:     0x7fd0230ac332 - std::panicking::default_hook::{{closure}}::h6958e24be6a075eb
                               at src/libstd/sys_common/backtrace.rs:58
                               at src/libstd/panicking.rs:200
   3:     0x7fd0230ac0a4 - std::panicking::default_hook::h453a171789f64b19
                               at src/libstd/panicking.rs:215
   4:     0x7fd01f3114ff - rustc::util::common::panic_hook::hef4cee339a2b4fc5
   5:     0x7fd0230acb19 - std::panicking::rust_panic_with_hook::hdef6b4d70bac6cdb
                               at src/libstd/panicking.rs:482
   6:     0x7fd01e17f4cc - std::panicking::begin_panic::hff504b5ae3f2aed9
   7:     0x7fd01e19e38e - rustc_errors::Handler::bug::ha00d071a7722ac53
   8:     0x7fd01f17e5de - rustc::util::bug::opt_span_bug_fmt::{{closure}}::hfd250b1fd98637e5
   9:     0x7fd01f17d9c9 - rustc::ty::context::tls::with_opt::{{closure}}::h3796fb43b823cc58
  10:     0x7fd01f17d8e4 - rustc::ty::context::tls::with_context_opt::h07df1bd288f39a1a
  11:     0x7fd01f17d976 - rustc::ty::context::tls::with_opt::h4dd2a44bcfb8fb2b
  12:     0x7fd01f17e4e4 - rustc::util::bug::opt_span_bug_fmt::hcb3688100a278b16
  13:     0x7fd01f17e456 - rustc::util::bug::bug_fmt::h62900f94ae194a93
  14:     0x7fd01ff28386 - rustc_mir::monomorphize::collector::should_monomorphize_locally::hb4972c21879246cd
  15:     0x7fd01ff27ff4 - rustc_mir::monomorphize::collector::visit_instance_use::he2b609b042c96762
  16:     0x7fd01ff27a78 - <rustc_mir::monomorphize::collector::MirNeighborCollector<'a, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_terminator_kind::h95660bab391f4e89
  17:     0x7fd01ff24be6 - rustc_mir::monomorphize::collector::collect_items_rec::h67da2bf4b1a5e7c4
  18:     0x7fd01ff2587f - rustc_mir::monomorphize::collector::collect_items_rec::h67da2bf4b1a5e7c4
  19:     0x7fd01ff2587f - rustc_mir::monomorphize::collector::collect_items_rec::h67da2bf4b1a5e7c4
  20:     0x7fd01ff2587f - rustc_mir::monomorphize::collector::collect_items_rec::h67da2bf4b1a5e7c4
  21:     0x7fd01ff2587f - rustc_mir::monomorphize::collector::collect_items_rec::h67da2bf4b1a5e7c4
  22:     0x7fd01ff2587f - rustc_mir::monomorphize::collector::collect_items_rec::h67da2bf4b1a5e7c4
  23:     0x7fd01ff2587f - rustc_mir::monomorphize::collector::collect_items_rec::h67da2bf4b1a5e7c4
  24:     0x7fd01ff2587f - rustc_mir::monomorphize::collector::collect_items_rec::h67da2bf4b1a5e7c4
  25:     0x7fd01ff9f3ad - rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}::h2af1c87112323a03
  26:     0x7fd01ff4c286 - rustc::util::common::time::h286b1dad20da2123
  27:     0x7fd01ff23e0d - rustc_mir::monomorphize::collector::collect_crate_mono_items::h4e9b3a8e4f502e53
  28:     0x7fd01ff4c3da - rustc::util::common::time::h3aed30c09566a540
  29:     0x7fd01fcbb9e3 - rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items::h67f94873bae784e8
  30:     0x7fd0193e61b6 - rustc::ty::query::__query_compute::collect_and_partition_mono_items::h9f82d9bdf2152918
  31:     0x7fd0193e6598 - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::collect_and_partition_mono_items<'tcx>>::compute::hfe18cd95125d7663
  32:     0x7fd01946b18e - rustc::dep_graph::graph::DepGraph::with_task_impl::h4e09c0812e8abf24
  33:     0x7fd0193f2f38 - <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start::hf6ee6068f239879a
  34:     0x7fd01943cf15 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job::h4d71449d6af3571d
  35:     0x7fd01943358b - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with::hec8615cd2811433c
  36:     0x7fd0193d247d - rustc_codegen_ssa::base::codegen_crate::hf7f8c50778209cf8
  37:     0x7fd01934f3f0 - <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate::hcba196557f52fae6
  38:     0x7fd023437bd0 - rustc_driver::driver::phase_4_codegen::hade065a8cf6f26a2
  39:     0x7fd0234651d0 - rustc_driver::driver::compile_input::{{closure}}::hdd7466c093d6d3e7
  40:     0x7fd02346312c - <std::thread::local::LocalKey<T>>::with::he31a810ca003f552
  41:     0x7fd023403e0a - rustc::ty::context::TyCtxt::create_and_enter::h3a3af1489d7c446f
  42:     0x7fd02342d4b6 - rustc_driver::driver::compile_input::h20eaf82f3f6aeec8
  43:     0x7fd0233ad799 - rustc_driver::run_compiler_with_pool::hbe3be3b5f19e38c8
  44:     0x7fd0233b8af5 - <scoped_tls::ScopedKey<T>>::set::h4aeac58e4b7eb0a1
  45:     0x7fd0233ac60a - rustc_driver::run_compiler::hde99c109f350f677
  46:     0x7fd0233b8caa - <scoped_tls::ScopedKey<T>>::set::hf1be8bd8767bcc8f
  47:     0x7fd0233ea2a2 - syntax::with_globals::h2a92913243b46dbe
  48:     0x7fd0230bddc9 - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:92
  49:     0x7fd023494c40 - <F as alloc::boxed::FnBox<A>>::call_box::h4c895f5df8f64c8f
  50:     0x7fd0230bcbbd - std::sys::unix::thread::Thread::new::thread_start::h967e067038c0ee09
                               at /rustc/b92552d5578e4544006da0dd5e793a19c2149321/src/liballoc/boxed.rs:744
                               at src/libstd/sys_common/thread.rs:14
                               at src/libstd/sys/unix/thread.rs:81
  51:     0x7fd022fc03c2 - <unknown>
                               at /usr/src/debug/sys-libs/glibc-2.28-r4/glibc-2.28/nptl/pthread_create.c:486
  52:     0x7fd022ed42de - clone
                               at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  53:                0x0 - <unknown>
query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: aborting due to previous error


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: rustc 1.33.0-nightly (b92552d55 2019-01-06) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `spirit-reqwest`.

To learn more, run the command again with --verbose.

It runs fine with rustc 1.33.0-nightly (9eac38634 2018-12-31), but fails with:

$ rustc +nightly-2019-01-07 --version --verbose
rustc 1.33.0-nightly (b92552d55 2019-01-06)
binary: rustc
commit-hash: b92552d5578e4544006da0dd5e793a19c2149321
commit-date: 2019-01-06
host: x86_64-unknown-linux-gnu
release: 1.33.0-nightly
LLVM version: 8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions