Skip to content

called Result::unwrap() on an Err value: NormalizationFailure #116686

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

Closed
sleshep opened this issue Oct 13, 2023 · 2 comments
Closed

called Result::unwrap() on an Err value: NormalizationFailure #116686

sleshep opened this issue Oct 13, 2023 · 2 comments
Labels
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.

Comments

@sleshep
Copy link

sleshep commented Oct 13, 2023

Code

when cargo build this repo:
memflow

Meta

rustc --version --verbose:

rustc 1.73.0 (cc66ad468 2023-10-03)
binary: rustc
commit-hash: cc66ad468955717ab92600c770da8c1601a4ff33
commit-date: 2023-10-03
host: x86_64-unknown-linux-gnu
release: 1.73.0
LLVM version: 17.0.2

Error output

cargo build              
warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
   Compiling memflow v0.2.0-beta10
thread 'rustc' panicked at compiler/rustc_lint/src/types.rs:920:82:
called `Result::unwrap()` on an `Err` value: NormalizationFailure(std::option::Option<&<T as plugins::Loadable>::ArgsType>, Type(std::option::Option<&<T as plugins::Loadable>::ArgsType>))
stack backtrace:
   0:     0x7f89138c349c - std::backtrace_rs::backtrace::libunwind::trace::he43a6a3949163f8c
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f89138c349c - std::backtrace_rs::backtrace::trace_unsynchronized::h50db52ca99f692e7
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f89138c349c - std::sys_common::backtrace::_print_fmt::hd37d595f2ceb2d3c
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f89138c349c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h678bbcf9da6d7d75
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f89139293fc - core::fmt::rt::Argument::fmt::h3a159adc080a6fc9
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/fmt/rt.rs:138:9
   5:     0x7f89139293fc - core::fmt::write::hb8eaf5a8e45a738e
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f89138b612e - std::io::Write::write_fmt::h9663fe36b2ee08f9
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/io/mod.rs:1714:15
   7:     0x7f89138c3284 - std::sys_common::backtrace::_print::hcd4834796ee88ad2
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f89138c3284 - std::sys_common::backtrace::print::h1360e9450e4f922a
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f89138c6193 - std::panicking::default_hook::{{closure}}::h2609fa95cd5ab1f4
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:270:22
  10:     0x7f89138c5eac - std::panicking::default_hook::h6d75f5747cab6e8d
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:290:9
  11:     0x7f8916a90a3e - <alloc[98253621d83cbf53]::boxed::Box<rustc_driver_impl[566d207f92c3d9d2]::install_ice_hook::{closure#0}> as core[d28c4e8d9c4eebaa]::ops::function::Fn<(&dyn for<'a, 'b> core[d28c4e8d9c4eebaa]::ops::function::Fn<(&'a core[d28c4e8d9c4eebaa]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[d28c4e8d9c4eebaa]::marker::Sync + core[d28c4e8d9c4eebaa]::marker::Send, &core[d28c4e8d9c4eebaa]::panic::panic_info::PanicInfo)>>::call
  12:     0x7f89138c69be - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h05249de742e1768e
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/alloc/src/boxed.rs:2021:9
  13:     0x7f89138c69be - std::panicking::rust_panic_with_hook::h57e78470c47c84de
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:711:13
  14:     0x7f89138c6747 - std::panicking::begin_panic_handler::{{closure}}::h3dfd2453cf356ecb
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:599:13
  15:     0x7f89138c39c6 - std::sys_common::backtrace::__rust_end_short_backtrace::hdb177d43678e4d7e
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x7f89138c6492 - rust_begin_unwind
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:595:5
  17:     0x7f8913925803 - core::panicking::panic_fmt::hd1e971d8d7c78e0e
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:67:14
  18:     0x7f8913925daa - core::result::unwrap_failed::hccb456d39e9c31fc
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/result.rs:1652:5
  19:     0x7f8915b39402 - rustc_lint[dcffebd080019e25]::types::repr_nullable_ptr
  20:     0x7f8915b38313 - <rustc_lint[dcffebd080019e25]::types::ImproperCTypesVisitor>::check_type_for_ffi
  21:     0x7f8915b384b8 - <rustc_lint[dcffebd080019e25]::types::ImproperCTypesVisitor>::check_type_for_ffi
  22:     0x7f891561b26a - <rustc_lint[dcffebd080019e25]::types::ImproperCTypesVisitor>::check_type_for_ffi_and_report_errors
  23:     0x7f8914ead620 - <rustc_lint[dcffebd080019e25]::types::ImproperCTypesDefinitions>::check_ty_maybe_containing_foreign_fnptr
  24:     0x7f8914bf3127 - <rustc_lint[dcffebd080019e25]::BuiltinCombinedModuleLateLintPass as rustc_lint[dcffebd080019e25]::passes::LateLintPass>::check_item
  25:     0x7f8914beb2fa - rustc_hir[eee75afb991cf387]::intravisit::walk_mod::<rustc_lint[dcffebd080019e25]::late::LateContextAndPass<rustc_lint[dcffebd080019e25]::BuiltinCombinedModuleLateLintPass>>
  26:     0x7f8914bea9d5 - rustc_lint[dcffebd080019e25]::late::late_lint_mod::<rustc_lint[dcffebd080019e25]::BuiltinCombinedModuleLateLintPass>
  27:     0x7f8914bea77a - rustc_lint[dcffebd080019e25]::lint_mod
  28:     0x7f89157c16ac - rustc_query_impl[778daaabc67f3fff]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[778daaabc67f3fff]::query_impl::lint_mod::dynamic_query::{closure#2}::{closure#0}, rustc_middle[5935fdd60c99b3fe]::query::erase::Erased<[u8; 0usize]>>
  29:     0x7f89157c168e - <rustc_query_impl[778daaabc67f3fff]::query_impl::lint_mod::dynamic_query::{closure#2} as core[d28c4e8d9c4eebaa]::ops::function::FnOnce<(rustc_middle[5935fdd60c99b3fe]::ty::context::TyCtxt, rustc_span[4c9f011e8b033119]::def_id::LocalModDefId)>>::call_once
  30:     0x7f8915a1e5e3 - rustc_query_system[e0e328d29a6e1c80]::query::plumbing::try_execute_query::<rustc_query_impl[778daaabc67f3fff]::DynamicConfig<rustc_query_system[e0e328d29a6e1c80]::query::caches::DefaultCache<rustc_span[4c9f011e8b033119]::def_id::LocalModDefId, rustc_middle[5935fdd60c99b3fe]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[778daaabc67f3fff]::plumbing::QueryCtxt, false>
  31:     0x7f8916401a04 - rustc_query_impl[778daaabc67f3fff]::query_impl::lint_mod::get_query_non_incr::__rust_end_short_backtrace
  32:     0x7f8915c517e3 - rustc_data_structures[29929b1a5d4d6700]::sync::par_for_each_in::<&[rustc_hir[eee75afb991cf387]::hir_id::OwnerId], <rustc_middle[5935fdd60c99b3fe]::hir::map::Map>::par_for_each_module<rustc_lint[dcffebd080019e25]::late::check_crate::{closure#1}::{closure#0}::{closure#0}>::{closure#0}>
  33:     0x7f8915c51616 - <rustc_session[f1e1083633086c54]::session::Session>::time::<(), rustc_lint[dcffebd080019e25]::late::check_crate::{closure#1}::{closure#0}>
  34:     0x7f8915c51044 - <core[d28c4e8d9c4eebaa]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[5bdd18de9f5858d8]::passes::analysis::{closure#5}::{closure#1}::{closure#2}> as core[d28c4e8d9c4eebaa]::ops::function::FnOnce<()>>::call_once
  35:     0x7f8915c50d9f - <core[d28c4e8d9c4eebaa]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[5bdd18de9f5858d8]::passes::analysis::{closure#5}::{closure#1}> as core[d28c4e8d9c4eebaa]::ops::function::FnOnce<()>>::call_once
  36:     0x7f8915c507c8 - <rustc_session[f1e1083633086c54]::session::Session>::time::<(), rustc_interface[5bdd18de9f5858d8]::passes::analysis::{closure#5}>
  37:     0x7f8915c4e547 - rustc_interface[5bdd18de9f5858d8]::passes::analysis
  38:     0x7f8915f9670a - rustc_query_impl[778daaabc67f3fff]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[778daaabc67f3fff]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[5935fdd60c99b3fe]::query::erase::Erased<[u8; 1usize]>>
  39:     0x7f8915f966f9 - <rustc_query_impl[778daaabc67f3fff]::query_impl::analysis::dynamic_query::{closure#2} as core[d28c4e8d9c4eebaa]::ops::function::FnOnce<(rustc_middle[5935fdd60c99b3fe]::ty::context::TyCtxt, ())>>::call_once
  40:     0x7f8916138be8 - rustc_query_system[e0e328d29a6e1c80]::query::plumbing::try_execute_query::<rustc_query_impl[778daaabc67f3fff]::DynamicConfig<rustc_query_system[e0e328d29a6e1c80]::query::caches::SingleCache<rustc_middle[5935fdd60c99b3fe]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[778daaabc67f3fff]::plumbing::QueryCtxt, false>
  41:     0x7f8916138969 - rustc_query_impl[778daaabc67f3fff]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  42:     0x7f8915d42973 - <rustc_interface[5bdd18de9f5858d8]::queries::QueryResult<&rustc_middle[5935fdd60c99b3fe]::ty::context::GlobalCtxt>>::enter::<core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>, rustc_driver_impl[566d207f92c3d9d2]::run_compiler::{closure#1}::{closure#2}::{closure#6}>
  43:     0x7f8915d4194a - <rustc_interface[5bdd18de9f5858d8]::interface::Compiler>::enter::<rustc_driver_impl[566d207f92c3d9d2]::run_compiler::{closure#1}::{closure#2}, core[d28c4e8d9c4eebaa]::result::Result<core[d28c4e8d9c4eebaa]::option::Option<rustc_interface[5bdd18de9f5858d8]::queries::Linker>, rustc_span[4c9f011e8b033119]::ErrorGuaranteed>>
  44:     0x7f8915d3ec68 - std[3759e478f3a6c4f2]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[5bdd18de9f5858d8]::util::run_in_thread_pool_with_globals<rustc_interface[5bdd18de9f5858d8]::interface::run_compiler<core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>, rustc_driver_impl[566d207f92c3d9d2]::run_compiler::{closure#1}>::{closure#0}, core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>>
  45:     0x7f8915d3e3ee - <<std[3759e478f3a6c4f2]::thread::Builder>::spawn_unchecked_<rustc_interface[5bdd18de9f5858d8]::util::run_in_thread_pool_with_globals<rustc_interface[5bdd18de9f5858d8]::interface::run_compiler<core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>, rustc_driver_impl[566d207f92c3d9d2]::run_compiler::{closure#1}>::{closure#0}, core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>>::{closure#1} as core[d28c4e8d9c4eebaa]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  46:     0x7f89138d1295 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::haadd4e5af2ab0d62
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/alloc/src/boxed.rs:2007:9
  47:     0x7f89138d1295 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he4ba1fb09c16d807
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/alloc/src/boxed.rs:2007:9
  48:     0x7f89138d1295 - std::sys::unix::thread::Thread::new::thread_start::he524ecf4b47bee95
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys/unix/thread.rs:108:17
  49:     0x7f891361dac3 - <unknown>
  50:     0x7f89136afa40 - <unknown>
  51:                0x0 - <unknown>

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.73.0 (cc66ad468 2023-10-03) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2

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

query stack during panic:
#0 [lint_mod] linting module `plugins`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `memflow` (lib)
Backtrace

RUST_BACKTRACE=1 cargo build
warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
   Compiling memflow v0.2.0-beta10
thread 'rustc' panicked at compiler/rustc_lint/src/types.rs:920:82:
called `Result::unwrap()` on an `Err` value: NormalizationFailure(std::option::Option<&<T as plugins::Loadable>::ArgsType>, Type(std::option::Option<&<T as plugins::Loadable>::ArgsType>))
stack backtrace:
   0: rust_begin_unwind
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:595:5
   1: core::panicking::panic_fmt
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/result.rs:1652:5
   3: rustc_lint::types::repr_nullable_ptr
   4: <rustc_lint::types::ImproperCTypesVisitor>::check_type_for_ffi
   5: <rustc_lint::types::ImproperCTypesVisitor>::check_type_for_ffi
   6: <rustc_lint::types::ImproperCTypesVisitor>::check_type_for_ffi_and_report_errors
   7: <rustc_lint::types::ImproperCTypesDefinitions>::check_ty_maybe_containing_foreign_fnptr
   8: <rustc_lint::BuiltinCombinedModuleLateLintPass as rustc_lint::passes::LateLintPass>::check_item
   9: rustc_hir::intravisit::walk_mod::<rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass>>
  10: rustc_lint::late::late_lint_mod::<rustc_lint::BuiltinCombinedModuleLateLintPass>
  11: rustc_lint::lint_mod
      [... omitted 2 frames ...]
  12: rustc_data_structures::sync::par_for_each_in::<&[rustc_hir::hir_id::OwnerId], <rustc_middle::hir::map::Map>::par_for_each_module<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure#0}>::{closure#0}>
  13: <rustc_session::session::Session>::time::<(), rustc_lint::late::check_crate::{closure#1}::{closure#0}>
  14: <core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#5}::{closure#1}::{closure#2}> as core::ops::function::FnOnce<()>>::call_once
  15: <core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#5}::{closure#1}> as core::ops::function::FnOnce<()>>::call_once
  16: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#5}>
  17: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  18: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#6}>
  19: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
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.73.0 (cc66ad468 2023-10-03) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2

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

query stack during panic:
#0 [lint_mod] linting module `plugins`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `memflow` (lib)

#115143

@sleshep sleshep 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 13, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 13, 2023
@Luk-ESC
Copy link
Contributor

Luk-ESC commented Oct 13, 2023

Could reproduce with cargo +stable build but not with nightly.

@JohnTitor JohnTitor added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Oct 15, 2023
@saethlin saethlin removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 22, 2023
@saethlin
Copy link
Member

This is an exact duplicate of #115143. The fix is in rustc 1.74, which is the next stable.

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) ❄️ 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

5 participants