Skip to content

thread 'rustc' panicked at compiler\rustc_monomorphize\src\collector.rs:295:51 #140001

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
xmh0511 opened this issue Apr 18, 2025 · 1 comment
Open
Labels
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. S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Apr 18, 2025

Code

git clone https://github.com/rustp2p/rustp2p/tree/4cd70aad375e27126d5d33c52c211b695550499d
cargo run --example node_kcp_stream -- --peer udp://x.x.x.x:8080 --group-code rust-p2p --id 1024

Meta

rustc --version --verbose:

rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: x86_64-pc-windows-msvc
release: 1.86.0
LLVM version: 19.1.7

Error output

thread 'rustc' panicked at compiler\rustc_monomorphize\src\collector.rs:295:51:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7ffb3ab717b1 - std::backtrace_rs::backtrace::win64::trace
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\..\..\backtrace\src\backtrace\win64.rs:85
   1:     0x7ffb3ab717b1 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffb3ab717b1 - std::sys::backtrace::_print_fmt
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\sys\backtrace.rs:66
   3:     0x7ffb3ab717b1 - std::sys::backtrace::impl$0::print::impl$0::fmt
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\sys\backtrace.rs:39
   4:     0x7ffb3aba52ba - core::fmt::rt::Argument::fmt
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\core\src\fmt\rt.rs:177
   5:     0x7ffb3aba52ba - core::fmt::write
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\core\src\fmt\mod.rs:1449
   6:     0x7ffb3ab67537 - std::io::Write::write_fmt<std::sys::pal::windows::stdio::Stderr>
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\io\mod.rs:1890
   7:     0x7ffb3ab715f5 - std::sys::backtrace::BacktraceLock::print
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\sys\backtrace.rs:42
   8:     0x7ffb3ab74520 - std::panicking::default_hook::closure$0
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\panicking.rs:298
   9:     0x7ffb3ab74311 - std::panicking::default_hook
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\panicking.rs:325
  10:     0x7ffb3c22764f - core[379ed1e85498c8da]::slice::sort::unstable::heapsort::heapsort::<((rustc_lint_defs[954f94a5540fbc1c]::Level, &str), usize), <((rustc_lint_defs[954f94a5540fbc1c]::Level, &str), usize) as core[379ed1e85498c8da]::cmp::PartialOrd>::lt>
  11:     0x7ffb3ab751ae - alloc::boxed::impl$30::call
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\alloc\src\boxed.rs:1990
  12:     0x7ffb3ab751ae - std::panicking::rust_panic_with_hook
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\panicking.rs:839
  13:     0x7ffb3ab74ed2 - std::panicking::begin_panic_handler::closure$0
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\panicking.rs:697
  14:     0x7ffb3ab7231f - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\sys\backtrace.rs:168
  15:     0x7ffb3ab74b0e - std::panicking::begin_panic_handler
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\panicking.rs:695
  16:     0x7ffb3db046f1 - core::panicking::panic_fmt
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\core\src\panicking.rs:75
  17:     0x7ffb3db047ad - core::panicking::panic
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\core\src\panicking.rs:145
  18:     0x7ffb3db0466e - core::option::unwrap_failed
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\core\src\option.rs:2015
  19:     0x7ffb3af6dcb9 - rustc_monomorphize[90fde467f2845068]::mono_checks::check_mono_item
  20:     0x7ffb3af6d848 - rustc_monomorphize[90fde467f2845068]::mono_checks::check_mono_item
  21:     0x7ffb3af6321c - rustc_monomorphize[90fde467f2845068]::mono_checks::check_mono_item
  22:     0x7ffb3a4b9da5 - RINvNtNtNtNtCs4M45Py2ANNS_4core5slice4sort6stable9quicksort9quicksortNtNtNtCs2vqUEYxsi4E_12rustc_middle3mir4mono11CodegenUnitNCINvMNtCsdPcZrWPtBQZ_5alloc5sliceSB15_7sort_byNCNvNtCscrMQbMLbhAi_18rustc_monomorphize12partitioning19merge_codegen_unitss4_0E0EB2
  23:     0x7ffb3af6ee59 - rustc_monomorphize[90fde467f2845068]::partitioning::collect_and_partition_mono_items
  24:     0x7ffb3a7776f7 - <alloc[a10a1d58def73cb3]::sync::Arc<rustc_session[19a3b74f3cfc0353]::cstore::CrateSource>>::drop_slow
  25:     0x7ffb3a75ae4d - <alloc[a10a1d58def73cb3]::sync::Arc<rustc_session[19a3b74f3cfc0353]::cstore::CrateSource>>::drop_slow
  26:     0x7ffb3a68ef70 - RINvNtNtCs1bonBNpMvFl_18rustc_query_system5query8plumbing17try_execute_queryINtCs5uFTMav0Vyp_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCs2vqUEYxsi4E_12rustc_middle5query5erase6ErasedAhj28_EEKb0_KB3t_KB3t_ENtNtB1f_8plumbing9QueryCt
  27:     0x7ffb3d0d6791 - <rustc_span[feb426b5f536fd7b]::def_id::DefIndex as rustc_query_impl[40004147c2ba326b]::profiling_support::SpecIntoSelfProfilingString>::spec_to_self_profile_string
  28:     0x7ffb3b9eea3b - rustc_codegen_ssa[127dad73d42d1fb2]::back::symbol_export::exported_symbols_provider_local
  29:     0x7ffb3a77491a - <alloc[a10a1d58def73cb3]::sync::Arc<rustc_session[19a3b74f3cfc0353]::cstore::CrateSource>>::drop_slow
  30:     0x7ffb3a74f1dd - <alloc[a10a1d58def73cb3]::sync::Arc<rustc_session[19a3b74f3cfc0353]::cstore::CrateSource>>::drop_slow
  31:     0x7ffb3a6f8527 - RINvNtNtCs1bonBNpMvFl_18rustc_query_system5query8plumbing17try_execute_queryINtCs5uFTMav0Vyp_16rustc_query_impl13DynamicConfigINtNtCsdmqHcUI6doO_21rustc_data_structures9vec_cache8VecCacheNtNtCslRMtD7Kp4gh_10rustc_span6def_id8CrateNumINtNtNtCs2vqUEYxsi4E_12
  32:     0x7ffb3a79e6c0 - rustc_query_impl[40004147c2ba326b]::query_system
  33:     0x7ffb3bc6eeee - <rustc_metadata[8812c7b17da9c624]::rmeta::encoder::EncodeContext as rustc_span[feb426b5f536fd7b]::SpanEncoder>::encode_symbol
  34:     0x7ffb3a91982d - rustc_metadata[8812c7b17da9c624]::rmeta::encoder::encode_metadata
  35:     0x7ffb3a92255a - rustc_metadata[8812c7b17da9c624]::fs::encode_and_write_metadata
  36:     0x7ffb377ed57f - <rustc_interface[8ba4dc793610d11]::queries::Linker>::codegen_and_build_linker
  37:     0x7ffb377afc67 - RINvNtNtCs95AQCFfcpgw_3std3sys9backtrace28___rust_begin_short_backtraceNCNCNCINvMNtB6_6threadNtB1h_7Builder16spawn_unchecked_INtNtCsdPcZrWPtBQZ_5alloc5boxed3BoxDINtNtNtCs4M45Py2ANNS_4core3ops8function6FnOnceuEp6OutputuNtNtB2G_6marker4SendEL_EuEs_000uECs42d
  38:     0x7ffb377a7fff - RINvNtNtCs95AQCFfcpgw_3std3sys9backtrace28___rust_begin_short_backtraceNCNCNCINvMNtB6_6threadNtB1h_7Builder16spawn_unchecked_INtNtCsdPcZrWPtBQZ_5alloc5boxed3BoxDINtNtNtCs4M45Py2ANNS_4core3ops8function6FnOnceuEp6OutputuNtNtB2G_6marker4SendEL_EuEs_000uECs42d
  39:     0x7ffb377a0ce9 - RINvNtNtCs95AQCFfcpgw_3std3sys9backtrace28___rust_begin_short_backtraceNCNCINvNtCsKsn22XSOmP_15rustc_interface4util26run_in_thread_with_globalsNCINvB1e_31run_in_thread_pool_with_globalsNCINvNtB1g_9interface12run_compileruNCNvCs42dsZK7oXeC_17rustc_driver_im
  40:     0x7ffb377b49c3 - RINvNtNtCs95AQCFfcpgw_3std3sys9backtrace28___rust_begin_short_backtraceNCNCNCINvMNtB6_6threadNtB1h_7Builder16spawn_unchecked_INtNtCsdPcZrWPtBQZ_5alloc5boxed3BoxDINtNtNtCs4M45Py2ANNS_4core3ops8function6FnOnceuEp6OutputuNtNtB2G_6marker4SendEL_EuEs_000uECs42d
  41:     0x7ffb3ab8656d - alloc::boxed::impl$28::call_once
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\alloc\src\boxed.rs:1976
  42:     0x7ffb3ab8656d - alloc::boxed::impl$28::call_once
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\alloc\src\boxed.rs:1976
  43:     0x7ffb3ab8656d - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\sys\pal\windows\thread.rs:56
  44:     0x7ffbbfdd7374 - BaseThreadInitThunk
  45:     0x7ffbc181cc91 - RtlUserThreadStart

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-pc-windows-msvc

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

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

