slawlor / ractor

Rust actor framework
MIT License
1.3k stars 66 forks source link

Compiler panics #233

Closed vinay10949 closed 1 month ago

vinay10949 commented 2 months ago

I have below enum

#[derive(Debug, RactorMessage)]
pub enum DkgEngineMessage {
    Init(usize, Vec<(usize, PeerId, MishtiPublicKey, String)>, usize),
    Round1,
    EncryptedYValuesAndCommittment((u128, HashMap<u128, Vec<u8>>, Vec<AffinePoint>)),
    Round2,
    StoreReceivedPublicKey(u128, AffinePoint),
    Round3,
}

The moment i change the value to below ,rust compiler panics


#[derive(Debug, RactorMessage)]
pub enum DkgEngineMessage {
    Init(usize, Vec<(usize, PeerId, MishtiPublicKey, String)>, usize),
    Round1,
    EncryptedYValuesAndCommitment((u128, HashMap<u128, Vec<u8>>, Vec<AffinePoint>)),
    Round2,
    StoreReceivedPublicKey(u128, AffinePoint),
    Round3,
}

More Details

thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:22:85:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:        0x101cf4594 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb478ebbfb46e27ce
   1:        0x101d369ac - core::fmt::write::he4d5fa2daff1f531
   2:        0x101cead9c - std::io::Write::write_fmt::hc5a47a68eba63d9f
   3:        0x101cf43c8 - std::sys_common::backtrace::print::h79bd952cc5812e7a
   4:        0x101cf6e90 - std::panicking::default_hook::{{closure}}::h82301f6222887737
   5:        0x101cf6bd8 - std::panicking::default_hook::h1e49abbb3f1d7dbf
   6:        0x10a412070 - <alloc[37ddc2533ea56b7b]::boxed::Box<rustc_driver_impl[d723ad74a265baf3]::install_ice_hook::{closure#0}> as core[18650a1770591c75]::ops::function::Fn<(&dyn for<'a, 'b> core[18650a1770591c75]::ops::function::Fn<(&'a core[18650a1770591c75]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[18650a1770591c75]::marker::Sync + core[18650a1770591c75]::marker::Send, &core[18650a1770591c75]::panic::panic_info::PanicInfo)>>::call
   7:        0x101cf7528 - std::panicking::rust_panic_with_hook::h1e70c5d905e30e9d
   8:        0x101cf72b8 - std::panicking::begin_panic_handler::{{closure}}::h399e32952efd26a4
   9:        0x101cf4a18 - std::sys_common::backtrace::__rust_end_short_backtrace::h2ab87f841a2323e7
  10:        0x101cf706c - _rust_begin_unwind
  11:        0x101d50bd0 - core::panicking::panic_fmt::h33e40d2a93cab78f
  12:        0x101d50c58 - core::panicking::panic::h57fd475c037a9df3
  13:        0x10e049240 - <rustc_metadata[c158e32403486cef]::creader::CStore as rustc_session[29d615da54b3962b]::cstore::CrateStore>::def_path_hash_to_def_id
  14:        0x10e4b4640 - <rustc_middle[35a781f9bda42497]::ty::context::TyCtxt>::def_path_hash_to_def_id
  15:        0x10e552738 - <rustc_query_system[201a503e095b67cb]::dep_graph::dep_node::DepNode as rustc_middle[35a781f9bda42497]::dep_graph::dep_node::DepNodeExt>::extract_def_id
  16:        0x10d872184 - <rustc_query_impl[ab66d2f3916826ca]::plumbing::query_callback<rustc_query_impl[ab66d2f3916826ca]::query_impl::type_of::QueryType>::{closure#0} as core[18650a1770591c75]::ops::function::FnOnce<(rustc_middle[35a781f9bda42497]::ty::context::TyCtxt, rustc_query_system[201a503e095b67cb]::dep_graph::dep_node::DepNode)>>::call_once
  17:        0x10d8f9f1c - <rustc_query_system[201a503e095b67cb]::dep_graph::graph::DepGraphData<rustc_middle[35a781f9bda42497]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[ab66d2f3916826ca]::plumbing::QueryCtxt>
  18:        0x10d8f9f64 - <rustc_query_system[201a503e095b67cb]::dep_graph::graph::DepGraphData<rustc_middle[35a781f9bda42497]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[ab66d2f3916826ca]::plumbing::QueryCtxt>
  19:        0x10d8f9f64 - <rustc_query_system[201a503e095b67cb]::dep_graph::graph::DepGraphData<rustc_middle[35a781f9bda42497]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[ab66d2f3916826ca]::plumbing::QueryCtxt>
  20:        0x10d8f9f64 - <rustc_query_system[201a503e095b67cb]::dep_graph::graph::DepGraphData<rustc_middle[35a781f9bda42497]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[ab66d2f3916826ca]::plumbing::QueryCtxt>
  21:        0x10d8f9f64 - <rustc_query_system[201a503e095b67cb]::dep_graph::graph::DepGraphData<rustc_middle[35a781f9bda42497]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[ab66d2f3916826ca]::plumbing::QueryCtxt>
  22:        0x10d8f9f64 - <rustc_query_system[201a503e095b67cb]::dep_graph::graph::DepGraphData<rustc_middle[35a781f9bda42497]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[ab66d2f3916826ca]::plumbing::QueryCtxt>
  23:        0x10d8f9cf4 - <rustc_query_system[201a503e095b67cb]::dep_graph::graph::DepGraphData<rustc_middle[35a781f9bda42497]::dep_graph::DepsType>>::try_mark_green::<rustc_query_impl[ab66d2f3916826ca]::plumbing::QueryCtxt>
  24:        0x10d81196c - rustc_query_system[201a503e095b67cb]::query::plumbing::try_execute_query::<rustc_query_impl[ab66d2f3916826ca]::DynamicConfig<rustc_query_system[201a503e095b67cb]::query::caches::DefaultCache<rustc_type_ir[4c053739833dc843]::canonical::Canonical<rustc_middle[35a781f9bda42497]::ty::context::TyCtxt, rustc_middle[35a781f9bda42497]::ty::ParamEnvAnd<rustc_middle[35a781f9bda42497]::ty::Predicate>>, rustc_middle[35a781f9bda42497]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[ab66d2f3916826ca]::plumbing::QueryCtxt, true>
  25:        0x10da2960c - rustc_query_impl[ab66d2f3916826ca]::query_impl::evaluate_obligation::get_query_incr::__rust_end_short_backtrace
  26:        0x10dbc8b34 - <rustc_infer[2d6df025bdd09780]::infer::InferCtxt as rustc_trait_selection[286fba3891d5769f]::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
  27:        0x10dbc8d54 - <rustc_infer[2d6df025bdd09780]::infer::InferCtxt as rustc_trait_selection[286fba3891d5769f]::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
  28:        0x10dc75aa4 - <rustc_trait_selection[286fba3891d5769f]::traits::fulfill::FulfillProcessor>::process_trait_obligation
  29:        0x10dc74a00 - <rustc_trait_selection[286fba3891d5769f]::traits::fulfill::FulfillProcessor as rustc_data_structures[6154127fb9474933]::obligation_forest::ObligationProcessor>::process_obligation
  30:        0x10dc67e10 - <rustc_data_structures[6154127fb9474933]::obligation_forest::ObligationForest<rustc_trait_selection[286fba3891d5769f]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[286fba3891d5769f]::traits::fulfill::FulfillProcessor>
  31:        0x10dc7359c - <rustc_trait_selection[286fba3891d5769f]::traits::fulfill::FulfillmentContext as rustc_infer[2d6df025bdd09780]::traits::engine::TraitEngine>::select_where_possible
  32:        0x10d777780 - rustc_traits[9637c2d4d702dc1f]::codegen::codegen_select_candidate
  33:        0x10d88bcd4 - rustc_query_impl[ab66d2f3916826ca]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ab66d2f3916826ca]::query_impl::codegen_select_candidate::dynamic_query::{closure#2}::{closure#0}, rustc_middle[35a781f9bda42497]::query::erase::Erased<[u8; 16usize]>>
  34:        0x10d8d8060 - <rustc_query_impl[ab66d2f3916826ca]::query_impl::codegen_select_candidate::dynamic_query::{closure#2} as core[18650a1770591c75]::ops::function::FnOnce<(rustc_middle[35a781f9bda42497]::ty::context::TyCtxt, (rustc_middle[35a781f9bda42497]::ty::ParamEnv, rustc_middle[35a781f9bda42497]::ty::sty::TraitRef))>>::call_once
  35:        0x10d840724 - rustc_query_system[201a503e095b67cb]::query::plumbing::try_execute_query::<rustc_query_impl[ab66d2f3916826ca]::DynamicConfig<rustc_query_system[201a503e095b67cb]::query::caches::DefaultCache<(rustc_middle[35a781f9bda42497]::ty::ParamEnv, rustc_middle[35a781f9bda42497]::ty::sty::TraitRef), rustc_middle[35a781f9bda42497]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[ab66d2f3916826ca]::plumbing::QueryCtxt, true>
  36:        0x10da18508 - rustc_query_impl[ab66d2f3916826ca]::query_impl::codegen_select_candidate::get_query_incr::__rust_end_short_backtrace
  37:        0x10ce193b0 - rustc_monomorphize[80476817c9a51eef]::custom_coerce_unsize_info
  38:        0x10cded95c - rustc_monomorphize[80476817c9a51eef]::collector::find_vtable_types_for_unsizing
  39:        0x10cdebc6c - <rustc_monomorphize[80476817c9a51eef]::collector::MirUsedCollector as rustc_middle[35a781f9bda42497]::mir::visit::Visitor>::visit_rvalue
  40:        0x10cdf0ad8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_used_items
  41:        0x10cdef648 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  42:        0x10cdef9e8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  43:        0x10cdef9e8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  44:        0x10cdef9e8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  45:        0x10cdef9e8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  46:        0x10cdef9e8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  47:        0x10cdef9e8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  48:        0x10cdef9e8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  49:        0x10cdef9e8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  50:        0x10cdef9e8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  51:        0x10cdef9e8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  52:        0x10cdef9e8 - rustc_monomorphize[80476817c9a51eef]::collector::collect_items_rec
  53:        0x10ce029bc - std[fcd23fca98dce159]::panicking::try::<(), core[18650a1770591c75]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[6154127fb9474933]::sync::parallel::disabled::par_for_each_in<alloc[37ddc2533ea56b7b]::vec::Vec<rustc_middle[35a781f9bda42497]::mir::mono::MonoItem>, rustc_monomorphize[80476817c9a51eef]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>>
  54:        0x10ce0f400 - rustc_data_structures[6154127fb9474933]::sync::parallel::disabled::par_for_each_in::<alloc[37ddc2533ea56b7b]::vec::Vec<rustc_middle[35a781f9bda42497]::mir::mono::MonoItem>, rustc_monomorphize[80476817c9a51eef]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>
  55:        0x10cdffe6c - <rustc_session[29d615da54b3962b]::session::Session>::time::<(), rustc_monomorphize[80476817c9a51eef]::collector::collect_crate_mono_items::{closure#1}>
  56:        0x10cdee210 - rustc_monomorphize[80476817c9a51eef]::collector::collect_crate_mono_items
  57:        0x10cdf6584 - rustc_monomorphize[80476817c9a51eef]::partitioning::collect_and_partition_mono_items
  58:        0x10d88c668 - rustc_query_impl[ab66d2f3916826ca]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ab66d2f3916826ca]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle[35a781f9bda42497]::query::erase::Erased<[u8; 24usize]>>
  59:        0x10d8d3c00 - <rustc_query_impl[ab66d2f3916826ca]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2} as core[18650a1770591c75]::ops::function::FnOnce<(rustc_middle[35a781f9bda42497]::ty::context::TyCtxt, ())>>::call_once
  60:        0x10d7fa770 - rustc_query_system[201a503e095b67cb]::query::plumbing::try_execute_query::<rustc_query_impl[ab66d2f3916826ca]::DynamicConfig<rustc_query_system[201a503e095b67cb]::query::caches::SingleCache<rustc_middle[35a781f9bda42497]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[ab66d2f3916826ca]::plumbing::QueryCtxt, true>
  61:        0x10da273f8 - rustc_query_impl[ab66d2f3916826ca]::query_impl::collect_and_partition_mono_items::get_query_incr::__rust_end_short_backtrace
  62:        0x10a5e00d0 - rustc_codegen_ssa[b392610c019ec31b]::base::codegen_crate::<rustc_codegen_llvm[b70b0e52460f9a66]::LlvmCodegenBackend>
  63:        0x10a69ec24 - <rustc_codegen_llvm[b70b0e52460f9a66]::LlvmCodegenBackend as rustc_codegen_ssa[b392610c019ec31b]::traits::backend::CodegenBackend>::codegen_crate
  64:        0x10a5a2f18 - <rustc_session[29d615da54b3962b]::session::Session>::time::<alloc[37ddc2533ea56b7b]::boxed::Box<dyn core[18650a1770591c75]::any::Any>, rustc_interface[9ecbacebda51131]::passes::start_codegen::{closure#0}>
  65:        0x10a57b2e0 - rustc_interface[9ecbacebda51131]::passes::start_codegen
  66:        0x10a57fffc - <rustc_middle[35a781f9bda42497]::ty::context::GlobalCtxt>::enter::<<rustc_interface[9ecbacebda51131]::queries::Queries>::codegen_and_build_linker::{closure#0}, core[18650a1770591c75]::result::Result<rustc_interface[9ecbacebda51131]::queries::Linker, rustc_span[d844dabcc0d15e78]::ErrorGuaranteed>>
  67:        0x10a5ba5a0 - <rustc_interface[9ecbacebda51131]::queries::Queries>::codegen_and_build_linker
  68:        0x10a43872c - <rustc_interface[9ecbacebda51131]::interface::Compiler>::enter::<rustc_driver_impl[d723ad74a265baf3]::run_compiler::{closure#0}::{closure#0}, core[18650a1770591c75]::result::Result<core[18650a1770591c75]::option::Option<rustc_interface[9ecbacebda51131]::queries::Linker>, rustc_span[d844dabcc0d15e78]::ErrorGuaranteed>>
  69:        0x10a3ff06c - rustc_span[d844dabcc0d15e78]::create_session_globals_then::<core[18650a1770591c75]::result::Result<(), rustc_span[d844dabcc0d15e78]::ErrorGuaranteed>, rustc_interface[9ecbacebda51131]::interface::run_compiler<core[18650a1770591c75]::result::Result<(), rustc_span[d844dabcc0d15e78]::ErrorGuaranteed>, rustc_driver_impl[d723ad74a265baf3]::run_compiler::{closure#0}>::{closure#0}>
  70:        0x10a435628 - std[fcd23fca98dce159]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[9ecbacebda51131]::util::run_in_thread_with_globals<rustc_interface[9ecbacebda51131]::interface::run_compiler<core[18650a1770591c75]::result::Result<(), rustc_span[d844dabcc0d15e78]::ErrorGuaranteed>, rustc_driver_impl[d723ad74a265baf3]::run_compiler::{closure#0}>::{closure#0}, core[18650a1770591c75]::result::Result<(), rustc_span[d844dabcc0d15e78]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[18650a1770591c75]::result::Result<(), rustc_span[d844dabcc0d15e78]::ErrorGuaranteed>>
  71:        0x10a407d7c - <<std[fcd23fca98dce159]::thread::Builder>::spawn_unchecked_<rustc_interface[9ecbacebda51131]::util::run_in_thread_with_globals<rustc_interface[9ecbacebda51131]::interface::run_compiler<core[18650a1770591c75]::result::Result<(), rustc_span[d844dabcc0d15e78]::ErrorGuaranteed>, rustc_driver_impl[d723ad74a265baf3]::run_compiler::{closure#0}>::{closure#0}, core[18650a1770591c75]::result::Result<(), rustc_span[d844dabcc0d15e78]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[18650a1770591c75]::result::Result<(), rustc_span[d844dabcc0d15e78]::ErrorGuaranteed>>::{closure#1} as core[18650a1770591c75]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  72:        0x101cff7d0 - std::sys::unix::thread::Thread::new::thread_start::h8dda2af345bab446
  73:        0x188a6f034 - __pthread_joiner_wake

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.76.0 (07dca489a 2024-02-04) running on aarch64-apple-darwin

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `(ractor::actor::ActorRuntime<actors::dkg_engine_actor::DKGEngineActor>, ractor::actor::actor_cell::ActorPortSet, (), core::option::Option<ractor::actor::actor_cell::ActorCell>): core::marker::Send`
#1 [codegen_select_candidate] computing candidate for `<core::pin::Pin<alloc::boxed::Box<{async block@<actors::dkg_engine_actor::DKGEngineActor as ractor::actor::Actor>::spawn<'_>::{closure#0}}>> as core::ops::unsize::CoerceUnsized<core::pin::Pin<alloc::boxed::Box<dyn core::future::future::Future<Output = core::result::Result<(ractor::actor::actor_ref::ActorRef<messages::message::DkgEngineMessage>, ractor::concurrency::async_std_primatives::JoinHandle<()>), ractor::errors::SpawnErr>> + core::marker::Send>>>>`
#2 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 TraitSelect(87c239a3835db47d-6f5abf2e90f846b6)
#1 TraitSelect(6e5181c191d4994d-7d488c4d7ac4a24d)
#2 TraitSelect(3c66a88c6165d416-fadfa8c5473a7496)
#3 TraitSelect(8aac8339635f01b0-e5a0054d6790ac86)
#4 TraitSelect(b8398942d7d7cc15-230bb15b9b875dd9)
#5 evaluate_obligation(54d4c8abba6bd052-97d059ab966bb6b5)
slawlor commented 2 months ago

I mean it seems pretty clear to me, this is a rustc panic which shouldn't happen

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.76.0 (07dca489a 2024-02-04) running on aarch64-apple-darwin

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

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

Please report there.

vinay10949 commented 2 months ago

Sure