Skip to content

ICE with recursion_limit = 0 #76424

Closed
@RaphiJS6-13

Description

@RaphiJS6-13

I was playing around with #![recursion_limit] again, and then this happened:

thread 'rustc' panicked at 'failed to push initial stack frame: InterpErrorInfo { kind: reached the configured maximum number of stack frames, backtrace: None }', src/librustc_mir/transform/const_prop.rs:365:10

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: rustc 1.46.0 (04488afe3 2020-08-24) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [optimized_mir] optimizing MIR for `main`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack

Code

#![recursion_limit = "0"]

fn main() { }

Stack trace

stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.tiyicn.workers.dev-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.tiyicn.workers.dev-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1076
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:217
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:530
  12: rust_begin_unwind
             at src/libstd/panicking.rs:437
  13: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  14: core::option::expect_none_failed
             at src/libcore/option.rs:1269
  15: <rustc_mir::transform::const_prop::ConstProp as rustc_mir::transform::MirPass>::run_pass
  16: rustc_mir::transform::run_passes
  17: rustc_mir::transform::run_optimization_passes
  18: rustc_mir::transform::optimized_mir
  19: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::optimized_mir>::compute
  20: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  21: rustc_data_structures::stack::ensure_sufficient_stack
  22: rustc_query_system::query::plumbing::get_query_impl
  23: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::instance_mir
  24: rustc_mir::monomorphize::collector::collect_neighbours
  25: rustc_mir::monomorphize::collector::collect_items_rec
  26: rustc_mir::monomorphize::collector::collect_crate_mono_items
  27: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  28: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::collect_and_partition_mono_items>::compute
  29: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  30: rustc_query_system::query::plumbing::get_query_impl
  31: rustc_codegen_ssa::base::codegen_crate
  32: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  33: rustc_session::utils::<impl rustc_session::session::Session>::time
  34: rustc_interface::passes::start_codegen
  35: rustc_middle::ty::context::tls::enter_global
  36: rustc_interface::queries::Queries::ongoing_codegen
  37: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  38: rustc_span::with_source_map
  39: rustc_interface::interface::create_compiler_and_run
  40: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Activity

added
C-bugCategory: This is a bug.
I-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.
on Sep 7, 2020
changed the title [-]error: internal compiler error: unexpected panic[/-] [+]ICE with recursion_limit = 0[/+] on Sep 7, 2020
added
I-prioritizeIssue: Indicates that prioritization has been requested for this issue.
on Sep 7, 2020
spastorino

spastorino commented on Sep 9, 2020

@spastorino
Member

Assigning P-low as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

added
P-lowLow priority
and removed
I-prioritizeIssue: Indicates that prioritization has been requested for this issue.
on Sep 9, 2020
fanninpm

fanninpm commented on Sep 22, 2020

@fanninpm

Playground link, for reference.

I can't get it to ICE with rustc 1.48.0-nightly (fb1dc34a8 2020-09-21) (on both Mac and the playground).

RaphiJS6-13

RaphiJS6-13 commented on Sep 23, 2020

@RaphiJS6-13
Author

Playground link, for reference.

I can't get it to ICE with rustc 1.48.0-nightly (fb1dc34a8 2020-09-21) (on both Mac and the playground).

Yeah, the rustc 1.48.0-nightly compiler throws the weird error message that I described in #75602, namely

error[E0275]: overflow evaluating the requirement `&Self: DispatchFromDyn<&RustaceansAreAwesome>`
  |
  = help: consider adding a `#![recursion_limit="0"]` attribute to your crate (`playground`)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0275`.
error: could not compile `playground`

To learn more, run the command again with --verbose.
added 2 commits that reference this issue on Sep 28, 2021

Rollup merge of rust-lang#89232 - rossmacarthur:fix-76424, r=wesleywiser

bc1dc08

Rollup merge of rust-lang#89232 - rossmacarthur:fix-76424, r=wesleywiser

d21761a
added a commit that references this issue on Sep 30, 2021

Rollup merge of rust-lang#89232 - rossmacarthur:fix-76424, r=wesleywiser

8087147

2 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-lowLow priorityT-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

      Participants

      @spastorino@jonas-schievink@rossmacarthur@fanninpm@RaphiJS6-13

      Issue actions

        ICE with recursion_limit = 0 · Issue #76424 · rust-lang/rust