Skip to content

ICE: "no errors encountered even though delay_span_bug issued" on tantivy v0.21 in release mode #116333

Closed

Description

@aumetra

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>

Activity

  1. 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 Oct 2, 2023
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 2, 2023
  3. 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[/+] on Oct 2, 2023
  4. kadiwa4 commented on Oct 2, 2023

    @kadiwa4
    Contributor

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

  5. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 2, 2023
  6. lqd commented on Oct 2, 2023

    @lqd
    Member

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

  7. apiraino commented on Oct 2, 2023

    @apiraino
    Contributor

    WG-prioritization assigning priority (Zulip discussion).

    @rustbot label -I-prioritize +P-high

  8. added
    P-highHigh priority
    and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 2, 2023
  9. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 2, 2023
  10. Luk-ESC commented on Oct 3, 2023

    @Luk-ESC
    Contributor

    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();
        })
    }
  11. added 2 commits that reference this issue on Oct 5, 2023
  12. added a commit that references this issue on Oct 5, 2023
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-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions