Skip to content

error: internal compiler error: encountered incremental compilation error with evaluate_obligation(812e3469791bc6d0-c54d52cd7fb29272) #140833

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

Open
dpc opened this issue May 9, 2025 · 4 comments
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@dpc
Copy link
Contributor

dpc commented May 9, 2025

Code

Unfortunately I can't minimize, but the handle_forwarded_room_key_event is here:

https://github.com/fedibtc/matrix-rust-sdk/blob/e4f25f17bda96bf9f4b7b308dc3f903d7e4d8db5/crates/matrix-sdk-ui/src/timeline/to_device.rs#L40

and that's exactly the commit we pin our dependency to ATM.

Meta

rustc --version --verbose:

> rustc --version --verbose
rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: x86_64-unknown-linux-gnu
release: 1.86.0
LLVM version: 19.1.7

Error output


error: internal compiler error: encountered incremental compilation error with evaluate_obligation(812e3469791bc6d0-c54d52cd7fb29272)
  |
  = help: This is a known issue with the compiler. Run `cargo clean -p fediffi` or `cargo clean` to allow your project to compile
  = note: Please follow the instructions below to create a bug report with the provided information
  = note: See <https://github.com/rust-lang/rust/issues/84970> for more information


thread 'rustc' panicked at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/compiler/rustc_query_system/src/query/plumbing.rs:731:9:
Found unstable fingerprints for evaluate_obligation(812e3469791bc6d0-c54d52cd7fb29272): Err(Canonical)
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_query_system::query::plumbing::incremental_verify_ich_failed::<rustc_middle::ty::context::TyCtxt>
   3: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_type_ir::canonical::CanonicalQueryInput<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::predicate::Predicate>>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
   4: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
   5: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
   6: rustc_traits::normalize_projection_ty::normalize_canonicalized_projection_ty
      [... omitted 2 frames ...]
   7: <rustc_trait_selection::traits::query::normalize::QueryNormalizer as rustc_type_ir::fold::FallibleTypeFolder<rustc_middle::ty::context::TyCtxt>>::try_fold_ty
   8: <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_trait_selection::traits::query::normalize::QueryNormalizer>
   9: <rustc_middle::ty::Ty as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::try_super_fold_with::<rustc_trait_selection::traits::query::normalize::QueryNormalizer>
  10: <rustc_trait_selection::traits::query::normalize::QueryNormalizer as rustc_type_ir::fold::FallibleTypeFolder<rustc_middle::ty::context::TyCtxt>>::try_fold_ty
  11: <rustc_traits::normalize_erasing_regions::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::PseudoCanonicalInput<rustc_middle::ty::generic_args::GenericArg>)>>::call_once
      [... omitted 2 frames ...]
  12: <rustc_middle::ty::normalize_erasing_regions::TryNormalizeAfterErasingRegionsFolder as rustc_type_ir::fold::FallibleTypeFolder<rustc_middle::ty::context::TyCtxt>>::try_fold_ty
  13: rustc_ty_utils::layout::layout_of
      [... omitted 2 frames ...]
  14: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::PseudoCanonicalInput<rustc_middle::ty::Ty>, rustc_middle::query::erase::Erased<[u8; 16]>>>
  15: <rustc_middle::ty::layout::LayoutCx as rustc_middle::ty::layout::LayoutOf>::spanned_layout_of
  16: <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::chain::Chain<core::iter::adapters::chain::Chain<core::iter::adapters::map::Map<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::Ty>>, rustc_ty_utils::layout::coroutine_layout::{closure#2}>, core::iter::sources::once::Once<core::result::Result<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, &rustc_middle::ty::layout::LayoutError>>>, core::iter::adapters::map::Map<rustc_index::bit_set::BitIter<rustc_middle::mir::query::CoroutineSavedLocal>, rustc_ty_utils::layout::coroutine_layout::{closure#1}>>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::next
  17: rustc_ty_utils::layout::coroutine_layout
  18: rustc_ty_utils::layout::layout_of_uncached
  19: rustc_ty_utils::layout::layout_of
      [... omitted 2 frames ...]
  20: <rustc_middle::ty::Ty as rustc_abi::layout::ty::TyAbiInterface<rustc_middle::ty::layout::LayoutCx>>::ty_and_layout_pointee_info_at
  21: <core::iter::adapters::enumerate::Enumerate<_> as core::iter::traits::iterator::Iterator>::try_fold::enumerate::<rustc_middle::ty::Ty, (), core::ops::control_flow::ControlFlow<core::ops::control_flow::ControlFlow<rustc_target::callconv::ArgAbi<rustc_middle::ty::Ty>>>, core::iter::adapters::map::map_try_fold<(usize, rustc_middle::ty::Ty), core::result::Result<rustc_target::callconv::ArgAbi<rustc_middle::ty::Ty>, &rustc_middle::ty::layout::FnAbiError>, (), core::ops::control_flow::ControlFlow<core::ops::control_flow::ControlFlow<rustc_target::callconv::ArgAbi<rustc_middle::ty::Ty>>>, rustc_ty_utils::abi::fn_abi_new_uncached::{closure#3}, <core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::iter::adapters::chain::Chain<core::iter::adapters::chain::Chain<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::Ty>>, core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::Ty>>>, core::option::IntoIter<rustc_middle::ty::Ty>>>, rustc_ty_utils::abi::fn_abi_new_uncached::{closure#3}>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::FnAbiError>> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call<rustc_target::callconv::ArgAbi<rustc_middle::ty::Ty>, core::ops::control_flow::ControlFlow<rustc_target::callconv::ArgAbi<rustc_middle::ty::Ty>>, core::ops::control_flow::ControlFlow<rustc_target::callconv::ArgAbi<rustc_middle::ty::Ty>>::Break>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_target::callconv::ArgAbi<rustc_middle::ty::Ty>>>::{closure#0}>::{closure#0}>::{closure#0}
  22: rustc_ty_utils::abi::fn_abi_new_uncached
  23: rustc_ty_utils::abi::fn_abi_of_instance
      [... omitted 2 frames ...]
  24: <rustc_codegen_llvm::context::CodegenCx as rustc_codegen_ssa::traits::declare::PreDefineCodegenMethods>::predefine_fn
  25: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
  26: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  27: rustc_codegen_ssa::base::codegen_crate::<rustc_codegen_llvm::LlvmCodegenBackend>
  28: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  29: <rustc_interface::queries::Linker>::codegen_and_build_linker
  30: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  31: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.86.0 (05f9846f8 2025-03-31) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=line-tables-only -C linker=/nix/store/ypw2dq2l53mkzhay34j3rpg67lyfh191-clang-wrapper-18.1.8/bin/clang -C incremental=[REDACTED] -C link-arg=-fuse-ld=mold -C link-arg=-Wl,--compress-debug-sections=zlib -C symbol-mangling-version=v0

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `{closure@matrix_sdk_ui::timeline::to_device::handle_forwarded_room_key_event::{closure#0}}: matrix_sdk_common::SendOutsideWasm`
#1 [normalize_canonicalized_projection_ty] normalizing `<{closure@matrix_sdk_ui::timeline::to_device::handle_forwarded_room_key_event::{closure#0}} as matrix_sdk::event_handler::EventHandler<ruma_events::kinds::ToDeviceEvent<ruma_events::forwarded_room_key::ToDeviceForwardedRoomKeyEventContent>, (matrix_sdk::client::Client,)>>::Future`
#2 [try_normalize_generic_arg_after_erasing_regions] normalizing `core::mem::maybe_uninit::MaybeUninit<<{closure@matrix_sdk_ui::timeline::to_device::handle_forwarded_room_key_event::{closure#0}} as matrix_sdk::event_handler::EventHandler<ruma_events::kinds::ToDeviceEvent<ruma_events::forwarded_room_key::ToDeviceForwardedRoomKeyEventContent>, (matrix_sdk::client::Client,)>>::Future>`
#3 [layout_of] computing layout of `core::mem::maybe_uninit::MaybeUninit<<{closure@matrix_sdk_ui::timeline::to_device::handle_forwarded_room_key_event::{closure#0}} as matrix_sdk::event_handler::EventHandler<ruma_events::kinds::ToDeviceEvent<ruma_events::forwarded_room_key::ToDeviceForwardedRoomKeyEventContent>, (matrix_sdk::client::Client,)>>::Future>`
#4 [layout_of] computing layout of `{async block@matrix_sdk::event_handler::<impl matrix_sdk::client::Client>::add_event_handler_impl<ruma_events::kinds::ToDeviceEvent<ruma_events::forwarded_room_key::ToDeviceForwardedRoomKeyEventContent>, (matrix_sdk::client::Client,), {closure@matrix_sdk_ui::timeline::to_device::handle_forwarded_room_key_event::{closure#0}}>::{closure#0}::{closure#1}}`
#5 [fn_abi_of_instance] computing call ABI of `core::ptr::drop_in_place::<{async block@matrix_sdk::event_handler::<impl matrix_sdk::client::Client>::add_event_handler_impl<ruma_events::kinds::ToDeviceEvent<ruma_events::forwarded_room_key::ToDeviceForwardedRoomKeyEventContent>, (matrix_sdk::client::Client,), {closure@matrix_sdk_ui::timeline::to_device::handle_forwarded_room_key_event::{closure#0}}>::{closure#0}::{closure#1}}> - shim(Some({async block@matrix_sdk::event_handler::<impl matrix_sdk::client::Client>::add_event_handler_impl<ruma_events::kinds::ToDeviceEvent<ruma_events::forwarded_room_key::ToDeviceForwardedRoomKeyEventContent>, (matrix_sdk::client::Client,), {closure@matrix_sdk_ui::timeline::to_device::handle_forwarded_room_key_event::{closure#0}}>::{closure#0}::{closure#1}}))`
end of query stack
Backtrace

<backtrace>

@dpc dpc 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. labels May 9, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 9, 2025
@moxian
Copy link
Contributor

moxian commented May 9, 2025

@dpc this sort of error is triggered by compiling the code once, then making specific changes (potentially producing invalid code) and recompiling it again. Minimization is often of secondary concern here, because the mere reproduction is challenging.

Do you happen to have a (potentially huge and unpretty and far from minimal) reproduction you can trigger reliably? There are folks happy and eager to minimize repro cases, if there is a working repro case in the first place.

@rustbot label: +A-incr-comp

@rustbot rustbot added the A-incr-comp Area: Incremental compilation label May 9, 2025
@dpc
Copy link
Contributor Author

dpc commented May 9, 2025

@moxian

AFAICT I can make any change, and it repros 100% of the time.

I do:

cargo build --all-targets # build from repo from a clean state
hx bridge/fedi-ffi/src/rpc.rs # any change like adding a lone `dbg!();`
cargo build --all-targets

and the second run triggers the error 100% of the time. It happens both on Linux and MacOS.

Writing down the git commit: ad0defe0 just for my reference.

Our repo uses a Nix dev shell, so everything is very reproducible (but requires Nix installed). Our app is near-open-source, but we release is publicly only periodically. I could probably get an ack from my bosses and share privately the whole source tree if it's valuable for anyone.

@moxian
Copy link
Contributor

moxian commented May 9, 2025

ahhh... Looking closer, it seems that this specific one has been investigated and reproduced at least twice already (#129612, #132884), so another instance is probably not quite as valuable as I initially thought. So probably no need to share it just yet (unless someone wants to actively work on this, I guess?).

Having git commit on hand in case we do happen to need it some time in the future is very nice though, thank you!

@dpc
Copy link
Contributor Author

dpc commented May 9, 2025

OK. Anyone working on it - feel free to @ me and I'm always happy to try out nightly Rust versions, weird flags, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. 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

3 participants