query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
#1 [exported_symbols] collecting exported symbols for crate `0`
end of query stack
error: could not compile `rustp2p` (lib)

Caused by:
  process didn't exit successfully: `C:\Users\DY2024\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\rustc.exe --crate-name rustp2p --edition=2021 src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=119 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"aes-gcm\"" --cfg "feature=\"default\"" --cfg "feature=\"kcp\"" --cfg "feature=\"ring\"" --cfg "feature=\"use-kcp\"" --check-cfg cfg(docsrs,test) --check-cfg "cfg(feature, values(\"aes-gcm\", \"chacha20-poly1305\", \"default\", \"kcp\", \"ring\", \"use-kcp\"))" -C metadata=17e731cf31f6036d -C extra-filename=-afdff4327a0b8e73 --out-dir D:\rust-workspace\rustp2p\target\debug\deps -C incremental=D:\rust-workspace\rustp2p\target\debug\incremental -L dependency=D:\rust-workspace\rustp2p\target\debug\deps --extern async_shutdown=D:\rust-workspace\rustp2p\target\debug\deps\libasync_shutdown-333f7bb6ac1b04b2.rmeta --extern async_trait=D:\rust-workspace\rustp2p\target\debug\deps\async_trait-e7e703dee0817039.dll --extern bytes=D:\rust-workspace\rustp2p\target\debug\deps\libbytes-d18dcb52e317328a.rmeta --extern crossbeam_queue=D:\rust-workspace\rustp2p\target\debug\deps\libcrossbeam_queue-fad21306d5bb70e8.rmeta --extern crossbeam_utils=D:\rust-workspace\rustp2p\target\debug\deps\libcrossbeam_utils-05ebb9128f5cd03c.rmeta --extern dashmap=D:\rust-workspace\rustp2p\target\debug\deps\libdashmap-59fb4c6b06ec3d1a.rmeta --extern dns_parser=D:\rust-workspace\rustp2p\target\debug\deps\libdns_parser-d3993e19aaabc81a.rmeta --extern flume=D:\rust-workspace\rustp2p\target\debug\deps\libflume-9beb41dd9944ff8b.rmeta --extern futures=D:\rust-workspace\rustp2p\target\debug\deps\libfutures-573ed7291d1bf7cc.rmeta --extern kcp=D:\rust-workspace\rustp2p\target\debug\deps\libkcp-26049e7d94fd9b5e.rmeta --extern log=D:\rust-workspace\rustp2p\target\debug\deps\liblog-0cedae3a88086422.rmeta --extern parking_lot=D:\rust-workspace\rustp2p\target\debug\deps\libparking_lot-aba126dacead5cb4.rmeta --extern rand=D:\rust-workspace\rustp2p\target\debug\deps\librand-97d0e1b09972c6f6.rmeta --extern ring=D:\rust-workspace\rustp2p\target\debug\deps\libring-598abcdea4cdd1ce.rmeta --extern rmp_serde=D:\rust-workspace\rustp2p\target\debug\deps\librmp_serde-ed0f39c9f2890192.rmeta --extern rust_p2p_core=D:\rust-workspace\rustp2p\target\debug\deps\librust_p2p_core-89d578ccea9d033e.rmeta --extern sha2=D:\rust-workspace\rustp2p\target\debug\deps\libsha2-b9d2341a53c76718.rmeta --extern thiserror=D:\rust-workspace\rustp2p\target\debug\deps\libthiserror-6e0a1b328fe61b83.rmeta --extern tokio=D:\rust-workspace\rustp2p\target\debug\deps\libtokio-f77f08d23dc27e37.rmeta --extern tokio_util=D:\rust-workspace\rustp2p\target\debug\deps\libtokio_util-0a0d945d8a0291b5.rmeta -L native=C:\Users\DY2024\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\windows_x86_64_msvc-0.52.6\lib -L native=D:\rust-workspace\rustp2p\target\debug\build\ring-d96fa81d6c6837f7\out` (exit code: 101)
