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

Using a proc_macro crate with more than 9 macros causes an ICE #52370

Closed
Bobo1239 opened this issue Jul 14, 2018 · 8 comments
Closed

Using a proc_macro crate with more than 9 macros causes an ICE #52370

Bobo1239 opened this issue Jul 14, 2018 · 8 comments
Assignees
Labels
A-macros-1.2 Area: Declarative macros 1.2 C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Bobo1239
Copy link
Contributor

Bobo1239 commented Jul 14, 2018

Minimal repro: https://github.com/Bobo1239/proc_macro_limit
proc_macro_limit defines 10 macros. cargo test results in an ICE (the test just contains extern crate proc_macro_limit). The ICE doesn't occur when any macro is removed.

edit: The ICE only manifest when using the proc-macro crate via extern crate proc_macro_limit;. So in the repro crate cargo build succeeds but cargo test fails with the ICE.

rustc -Vv:

rustc 1.29.0-nightly (254f8796b 2018-07-13)
binary: rustc
commit-hash: 254f8796b729810846e2b97620032ecaf103db33
commit-date: 2018-07-13
host: x86_64-unknown-linux-gnu
release: 1.29.0-nightly
LLVM version: 7.0
Backtrace:
   Compiling proc_macro_limit v0.1.0 (file:///home/bobo1239/Development/Rust/proc_macro_limit)
thread 'main' panicked at 'index out of bounds: the len is 9 but the index is 9', /checkout/src/libcore/slice/mod.rs:2085:10
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:479
   6: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   7: rust_begin_unwind
             at libstd/panicking.rs:325
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   9: core::panicking::panic_bounds_check
             at libcore/panicking.rs:59
  10: rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore for rustc_metadata::cstore::CStore>::def_path_hash
  11: rustc::ich::impls_hir::<impl rustc_data_structures::stable_hasher::HashStable<rustc::ich::hcx::StableHashingContext<'a>> for rustc::hir::def::Def>::hash_stable
  12: <[T] as rustc_data_structures::stable_hasher::HashStable<CTX>>::hash_stable
  13: rustc::dep_graph::graph::DepGraph::with_task_impl
  14: rustc::ty::context::tls::with_related_context
  15: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  16: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query
  17: rustc::ty::query::plumbing::force_from_dep_node
  18: rustc::dep_graph::graph::DepGraph::try_mark_green
  19: rustc::dep_graph::graph::DepGraph::try_mark_green
  20: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_mark_green_and_read
  21: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  22: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::const_eval
  23: rustc_mir::monomorphize::collector::collect_const
  24: <rustc_mir::monomorphize::collector::MirNeighborCollector<'a, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_terminator_kind
  25: rustc_mir::monomorphize::collector::collect_items_rec
  26: rustc_mir::monomorphize::collector::collect_items_rec
  27: rustc_mir::monomorphize::collector::collect_items_rec
  28: rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}
  29: rustc::util::common::time
  30: rustc_mir::monomorphize::collector::collect_crate_mono_items
  31: rustc::util::common::time
  32: rustc_codegen_llvm::base::collect_and_partition_mono_items
  33: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::collect_and_partition_mono_items<'tcx>>::compute
  34: rustc::ty::context::tls::with_context
  35: rustc::dep_graph::graph::DepGraph::with_task_impl
  36: rustc::ty::context::tls::with_related_context
  37: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  38: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  39: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  40: rustc::util::common::time
  41: rustc_driver::driver::phase_4_codegen
  42: rustc_driver::driver::compile_input::{{closure}}
  43: rustc::ty::context::tls::enter_context
  44: <std::thread::local::LocalKey<T>>::with
  45: rustc::ty::context::TyCtxt::create_and_enter
  46: rustc_driver::driver::compile_input
  47: rustc_driver::run_compiler_with_pool
  48: <scoped_tls::ScopedKey<T>>::set
  49: <scoped_tls::ScopedKey<T>>::set
  50: syntax::with_globals
  51: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  52: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:106
  53: rustc_driver::run
  54: rustc_driver::main
  55: std::rt::lang_start::{{closure}}
  56: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  57: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:106
  58: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  59: main
  60: __libc_start_main
  61: <unknown>
