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

ICE with recursion_limit = 0 #76424

Closed
RaphiJS6-13 opened this issue Sep 7, 2020 · 4 comments · Fixed by #89232
Closed

ICE with recursion_limit = 0 #76424

RaphiJS6-13 opened this issue Sep 7, 2020 · 4 comments · Fixed by #89232
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@RaphiJS6-13
Copy link

RaphiJS6-13 commented Sep 7, 2020

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.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-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.
@RaphiJS6-13 RaphiJS6-13 added C-bug Category: This is a bug. 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. labels Sep 7, 2020
@jyn514 jyn514 changed the title error: internal compiler error: unexpected panic ICE with recursion_limit = 0 Sep 7, 2020
@jonas-schievink jonas-schievink added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Sep 7, 2020
@spastorino
Copy link
Member

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

@spastorino spastorino added P-low Low priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 9, 2020
@fanninpm
Copy link

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
Copy link
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.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Sep 28, 2021
Improve help for recursion limit errors

- Tweak help message and suggested limit (handle `0` case).
- Add test for rust-lang#75602 (it was already fixed, maybe can be resolved too).

Fixes rust-lang#76424
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Sep 29, 2021
Improve help for recursion limit errors

- Tweak help message and suggested limit (handle `0` case).
- Add test for rust-lang#75602 (it was already fixed, maybe can be resolved too).

Fixes rust-lang#76424
@bors bors closed this as completed in 8087147 Sep 30, 2021
@rossmacarthur
Copy link
Contributor

Weird message is tracked in #75602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants