Skip to content
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

ICE RLS rustc_save_analysis::SaveContext::get_expr_data #97671

Closed
deputinizer opened this issue Jun 3, 2022 · 2 comments
Closed

ICE RLS rustc_save_analysis::SaveContext::get_expr_data #97671

deputinizer opened this issue Jun 3, 2022 · 2 comments
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. 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

@deputinizer
Copy link

deputinizer commented Jun 3, 2022

Code

Well it's a crate libp2p_kad, version 0.37.0.
cargo build and cargo check works.
Only RLS seems to panic.
https://github.com/libp2p/rust-libp2p/blob/2ad905f35a61d7588f74aeea4e8010ccfbc70fcf/protocols/kad/Cargo.toml#L6

Meta

rustc --version --verbose:

rustc 1.61.0 (fe5b13d68 2022-05-18)
binary: rustc
commit-hash: fe5b13d681f25ee6474be29d748c65adcd91f69e
commit-date: 2022-05-18
host: x86_64-unknown-linux-gnu
release: 1.61.0
LLVM version: 14.0.0

crashes with 1.60.0-x86_64-unknown-linux-gnu - rustc 1.60.0 (7737e0b5c 2022-04-04)
crashes with stable-x86_64-unknown-linux-gnu - rustc 1.61.0 (fe5b13d68 2022-05-18)
crashes with nightly-x86_64-unknown-linux-gnu - rustc 1.63.0-nightly (e71440575 2022-06-02)

works with rustc 1.61.0 but older libp2p-kad

libp2p-kad = "0.36.0"
libp2p = { version = "0.44.0", features = ["tcp-tokio"] }

So breaking change is somewhere here:
https://github.com/libp2p/rust-libp2p/commits/master/protocols/kad

Error output

1 job failed
error: could not compile `libp2p-kad`

thread 'rustc' panicked at '`SaveContext::typeck_results` called outside of body', compiler/rustc_save_analysis/src/lib.rs:521:23
  22:     0x7f112fbcac94 - <rustc_save_analysis[1d4913668f56c67c]::SaveContext>::get_expr_data
Backtrace