query stack during panic:
thread 'main' panicked at 'did not find a cycle', librustc/ty/query/job.rs:143:9
stack backtrace:
   0:     0x7fa3739cf44e - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::hd6c46a9a697d3bb0
                               at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x7fa3739a6d36 - std::sys_common::backtrace::print::hb45c2623ee574a87
                               at libstd/sys_common/backtrace.rs:71
                               at libstd/sys_common/backtrace.rs:59
   2:     0x7fa3739d847d - std::panicking::default_hook::{{closure}}::h07311e63483c372f
                               at libstd/panicking.rs:211
   3:     0x7fa3739d81f0 - std::panicking::default_hook::h028233b8c65b3bae
                               at libstd/panicking.rs:227
   4:     0x7fa37006c395 - rustc::util::common::panic_hook::hf2c45cd370f93067
   5:     0x7fa3739d8b43 - std::panicking::rust_panic_with_hook::haf5fc7b5dee91fb6
                               at libstd/panicking.rs:479
   6:     0x7fa37011fea6 - std::panicking::begin_panic::h606fc830096e0274
   7:     0x7fa36fc9cbf4 - rustc::ty::query::job::QueryJob::await::h2c731c2b200f09f3
   8:     0x7fa36ff3b13c - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query::h994096203aa17417
   9:     0x7fa36fe62f99 - rustc::ty::item_path::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::push_item_path::hd5d47d3273a34d51
  10:     0x7fa370162966 - <M as rustc::ty::query::config::QueryDescription<'tcx>>::describe::hb34b18206d165ab4
  11:     0x7fa37007b8dd - rustc::ty::query::Query::describe::h684cc4d58a7dde9d
  12:     0x7fa36ffabfd0 - <std::thread::local::LocalKey<T>>::with::h5fe221a036b2135a
  13:     0x7fa36fe64ba8 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::report_cycle::h4b2f454b2cf99ce3
  14:     0x7fa36fe2c81b - rustc::ty::query::plumbing::force_from_dep_node::h28e6416d0df47b6e
  15:     0x7fa36fbb846a - rustc::dep_graph::graph::DepGraph::try_mark_green::h13af1dcc078314d1
  16:     0x7fa36fe64ce0 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_mark_green_and_read::h81ce4cf347e2d812
  17:     0x7fa36ff3b8a0 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query::h994096203aa17417
  18:     0x7fa36fe62f99 - rustc::ty::item_path::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::push_item_path::hd5d47d3273a34d51
  19:     0x7fa370162966 - <M as rustc::ty::query::config::QueryDescription<'tcx>>::describe::hb34b18206d165ab4
  20:     0x7fa37007b8dd - rustc::ty::query::Query::describe::h684cc4d58a7dde9d
  21:     0x7fa36fccc274 - rustc::ty::context::tls::with_context_opt::h9c2d29701f63e085
  22:     0x7fa37006c443 - rustc::util::common::panic_hook::hf2c45cd370f93067
  23:     0x7fa3739d8b43 - std::panicking::rust_panic_with_hook::haf5fc7b5dee91fb6
                               at libstd/panicking.rs:479
  24:     0x7fa3739d86e9 - std::panicking::continue_panic_fmt::hdf5f264b4817f85d
                               at libstd/panicking.rs:390
  25:     0x7fa3739d85e5 - rust_begin_unwind
                               at libstd/panicking.rs:325
  26:     0x7fa373a4c6cb - core::panicking::panic_fmt::hcb9f16862374cc9a
                               at libcore/panicking.rs:77
  27:     0x7fa373a4c67f - core::panicking::panic_bounds_check::hc0f17aee7023f9e2
                               at libcore/panicking.rs:59
  28:     0x7fa371c08a01 - rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore for rustc_metadata::cstore::CStore>::def_path_hash::h9b41eab2b2169335
  29:     0x7fa36fcb14e5 - rustc::ich::impls_hir::<impl rustc_data_structures::stable_hasher::HashStable<rustc::ich::hcx::StableHashingContext<'a>> for rustc::hir::def::Def>::hash_stable::he0bfa1c53c2fe221
  30:     0x7fa36fc6e4ec - <[T] as rustc_data_structures::stable_hasher::HashStable<CTX>>::hash_stable::h63da9e1588322d9f
  31:     0x7fa36fb8bf8c - rustc::dep_graph::graph::DepGraph::with_task_impl::hb9ad5208c75dec84
  32:     0x7fa36fd21351 - rustc::ty::context::tls::with_related_context::h236b2bed983f6e08
  33:     0x7fa36fe6c940 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job::h2df9519ccff79d05
  34:     0x7fa36fe9e56e - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query::h3cb896586aeb0a91
  35:     0x7fa36fe2c7b7 - rustc::ty::query::plumbing::force_from_dep_node::h28e6416d0df47b6e
  36:     0x7fa36fbb846a - rustc::dep_graph::graph::DepGraph::try_mark_green::h13af1dcc078314d1
  37:     0x7fa36fbb843a - rustc::dep_graph::graph::DepGraph::try_mark_green::h13af1dcc078314d1
  38:     0x7fa36fe64ce0 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_mark_green_and_read::h81ce4cf347e2d812
  39:     0x7fa36ff6d72b - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query::hcb7a12edbb0c1239
  40:     0x7fa36ffa765f - rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::const_eval::he0b0cb13a7d99531
  41:     0x7fa370ac3f75 - rustc_mir::monomorphize::collector::collect_const::hdf6223b66ab133ec
  42:     0x7fa370ac230e - <rustc_mir::monomorphize::collector::MirNeighborCollector<'a, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_terminator_kind::h2c72726e7afc51de
  43:     0x7fa370ac0ac1 - rustc_mir::monomorphize::collector::collect_items_rec::h0f4189260a5f2b34
  44:     0x7fa370ac10f9 - rustc_mir::monomorphize::collector::collect_items_rec::h0f4189260a5f2b34
  45:     0x7fa370ac10f9 - rustc_mir::monomorphize::collector::collect_items_rec::h0f4189260a5f2b34
  46:     0x7fa370d1e1b0 - rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}::hfe149b0b8cb481eb
  47:     0x7fa370cf68c4 - rustc::util::common::time::hf897241d402a4e9e
  48:     0x7fa370abece0 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h64944a52b0a9edc3
  49:     0x7fa3694f7276 - rustc::util::common::time::h0d7f9f0f8494d94e
  50:     0x7fa3695b0f94 - rustc_codegen_llvm::base::collect_and_partition_mono_items::h7a7c84af63c01538
  51:     0x7fa36fd86ae8 - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::collect_and_partition_mono_items<'tcx>>::compute::h4cdf9fe96888402e
  52:     0x7fa36fcff5e4 - rustc::ty::context::tls::with_context::hc07a3cde95f6473f
  53:     0x7fa36fb4f41e - rustc::dep_graph::graph::DepGraph::with_task_impl::h144e93e8e7db8c82
  54:     0x7fa36fd2c5db - rustc::ty::context::tls::with_related_context::h3c918fef702c76f1
  55:     0x7fa36fe7b377 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job::h9845e745f16d383c
  56:     0x7fa36ff46bd9 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query::ha0bb465fedd5ab61
  57:     0x7fa3695b9820 - <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate::h050f6f9fdd741ee2
  58:     0x7fa373d81131 - rustc::util::common::time::hf3bdbd3076e65138
  59:     0x7fa373d7527c - rustc_driver::driver::phase_4_codegen::h6d218d66ccc5b3b1
  60:     0x7fa373d31e38 - rustc_driver::driver::compile_input::{{closure}}::h3ae3822eda7126fa
  61:     0x7fa373d2d3c9 - rustc::ty::context::tls::enter_context::h172e3a71948cf3e8
  62:     0x7fa373db9b7a - <std::thread::local::LocalKey<T>>::with::hbc082df5ff4b92fe
  63:     0x7fa373e2bbbd - rustc::ty::context::TyCtxt::create_and_enter::h140543bc115628f6
  64:     0x7fa373d6ed7c - rustc_driver::driver::compile_input::h77799d53c7077f32
  65:     0x7fa373df92c0 - rustc_driver::run_compiler_with_pool::hf70f7dd371076d1f
  66:     0x7fa373d34e7c - <scoped_tls::ScopedKey<T>>::set::hea0904c0d7dcea9c
  67:     0x7fa373d34b71 - <scoped_tls::ScopedKey<T>>::set::h2f59f8491f17e599
  68:     0x7fa373d9020a - syntax::with_globals::hb4d6561660afb38b
  69:     0x7fa373d335f2 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h51855e0168324012
  70:     0x7fa3739e59b9 - __rust_maybe_catch_panic
                               at libpanic_unwind/lib.rs:106
  71:     0x7fa373df6754 - rustc_driver::run::hfad78015aa66f902
  72:     0x7fa373e05eea - rustc_driver::main::hc68ca44052c5c3d1
  73:     0x55f93f391b52 - std::rt::lang_start::{{closure}}::h169c2960103a293d
  74:     0x7fa3739d8582 - std::panicking::try::do_call::h4ae9a4c7ba6e1e81
                               at libstd/rt.rs:59
                               at libstd/panicking.rs:310
  75:     0x7fa3739e59b9 - __rust_maybe_catch_panic
                               at libpanic_unwind/lib.rs:106
  76:     0x7fa3739baca5 - std::rt::lang_start_internal::hea52cc5b4fec6cb8
                               at libstd/panicking.rs:289
                               at libstd/panic.rs:392
                               at libstd/rt.rs:58
  77:     0x55f93f391bb3 - main
  78:     0x7fa3735ae06a - __libc_start_main
  79:     0x55f93f391a38 - <unknown>