Backtrace

<backtrace>

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

moxian commented Apr 21, 2025

Unable to reproduce.

> git clone https://github.com/rustp2p/rustp2p/tree/4cd70aad375e27126d5d33c52c211b695550499d
Cloning into '4cd70aad375e27126d5d33c52c211b695550499d'...
fatal: repository 'https://github.com/rustp2p/rustp2p/tree/4cd70aad375e27126d5d33c52c211b695550499d/' not found
> git clone https://github.com/rustp2p/rustp2p
<..snip..>
> cd .\rustp2p\
> git checkout 4cd70aad375e27126d5d33c52c211b695550499d
> cargo +1.86.0 build --example node_kcp_stream
    Updating crates.io index
<..snip..>
  Downloaded 35 crates (3.4 MB) in 6.43s
error: target `node_kcp_stream` in package `rustp2p` requires the features: `use-kcp`
Consider enabling them by passing, e.g., `--features="use-kcp"`
> cargo +1.86.0 build --example node_kcp_stream --features=use-kcp
<..snip..>
   Compiling rustp2p v0.3.0 (H:\[redacted]\rustp2p)
   Compiling tun-rs v2.0.9
   Compiling env_logger v0.11.8
   Compiling pnet_packet v0.35.0
   Compiling ctrlc v3.4.6
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 03s
> cargo +1.86.0 build --example node_kcp_stream --features='aes-gcm,default,kcp,ring,use-kcp'
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.42s
> rustc +1.86.0 -vV
rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: x86_64-pc-windows-msvc
release: 1.86.0
LLVM version: 19.1.7

Can you please double-check the repro instructions?

@rustbot label: +S-needs-repro

@rustbot rustbot added the S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. label Apr 21, 2025
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) ❄️ needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. 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