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: "no errors encountered even though delay_span_bug issued" on tantivy v0.21 in release mode #116333

Closed
aumetra opened this issue Oct 2, 2023 · 4 comments · Fixed by #116415
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@aumetra
Copy link

aumetra commented Oct 2, 2023

Code

The issue occurred when compiling tantivy in release mode.
I'm not sure how the create a good min repr for such a rather complex codebase, but the same error occurs when compiling one of their basic examples in release mode.

https://github.com/quickwit-oss/tantivy/blob/0.21/examples/basic_search.rs

Meta

rustc --version --verbose:

rustc 1.75.0-nightly (e0d7ed1f4 2023-10-01)
binary: rustc
commit-hash: e0d7ed1f453fb54578cc96dfea859b0e7be15016
commit-date: 2023-10-01
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.2

Error output

error: internal compiler error: broken MIR in Item(DefId(0:7908 ~ tantivy[f4b1]::store::reader::{impl#3}::iter_raw::{closure#2})) (after phase change to runtime-optimized) at bb2[6]:
                                Alias(Opaque, AliasTy { args: [ReErased], def_id: DefId(0:18076 ~ tantivy[f4b1]::store::reader::{impl#3}::block_checkpoints::{opaque#0}) }) does not have fields
  --> /home/aumetra/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/flatten.rs:52:9
   |
52 |         self.inner.next()
   |         ^^^^^^^^^^
   |

rustc ICE output

Backtrace

delayed span bug: broken MIR in Item(DefId(0:7908 ~ tantivy[f4b1]::store::reader::{impl#3}::iter_raw::{closure#2})) (after phase change to runtime-optimized) at bb2[6]:
Alias(Opaque, AliasTy { args: [ReErased], def_id: DefId(0:18076 ~ tantivy[f4b1]::store::reader::{impl#3}::block_checkpoints::{opaque#0}) }) does not have fields
   0: <rustc_errors::HandlerInner>::emit_diagnostic
   1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
   2: <rustc_const_eval::transform::validate::CfgChecker>::fail::<alloc::string::String>
   3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
   4: rustc_mir_transform::pass_manager::run_passes_inner
   5: rustc_mir_transform::optimized_mir
   6: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
   7: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
   8: rustc_query_impl::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
   9: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>>
  10: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
  11: rustc_metadata::rmeta::encoder::encode_metadata
  12: rustc_metadata::fs::encode_and_write_metadata
  13: rustc_interface::passes::start_codegen
  14: <rustc_interface::queries::Queries>::ongoing_codegen
  15: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  16: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/e0d7ed1f453fb54578cc96dfea859b0e7be15016/library/alloc/src/boxed.rs:2007:9
  18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/e0d7ed1f453fb54578cc96dfea859b0e7be15016/library/alloc/src/boxed.rs:2007:9
  19: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/e0d7ed1f453fb54578cc96dfea859b0e7be15016/library/std/src/sys/unix/thread.rs:108:17
  20: <unknown>
  21: <unknown>

@aumetra aumetra 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 Oct 2, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 2, 2023
@aumetra aumetra changed the title ICE: no errors encountered even though delay_span_bug issued on tantivy v0.21 in release mode ICE: "no errors encountered even though delay_span_bug issued" on tantivy v0.21 in release mode Oct 2, 2023
@kadiwa4
Copy link
Contributor

kadiwa4 commented Oct 2, 2023

Regressed from nightly 2023-09-29 (7b4d9e1) to 2023-09-30 (8ce4540).
@rustbot label: regression-from-stable-to-nightly

@rustbot rustbot added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Oct 2, 2023
@lqd
Copy link
Member

lqd commented Oct 2, 2023

This has a similar flavor to #116265, opaque alias, reproduces with c545019 but not its parent a66e334 cc @oli-obk .

@apiraino
Copy link
Contributor

apiraino commented Oct 2, 2023

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-high

@rustbot rustbot added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Oct 2, 2023
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 2, 2023
@Luk-ESC
Copy link
Contributor

Luk-ESC commented Oct 3, 2023

Minimized to:

fn checkpoints() -> impl Iterator {
    Some(()).iter().flat_map(|_| std::iter::once(()))
}

fn block_checkpoints() -> impl Iterator {
    checkpoints()
}

fn iter_raw() -> impl Iterator {
    let mut iter = block_checkpoints();

    (0..9).map(move |_| {
        iter.next();
    })
}

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 5, 2023
Move subtyper below reveal_all and change reveal_all

In previous attempt rust-lang#116378 we tried to handle `Opaque` in few different places, but this isn't necessary, after moving subtyper below reveal_all and calling `super_place` on reveal_all, issues cease to exist.

r? `@oli-obk`

Fixes rust-lang#116332
Fixes rust-lang#116265
Fixes rust-lang#116383
Fixes rust-lang#116333
@bors bors closed this as completed in 08cc742 Oct 5, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 5, 2023
Rollup merge of rust-lang#116415 - ouz-a:move_subtyper, r=oli-obk

Move subtyper below reveal_all and change reveal_all

In previous attempt rust-lang#116378 we tried to handle `Opaque` in few different places, but this isn't necessary, after moving subtyper below reveal_all and calling `super_place` on reveal_all, issues cease to exist.

r? ``@oli-obk``

Fixes rust-lang#116332
Fixes rust-lang#116265
Fixes rust-lang#116383
Fixes rust-lang#116333
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-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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.

7 participants