query stack during panic:
thread panicked while processing panic. aborting.
error: Could not compile `proc_macro_limit`.

To learn more, run the command again with --verbose.
@kennytm kennytm added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-macros-1.2 Area: Declarative macros 1.2 labels Jul 14, 2018
@Mark-Simulacrum Mark-Simulacrum added this to the Rust 2018 Preview 2 milestone Jul 17, 2018
@Mark-Simulacrum Mark-Simulacrum added the P-high High priority label Jul 17, 2018
@Mark-Simulacrum Mark-Simulacrum removed this from the Rust 2018 Preview 2 milestone Jul 17, 2018
@pnkfelix
Copy link
Member

assigning to self for further investigation.

@pnkfelix pnkfelix self-assigned this Jul 19, 2018
@pnkfelix
Copy link
Member

(note we may downgrade priority to something less drastic than P-high)

@Mark-Simulacrum Mark-Simulacrum added P-medium Medium priority and removed P-high High priority labels Jul 19, 2018
@oli-obk
Copy link
Contributor

oli-obk commented Jul 19, 2018

Can't reproduce on yesterday's master (but I also have incremental + debug asserts on)

➜  proc_macro_limit git:(master) RUST_BACKTRACE=1 cargo build
   Compiling proc_macro_limit v0.1.0 (file:///home/oliver/Projects/rust/proc_macro_limit)
warning: this feature has been stable since 1.29.0. Attribute no longer needed: proc_macro_limit                                                                
 --> src/lib.rs:1:12
  |
1 | #![feature(proc_macro)]
  |            ^^^^^^^^^^
  |
  = note: #[warn(stable_features)] on by default

    Finished dev [unoptimized + debuginfo] target(s) in 1.25s                                                                                                   
➜  proc_macro_limit git:(master) rustc --version
rustc 1.29.0-dev

@Bobo1239
Copy link
Contributor Author

@oli-obk My bad. Should have clarified that the ICE only occurs when actually using the proc-macro crate (extern crate proc_macro_limit;). So cargo build runs successfully but cargo test fails. I will update the initial post to include this detail.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 19, 2018

Ah indeed. Unfortunately I'm running into stack overflows now :/

   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
             at librustc/util/common.rs:54
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:479
   6: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   7: rust_begin_unwind
             at libstd/panicking.rs:325
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   9: core::panicking::panic_bounds_check
             at libcore/panicking.rs:59
  10: rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore for rustc_metadata::cstore::CStore>::def_path_hash
             at /home/oliver/Projects/rust/rust/src/libcore/slice/mod.rs:2085
             at /home/oliver/Projects/rust/rust/src/libcore/slice/mod.rs:1953
             at /home/oliver/Projects/rust/rust/src/liballoc/vec.rs:1714
             at /home/oliver/Projects/rust/rust/src/librustc/hir/map/definitions.rs:89
             at librustc_metadata/decoder.rs:1086
             at librustc_metadata/cstore_impl.rs:494
  11: rustc::ich::impls_hir::<impl rustc_data_structures::stable_hasher::HashStable<rustc::ich::hcx::StableHashingContext<'a>> for rustc::hir::def_id::DefId>::hash_stable
             at librustc/ich/hcx.rs:152
             at librustc/ich/impls_hir.rs:29
  12: <[T] as rustc_data_structures::stable_hasher::HashStable<CTX>>::hash_stable
             at librustc/macros.rs:86
             at librustc/macros.rs:103
             at /home/oliver/Projects/rust/rust/src/librustc_data_structures/stable_hasher.rs:287
  13: rustc::dep_graph::graph::DepGraph::with_task_impl
             at /home/oliver/Projects/rust/rust/src/librustc_data_structures/stable_hasher.rs:297
             at /home/oliver/Projects/rust/rust/src/librustc_data_structures/stable_hasher.rs:315
             at librustc/dep_graph/graph.rs:286
  14: rustc::dep_graph::graph::DepGraph::with_task
             at librustc/dep_graph/graph.rs:207
  15: rustc::ty::context::tls::set_tlv
             at librustc/ty/query/plumbing.rs:533
             at librustc/ty/query/plumbing.rs:203
             at librustc/ty/context.rs:1836
             at librustc/ty/context.rs:1775
  16: rustc::ty::context::tls::with_context_opt
             at librustc/ty/context.rs:1835
             at librustc/ty/query/plumbing.rs:202
             at librustc/ty/context.rs:1936
             at librustc/ty/context.rs:1920
             at librustc/ty/context.rs:1911
  17: rustc::ty::context::tls::with_related_context
             at librustc/ty/context.rs:1920
             at librustc/ty/context.rs:1931
  18: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
             at librustc/ty/query/plumbing.rs:192
  19: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at librustc/ty/query/plumbing.rs:526
  20: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
             at librustc/ty/query/plumbing.rs:412
             at librustc/ty/query/plumbing.rs:602
             at librustc/ty/query/plumbing.rs:613
  21: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::item_children
             at librustc/ty/query/plumbing.rs:830
  22: core::ops::function::FnOnce::call_once
             at librustc_metadata/cstore_impl.rs:402
             at /home/oliver/Projects/rust/rust/src/libcore/ops/function.rs:223
  23: rustc::ty::query::__query_compute::visible_parent_map
             at librustc/ty/query/plumbing.rs:783
             at librustc/ty/query/plumbing.rs:752
  24: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::visible_parent_map<'tcx>>::compute
             at librustc/ty/query/plumbing.rs:781
  25: rustc::ty::context::tls::with_context_opt
             at librustc/dep_graph/graph.rs:274
             at librustc/ty/context.rs:1836
             at librustc/ty/context.rs:1775
             at librustc/ty/context.rs:1835
             at librustc/dep_graph/graph.rs:273
             at librustc/ty/context.rs:1920
             at librustc/ty/context.rs:1911
  26: rustc::ty::context::tls::with_context
             at librustc/ty/context.rs:1920
  27: rustc::dep_graph::graph::DepGraph::with_task_impl
             at librustc/dep_graph/graph.rs:267
  28: rustc::dep_graph::graph::DepGraph::with_task
             at librustc/dep_graph/graph.rs:207
  29: rustc::ty::context::tls::set_tlv
             at librustc/ty/query/plumbing.rs:533
             at librustc/ty/query/plumbing.rs:203
             at librustc/ty/context.rs:1836
             at librustc/ty/context.rs:1775
  30: rustc::ty::context::tls::with_context_opt
             at librustc/ty/context.rs:1835
             at librustc/ty/query/plumbing.rs:202
             at librustc/ty/context.rs:1936
             at librustc/ty/context.rs:1920
             at librustc/ty/context.rs:1911
  31: rustc::ty::context::tls::with_related_context
             at librustc/ty/context.rs:1920
             at librustc/ty/context.rs:1931
  32: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
             at librustc/ty/query/plumbing.rs:192
  33: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at librustc/ty/query/plumbing.rs:526
  34: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
             at librustc/ty/query/plumbing.rs:412
             at librustc/ty/query/plumbing.rs:602
             at librustc/ty/query/plumbing.rs:613
  35: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::visible_parent_map
             at librustc/ty/query/plumbing.rs:830
  36: rustc::ty::item_path::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_push_visible_item_path
             at librustc/ty/item_path.rs:132
  37: rustc::ty::item_path::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::push_item_path
             at librustc/ty/item_path.rs:192
  38: rustc::ty::item_path::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::item_path_str
             at librustc/ty/item_path.rs:67
  39: rustc::ty::context::tls::with
             at librustc_mir/interpret/const_eval.rs:165
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1966
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1920
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1911
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1920
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1966
  40: rustc_mir::interpret::const_eval::eval_body_using_ecx
             at librustc_mir/interpret/const_eval.rs:165
  41: rustc_mir::interpret::const_eval::const_eval_provider
             at librustc_mir/interpret/const_eval.rs:131
             at librustc_mir/interpret/const_eval.rs:562
  42: rustc::ty::query::__query_compute::const_eval
             at librustc/ty/query/plumbing.rs:783
             at librustc/ty/query/plumbing.rs:752
  43: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::const_eval<'tcx>>::compute
             at librustc/ty/query/plumbing.rs:781
  44: rustc::ty::context::tls::with_context_opt
             at librustc/dep_graph/graph.rs:274
             at librustc/ty/context.rs:1836
             at librustc/ty/context.rs:1775
             at librustc/ty/context.rs:1835
             at librustc/dep_graph/graph.rs:273
             at librustc/ty/context.rs:1920
             at librustc/ty/context.rs:1911
  45: rustc::ty::context::tls::with_context
             at librustc/ty/context.rs:1920
  46: rustc::dep_graph::graph::DepGraph::with_task_impl
             at librustc/dep_graph/graph.rs:267
  47: rustc::dep_graph::graph::DepGraph::with_task
             at librustc/dep_graph/graph.rs:207
  48: rustc::ty::context::tls::set_tlv
             at librustc/ty/query/plumbing.rs:533
             at librustc/ty/query/plumbing.rs:203
             at librustc/ty/context.rs:1836
             at librustc/ty/context.rs:1775
  49: rustc::ty::context::tls::with_context_opt
             at librustc/ty/context.rs:1835
             at librustc/ty/query/plumbing.rs:202
             at librustc/ty/context.rs:1936
             at librustc/ty/context.rs:1920
             at librustc/ty/context.rs:1911
  50: rustc::ty::context::tls::with_related_context
             at librustc/ty/context.rs:1920
             at librustc/ty/context.rs:1931
  51: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
             at librustc/ty/query/plumbing.rs:192
  52: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at librustc/ty/query/plumbing.rs:526
  53: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
             at librustc/ty/query/plumbing.rs:412
             at librustc/ty/query/plumbing.rs:602
             at librustc/ty/query/plumbing.rs:613
  54: rustc::ty::query::TyCtxtAt::const_eval
             at librustc/ty/query/plumbing.rs:837
  55: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::const_eval
             at librustc/ty/query/plumbing.rs:830
  56: rustc_mir::monomorphize::collector::collect_const
             at librustc_mir/monomorphize/collector.rs:1261
  57: <rustc_mir::monomorphize::collector::MirNeighborCollector<'a, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_const
             at librustc_mir/monomorphize/collector.rs:607
  58: rustc::mir::visit::Visitor::super_terminator_kind
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:759
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:197
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:751
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:191
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:628
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:144
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:472
  59: <rustc_mir::monomorphize::collector::MirNeighborCollector<'a, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_terminator_kind
             at librustc_mir/monomorphize/collector.rs:653
  60: rustc::mir::visit::Visitor::super_mir
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:418
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:119
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:326
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:92
             at /home/oliver/Projects/rust/rust/src/librustc/mir/visit.rs:289
  61: rustc_mir::monomorphize::collector::collect_items_rec
             at librustc_mir/monomorphize/collector.rs:1198
             at librustc_mir/monomorphize/collector.rs:412
  62: rustc_mir::monomorphize::collector::collect_items_rec
             at librustc_mir/monomorphize/collector.rs:425
  63: rustc_mir::monomorphize::collector::collect_items_rec
             at librustc_mir/monomorphize/collector.rs:425
  64: rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}
             at librustc_mir/monomorphize/collector.rs:318
             at /home/oliver/Projects/rust/rust/src/libcore/iter/iterator.rs:551
             at /home/oliver/Projects/rust/rust/src/libcore/iter/iterator.rs:1632
             at /home/oliver/Projects/rust/rust/src/libcore/iter/iterator.rs:1520
             at /home/oliver/Projects/rust/rust/src/libcore/iter/iterator.rs:1632
             at /home/oliver/Projects/rust/rust/src/libcore/iter/iterator.rs:551
             at librustc_mir/monomorphize/collector.rs:316
  65: rustc::util::common::time_ext
             at /home/oliver/Projects/rust/rust/src/librustc/util/common.rs:166
  66: rustc::util::common::time
             at /home/oliver/Projects/rust/rust/src/librustc/util/common.rs:160
  67: rustc_mir::monomorphize::collector::collect_crate_mono_items
             at librustc_mir/monomorphize/collector.rs:315
  68: rustc::util::common::time_ext
             at librustc_codegen_llvm/base.rs:1000
             at /home/oliver/Projects/rust/rust/src/librustc/util/common.rs:166
  69: rustc::util::common::time
             at /home/oliver/Projects/rust/rust/src/librustc/util/common.rs:160
  70: rustc_codegen_llvm::base::collect_and_partition_mono_items
             at librustc_codegen_llvm/base.rs:999
  71: rustc::ty::query::__query_compute::collect_and_partition_mono_items
             at librustc/ty/query/plumbing.rs:783
             at librustc/ty/query/plumbing.rs:752
  72: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::collect_and_partition_mono_items<'tcx>>::compute
             at librustc/ty/query/plumbing.rs:781
  73: rustc::ty::context::tls::with_context_opt
             at librustc/dep_graph/graph.rs:274
             at librustc/ty/context.rs:1836
             at librustc/ty/context.rs:1775
             at librustc/ty/context.rs:1835
             at librustc/dep_graph/graph.rs:273
             at librustc/ty/context.rs:1920
             at librustc/ty/context.rs:1911
  74: rustc::ty::context::tls::with_context
             at librustc/ty/context.rs:1920
  75: rustc::dep_graph::graph::DepGraph::with_task_impl
             at librustc/dep_graph/graph.rs:267
  76: rustc::dep_graph::graph::DepGraph::with_eval_always_task
             at librustc/dep_graph/graph.rs:391
  77: rustc::ty::context::tls::set_tlv
             at librustc/ty/query/plumbing.rs:528
             at librustc/ty/query/plumbing.rs:203
             at librustc/ty/context.rs:1836
             at librustc/ty/context.rs:1775
  78: rustc::ty::context::tls::with_context_opt
             at librustc/ty/context.rs:1835
             at librustc/ty/query/plumbing.rs:202
             at librustc/ty/context.rs:1936
             at librustc/ty/context.rs:1920
             at librustc/ty/context.rs:1911
  79: rustc::ty::context::tls::with_related_context
             at librustc/ty/context.rs:1920
             at librustc/ty/context.rs:1931
  80: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
             at librustc/ty/query/plumbing.rs:192
  81: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at librustc/ty/query/plumbing.rs:526
  82: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
             at librustc/ty/query/plumbing.rs:412
             at librustc/ty/query/plumbing.rs:602
             at librustc/ty/query/plumbing.rs:613
  83: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::collect_and_partition_mono_items
             at librustc/ty/query/plumbing.rs:830
  84: rustc_codegen_llvm::base::codegen_crate
             at librustc_codegen_llvm/base.rs:789
  85: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
             at librustc_codegen_llvm/lib.rs:204
  86: rustc::util::common::time_ext
             at librustc_driver/driver.rs:1335
             at /home/oliver/Projects/rust/rust/src/librustc/util/common.rs:166
  87: rustc::util::common::time
             at /home/oliver/Projects/rust/rust/src/librustc/util/common.rs:160
  88: rustc_driver::driver::phase_4_codegen
             at librustc_driver/driver.rs:1335
  89: rustc_driver::driver::compile_input::{{closure}}
             at librustc_driver/driver.rs:325
  90: rustc::ty::context::tls::set_tlv
             at librustc_driver/driver.rs:1319
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1868
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1836
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1775
  91: rustc::ty::context::tls::enter_context
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1835
  92: <std::thread::local::LocalKey<T>>::try_with
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1867
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1825
             at /home/oliver/Projects/rust/rust/src/libstd/thread/local.rs:294
  93: <std::thread::local::LocalKey<T>>::try_with
             at /home/oliver/Projects/rust/rust/src/libstd/thread/local.rs:248
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1817
             at /home/oliver/Projects/rust/rust/src/libstd/thread/local.rs:294
  94: <std::thread::local::LocalKey<T>>::with
             at /home/oliver/Projects/rust/rust/src/libstd/thread/local.rs:248
  95: rustc::ty::context::tls::enter_global
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1809
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1847
  96: rustc::ty::context::TyCtxt::create_and_enter
             at /home/oliver/Projects/rust/rust/src/librustc/ty/context.rs:1186
  97: rustc_driver::driver::phase_3_run_analysis_passes
             at librustc_driver/driver.rs:1227
  98: rustc_driver::driver::compile_input
             at librustc_driver/driver.rs:284
  99: rustc_driver::run_compiler_with_pool
             at librustc_driver/lib.rs:553
query stack during panic:

thread 'main' has overflowed its stack
fatal runtime error: stack overflow

@oli-obk
Copy link
Contributor

oli-obk commented Jul 19, 2018

But the stacktrace is still helpful:

let ret = self.def_path_hashes[index.address_space().index()]

@arielb1
Copy link
Contributor

arielb1 commented Sep 15, 2018

Isn't this a duplicate of #49482 (and therefore, fixed on nightly)?

@Bobo1239
Copy link
Contributor Author

@arielb1 Yup, it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros-1.2 Area: Declarative macros 1.2 C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority 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

6 participants