$ rls --cli
Initializing (look for `progress[done:true]` message)...
> 1: InitializeResult {
    capabilities: ServerCapabilities {
        text_document_sync: Some(
            Kind(
                Incremental,
            ),
        ),
        selection_range_provider: None,
        hover_provider: Some(
            true,
        ),
        completion_provider: Some(
            CompletionOptions {
                resolve_provider: Some(
                    true,
                ),
                trigger_characters: Some(
                    [
                        ".",
                        ":",
                    ],
                ),
            },
        ),
        signature_help_provider: None,
        definition_provider: Some(
            true,
        ),
        type_definition_provider: None,
        implementation_provider: Some(
            Simple(
                true,
            ),
        ),
        references_provider: Some(
            true,
        ),
        document_highlight_provider: Some(
            true,
        ),
        document_symbol_provider: Some(
            true,
        ),
        workspace_symbol_provider: Some(
            true,
        ),
        code_action_provider: Some(
            Simple(
                true,
            ),
        ),
        code_lens_provider: Some(
            CodeLensOptions {
                resolve_provider: Some(
                    false,
                ),
            },
        ),
        document_formatting_provider: Some(
            true,
        ),
        document_range_formatting_provider: Some(
            false,
        ),
        document_on_type_formatting_provider: None,
        rename_provider: Some(
            Simple(
                true,
            ),
        ),
        color_provider: None,
        folding_range_provider: None,
        execute_command_provider: Some(
            ExecuteCommandOptions {
                commands: [
                    "rls.applySuggestion-962358",
                    "rls.deglobImports-962358",
                ],
            },
        ),
        workspace: None,
    },
}
{"jsonrpc":"2.0","method":"window/progress","params":{"done":null,"id":"progress_1","message":null,"percentage":null,"title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"done":null,"id":"progress_1","message":"libp2p_kad","percentage":null,"title":"Building"}}
{"artifact":"./target/rls/debug/deps/libp2p_kad-a290ac30ab05848b.d","emit":"dep-info"}
thread 'rustc' panicked at '`SaveContext::typeck_results` called outside of body', compiler/rustc_save_analysis/src/lib.rs:521:23
stack backtrace:
   0:     0x7f112f40f1cd - std::backtrace_rs::backtrace::libunwind::trace::h22893a5306c091b4
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f112f40f1cd - std::backtrace_rs::backtrace::trace_unsynchronized::h29c3bc6f9e91819d
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f112f40f1cd - std::sys_common::backtrace::_print_fmt::he497d8a0ec903793
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f112f40f1cd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9c2a9d2774d81873
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f112f46901c - core::fmt::write::hba4337c43d992f49
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/fmt/mod.rs:1194:17
   5:     0x7f112f4007c1 - std::io::Write::write_fmt::heb73de6e02cfabed
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/io/mod.rs:1655:15
   6:     0x7f112f4122b5 - std::sys_common::backtrace::_print::h63c8b24acdd8e8ce
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f112f4122b5 - std::sys_common::backtrace::print::h426700d6240cdcc2
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f112f4122b5 - std::panicking::default_hook::{{closure}}::hc9a76eed0b18f82b
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:295:22
   9:     0x7f112f411f69 - std::panicking::default_hook::h2e88d02087fae196
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:314:9
  10:     0x7f112fb8f1d1 - rustc_driver[413d55b6344850e3]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f110a60c963 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h20f1eaa9a9e78bff
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/boxed.rs:1875:9
  12:     0x7f110a6114cc - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h40ffab48749dcba7
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/proc_macro/src/bridge/client.rs:319:21
  13:     0x7f110a623140 - std::panicking::update_hook::{{closure}}::h65d82bd6904ebd2e
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:258:41
  14:     0x7f112f412a00 - std::panicking::rust_panic_with_hook::habfdcc2e90f9fd4c
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:702:17
  15:     0x7f112f412837 - std::panicking::begin_panic_handler::{{closure}}::he054b2a83a51d2cd
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:588:13
  16:     0x7f112f40f684 - std::sys_common::backtrace::__rust_end_short_backtrace::ha48b94ab49b30915
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:138:18
  17:     0x7f112f412569 - rust_begin_unwind
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:584:5
  18:     0x7f112f3d66b3 - core::panicking::panic_fmt::h366d3a309ae17c94
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:143:14
  19:     0x7f112f465e31 - core::panicking::panic_display::hd3e89d99fb893792
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:72:5
  20:     0x7f112f465ddb - core::panicking::panic_str::h98ed104b0c03a108
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:56:5
  21:     0x7f112f3d6526 - core::option::expect_failed::h58d487f78ae9d247
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/option.rs:1874:5
  22:     0x7f112fbcac94 - <rustc_save_analysis[1d4913668f56c67c]::SaveContext>::get_expr_data
  23:     0x7f112fbc2bfa - <rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor as rustc_hir[39b6c6275f771301]::intravisit::Visitor>::visit_expr
  24:     0x7f112fbb8965 - <rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor as rustc_hir[39b6c6275f771301]::intravisit::Visitor>::visit_nested_body
  25:     0x7f112fba454e - rustc_hir[39b6c6275f771301]::intravisit::walk_generic_args::<rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor>
  26:     0x7f112fba6446 - rustc_hir[39b6c6275f771301]::intravisit::walk_path::<rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor>
  27:     0x7f112fbbec86 - <rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor as rustc_hir[39b6c6275f771301]::intravisit::Visitor>::visit_item
  28:     0x7f112fbb8996 - <rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor as rustc_hir[39b6c6275f771301]::intravisit::Visitor>::visit_nested_item
  29:     0x7f112fba4fa7 - rustc_hir[39b6c6275f771301]::intravisit::walk_mod::<rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor>
  30:     0x7f112fbbe75d - <rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor as rustc_hir[39b6c6275f771301]::intravisit::Visitor>::visit_item
  31:     0x7f112fbb8996 - <rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor as rustc_hir[39b6c6275f771301]::intravisit::Visitor>::visit_nested_item
  32:     0x7f112fba4fa7 - rustc_hir[39b6c6275f771301]::intravisit::walk_mod::<rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor>
  33:     0x7f112fbbe75d - <rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor as rustc_hir[39b6c6275f771301]::intravisit::Visitor>::visit_item
  34:     0x7f112fbb8996 - <rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor as rustc_hir[39b6c6275f771301]::intravisit::Visitor>::visit_nested_item
  35:     0x7f112fba4fa7 - rustc_hir[39b6c6275f771301]::intravisit::walk_mod::<rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor>
  36:     0x7f112fbbca1b - <rustc_save_analysis[1d4913668f56c67c]::dump_visitor::DumpVisitor>::process_crate
  37:     0x7f112fb725c5 - <rustc_middle[9ca07169fec39ed9]::dep_graph::dep_node::DepKind as rustc_query_system[ac245aac4c1950a0]::dep_graph::DepKind>::with_deps::<rustc_save_analysis[1d4913668f56c67c]::process_crate<rustc_save_analysis[1d4913668f56c67c]::DumpHandler>::{closure#0}, ()>
  38:     0x7f112fb90433 - <rustc_session[8df92abe178df33c]::session::Session>::time::<(), rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}::{closure#2}::{closure#3}::{closure#0}>
  39:     0x7f1131a579e1 - <rustc_interface[550884b2b179878f]::passes::QueryContext>::enter::<rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>
  40:     0x7f1131a71a58 - <rustc_interface[550884b2b179878f]::interface::Compiler>::enter::<rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}::{closure#2}, core[a3420257622cd381]::result::Result<core[a3420257622cd381]::option::Option<rustc_interface[550884b2b179878f]::queries::Linker>, rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>
  41:     0x7f1131a5703f - rustc_span[7238ca7210ca999e]::with_source_map::<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_interface[550884b2b179878f]::interface::create_compiler_and_run<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}>::{closure#1}>
  42:     0x7f1131a730a4 - rustc_interface[550884b2b179878f]::interface::create_compiler_and_run::<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}>
  43:     0x7f1131a557c2 - <scoped_tls[7ed3ce20ede545d8]::ScopedKey<rustc_span[7238ca7210ca999e]::SessionGlobals>>::set::<rustc_interface[550884b2b179878f]::interface::run_compiler<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}>::{closure#0}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>
  44:     0x7f1131a6b38f - std[3b302b3c9093c22]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[550884b2b179878f]::util::run_in_thread_pool_with_globals<rustc_interface[550884b2b179878f]::interface::run_compiler<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}>::{closure#0}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>::{closure#0}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>
  45:     0x7f1131a56af9 - <<std[3b302b3c9093c22]::thread::Builder>::spawn_unchecked_<rustc_interface[550884b2b179878f]::util::run_in_thread_pool_with_globals<rustc_interface[550884b2b179878f]::interface::run_compiler<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}>::{closure#0}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>::{closure#0}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>::{closure#1} as core[a3420257622cd381]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  46:     0x7f112f41cbf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha99802c2c52ada61
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/boxed.rs:1861:9
  47:     0x7f112f41cbf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha39aea1c57e28a15
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/boxed.rs:1861:9
  48:     0x7f112f41cbf3 - std::sys::unix::thread::Thread::new::thread_start::h9f8e3d72b1f7662f
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys/unix/thread.rs:108:17
  49:     0x7f112f30d609 - start_thread
                               at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
  50:     0x7f112f0e1133 - clone
                               at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  51:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: 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.61.0 (fe5b13d68 2022-05-18) 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:
end of query stack
{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_1","message":null,"percentage":null,"title":"Building"}}

@deputinizer deputinizer 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 Jun 3, 2022
@deputinizer deputinizer changed the title ICE rustc_save_analysis::SaveContext::get_expr_data ICE RLS rustc_save_analysis::SaveContext::get_expr_data Jun 3, 2022
@matthiaskrgr
Copy link
Member

#88536 has a similar ice message but not sure how related that is.

@jyn514 jyn514 added the A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. label Feb 19, 2023
@jyn514
Copy link
Member

jyn514 commented Feb 19, 2023

Save-analysis has been removed from the compiler.

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. 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

3 participants