Closed jplatte closed 4 months ago
Hmm, is this reproducible?
I've tried, but haven't been able to make it happen another time.
Could it be related to the other issue (failed macro expansion)?
I think no, I actually managed to get the failed macro expansion in the logs a lot of additional times after cargo clean
but the empty ItemTree panic never re-appeared. I also re-triggered another error that came before this one (from cmake
not being installed, which was needed for a dependency's build script) but that also didn't trigger the empty ItemTree panic.
I can't really imagine that it would be related. But then again, this panic should be impossible by construction.
Same issue in the latest release (2021/09/20)
version: f1d7f98ed 2021-09-20 stable
request: textDocument/hover HoverParams {
text_document: TextDocumentIdentifier {
uri: Url {
scheme: "file",
cannot_be_a_base: false,
username: "",
password: None,
host: None,
port: None,
path: "/e%3A/workspace/browserhopper/src/main.rs",
query: None,
fragment: None,
},
},
position: Position(
Position {
line: 169,
character: 27,
},
),
work_done_progress_params: WorkDoneProgressParams {
work_done_token: None,
},
}
thread '<unnamed>' panicked at 'attempted to access data of empty ItemTree', crates\hir_def\src\item_tree.rs:247:28
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 下午4:45:39] Request textDocument/hover failed.
Message: server panicked: attempted to access data of empty ItemTree
Code: -32603
Might have the same root cause as https://github.com/rust-analyzer/rust-analyzer/issues/10084
@jonas-schievink Yes, I have both issues. They happen every minutes on my machine:( It's really annonying, glad to provide more logs if necessary.
https://github.com/rust-analyzer/rust-analyzer/pull/10479 should fix this. Please let us know if you're still seeing this after that PR.
Just got an error like this one but I can't reproduce it now.
@jonas-schievink Do you think this is the same error?
Vscode with rust-analyzer 0.3.1203-standalone
[ERROR hir_expand::proc_macro] Non-dummy expander even though there are no proc macros
Panic context:
>
version: 0.3.1203-standalone
request: textDocument/codeAction CodeActionParams {
text_document: TextDocumentIdentifier {
uri: Url {
scheme: "file",
cannot_be_a_base: false,
username: "",
password: None,
host: None,
port: None,
path: "/mnt/data/Repos/nand2tetris/jack-compiler/src/tokenizer.rs",
query: None,
fragment: None,
},
},
range: Range {
start: Position {
line: 0,
character: 0,
},
end: Position {
line: 0,
character: 0,
},
},
context: CodeActionContext {
diagnostics: [],
only: None,
},
work_done_progress_params: WorkDoneProgressParams {
work_done_token: None,
},
partial_result_params: PartialResultParams {
partial_result_token: None,
},
}
thread 'Worker' panicked at 'attempted to access data of empty ItemTree', crates/hir-def/src/item_tree.rs:171:28
stack backtrace:
0: rust_begin_unwind
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14
2: core::panicking::panic_display
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:72:5
3: core::panicking::panic_str
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:56:5
4: core::option::expect_failed
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/option.rs:1874:5
5: hir_def::data::ImplData::impl_data_with_diagnostics_query
6: salsa::runtime::Runtime::execute_query_implementation
7: salsa::derived::slot::Slot<Q,MP>::read_upgrade
8: salsa::derived::slot::Slot<Q,MP>::maybe_changed_since
9: hir_def::db::DefDatabaseGroupStorage__::maybe_changed_since
10: salsa::derived::slot::MemoRevisions::validate_memoized_value
11: salsa::derived::slot::Slot<Q,MP>::read_upgrade
12: salsa::derived::slot::Slot<Q,MP>::maybe_changed_since
13: hir_def::db::DefDatabaseGroupStorage__::maybe_changed_since
14: salsa::derived::slot::MemoRevisions::validate_memoized_value
15: salsa::derived::slot::Slot<Q,MP>::read_upgrade
16: salsa::derived::slot::Slot<Q,MP>::maybe_changed_since
17: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::maybe_changed_since
18: salsa::derived::slot::MemoRevisions::validate_memoized_value
19: salsa::derived::slot::Slot<Q,MP>::read_upgrade
20: salsa::derived::slot::Slot<Q,MP>::read
21: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
22: <DB as hir_ty::db::HirDatabase>::trait_impls_in_crate::__shim
23: <hir_ty::db::TraitImplsInDepsQuery as salsa::plumbing::QueryFunction>::execute
24: salsa::runtime::Runtime::execute_query_implementation
25: salsa::derived::slot::Slot<Q,MP>::read_upgrade
26: salsa::derived::slot::Slot<Q,MP>::read
27: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
28: <DB as hir_ty::db::HirDatabase>::trait_impls_in_deps::__shim
29: hir_ty::chalk_db::<impl chalk_solve::RustIrDatabase<hir_ty::interner::Interner> for hir_ty::traits::ChalkContext>::impls_for_trait
30: chalk_recursive::solve::SolveIteration::solve_iteration
31: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
32: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_root_goal
33: <hir_ty::db::TraitSolveQueryQuery as salsa::plumbing::QueryFunction>::execute
34: salsa::runtime::Runtime::execute_query_implementation
35: salsa::derived::slot::Slot<Q,MP>::read_upgrade
36: salsa::derived::slot::Slot<Q,MP>::read
37: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
38: salsa::QueryTable<Q>::get
39: <DB as hir_ty::db::HirDatabase>::trait_solve_query
40: hir_ty::db::trait_solve_wait
41: <DB as hir_ty::db::HirDatabase>::trait_solve
42: hir_ty::infer::coerce::<impl hir_ty::infer::unify::InferenceTable>::coerce_inner
43: hir_ty::infer::coerce::<impl hir_ty::infer::unify::InferenceTable>::coerce
44: hir_ty::infer::coerce::<impl hir_ty::infer::InferenceContext>::coerce
45: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
46: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
47: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
48: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_block
49: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
50: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
51: hir_ty::infer::infer_query
52: salsa::runtime::Runtime::execute_query_implementation
53: salsa::derived::slot::Slot<Q,MP>::read_upgrade
54: salsa::derived::slot::Slot<Q,MP>::read
55: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
56: salsa::QueryTable<Q>::get
57: <DB as hir_ty::db::HirDatabase>::infer_query
58: hir_ty::db::infer_wait
59: hir::DefWithBody::diagnostics
60: hir::Module::diagnostics
61: ide_diagnostics::diagnostics
62: std::panicking::try
63: ide::Analysis::assists_with_fixes
64: rust_analyzer::handlers::handle_code_action
65: std::panicking::try
66: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Panic context:
>
version: 0.3.1203-standalone
request: textDocument/semanticTokens/full/delta SemanticTokensDeltaParams {
work_done_progress_params: WorkDoneProgressParams {
work_done_token: None,
},
partial_result_params: PartialResultParams {
partial_result_token: None,
},
text_document: TextDocumentIdentifier {
uri: Url {
scheme: "file",
cannot_be_a_base: false,
username: "",
password: None,
host: None,
port: None,
path: "/mnt/data/Repos/nand2tetris/jack-compiler/src/cli.rs",
query: None,
fragment: None,
},
},
previous_result_id: "16526",
}
thread 'Worker' panicked at 'attempted to access data of empty ItemTree', crates/hir-def/src/item_tree.rs:171:28
stack backtrace:
0: rust_begin_unwind
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14
2: core::panicking::panic_display
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:72:5
3: core::panicking::panic_str
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:56:5
4: core::option::expect_failed
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/option.rs:1874:5
5: hir_def::data::ImplData::impl_data_with_diagnostics_query
6: salsa::runtime::Runtime::execute_query_implementation
7: salsa::derived::slot::Slot<Q,MP>::read_upgrade
8: salsa::derived::slot::Slot<Q,MP>::maybe_changed_since
9: hir_def::db::DefDatabaseGroupStorage__::maybe_changed_since
10: salsa::derived::slot::MemoRevisions::validate_memoized_value
11: salsa::derived::slot::Slot<Q,MP>::read_upgrade
12: salsa::derived::slot::Slot<Q,MP>::maybe_changed_since
13: hir_def::db::DefDatabaseGroupStorage__::maybe_changed_since
14: salsa::derived::slot::MemoRevisions::validate_memoized_value
15: salsa::derived::slot::Slot<Q,MP>::read_upgrade
16: salsa::derived::slot::Slot<Q,MP>::read
17: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
18: <DB as hir_ty::db::HirDatabase>::inherent_impls_in_crate::__shim
19: <hir_ty::db::InherentImplCratesQuery as salsa::plumbing::QueryFunction>::execute
20: salsa::runtime::Runtime::execute_query_implementation
21: salsa::derived::slot::Slot<Q,MP>::read_upgrade
22: salsa::derived::slot::Slot<Q,MP>::read
23: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
24: salsa::QueryTable<Q>::get
25: <DB as hir_ty::db::HirDatabase>::inherent_impl_crates
26: hir_ty::method_resolution::def_crates
27: hir_ty::method_resolution::iterate_inherent_methods
28: hir_ty::method_resolution::iterate_method_candidates_dyn
29: hir_ty::method_resolution::iterate_method_candidates
30: hir_ty::infer::path::<impl hir_ty::infer::InferenceContext>::resolve_ty_assoc_item
31: hir_ty::infer::path::<impl hir_ty::infer::InferenceContext>::infer_path
32: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
33: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr
34: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
35: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
36: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_block
37: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
38: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
39: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
40: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_block
41: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
42: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
43: hir_ty::infer::infer_query
44: salsa::runtime::Runtime::execute_query_implementation
45: salsa::derived::slot::Slot<Q,MP>::read_upgrade
46: salsa::derived::slot::Slot<Q,MP>::read
47: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
48: salsa::QueryTable<Q>::get
49: <DB as hir_ty::db::HirDatabase>::infer_query
50: hir_ty::db::infer_wait
51: hir::source_analyzer::SourceAnalyzer::new_for_body
52: hir::semantics::SemanticsImpl::analyze_impl
53: ide_db::defs::NameRefClass::classify
54: ide::syntax_highlighting::highlight::name_like
55: ide::syntax_highlighting::highlight
56: std::panicking::try
57: rust_analyzer::handlers::handle_semantic_tokens_full_delta
58: std::panicking::try
59: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 9:33:36 AM] Request textDocument/semanticTokens/full/delta failed.
Message: request handler panicked: attempted to access data of empty ItemTree
Code: -32603
Panic context:
>
version: 0.3.1203-standalone
request: codeLens/resolve CodeLens {
range: Range {
start: Position {
line: 15,
character: 9,
},
end: Position {
line: 15,
character: 21,
},
},
command: None,
data: Some(
Object({
"impls": Object({
"textDocument": Object({
"uri": String(
"file:///mnt/data/Repos/nand2tetris/jack-compiler/src/errors.rs",
),
}),
"position": Object({
"line": Number(
15,
),
"character": Number(
9,
),
}),
}),
}),
),
}
thread 'Worker' panicked at 'Bad offset: range 0..294 offset 303', /github/home/.cargo/registry/src/github.com-1ecc6299db9ec823/rowan-0.15.8/src/cursor.rs:751:9
stack backtrace:
0: rust_begin_unwind
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14
2: rowan::cursor::SyntaxNode::token_at_offset
3: ide::goto_implementation::goto_implementation
4: ide::annotations::resolve_annotation
5: std::panicking::try
6: rust_analyzer::handlers::handle_code_lens_resolve
7: std::panicking::try
8: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 1:59:30 PM] Request codeLens/resolve failed.
Message: request handler panicked: Bad offset: range 0..294 offset 303
Code: -32603
Yeah, https://github.com/rust-lang/rust-analyzer/pull/10479 didn't actually fix this or https://github.com/rust-lang/rust-analyzer/issues/10084
I had the same issue. Super simple project:
use bevy::prelude::*;
// use bevy_editor_pls::*;
#[derive(Component)]
struct Person;
#[derive(Component)]
struct Name(String);
fn add_people(mut commands: Commands) {
commands.spawn((Person, Name("Elaina Proctor".to_string())));
commands.spawn((Person, Name("Renzo Hume".to_string())));
commands.spawn((Person, Name("Zayna Nieves".to_string())));
}
#[derive(Resource)]
struct GreetTimer(Timer);
fn greet_people(
time: Res<Time>, mut timer: ResMut<GreetTimer>, query: Query<&Name, With<Person>>) {
// update our timer with the time elapsed since the last update
// if that caused the timer to finish, we say hello to everyone
if timer.0.tick(time.delta()).just_finished() {
for name in &query {
println!("hello {}!", name.0);
}
}
}
pub struct HelloPlugin;
impl Plugin for HelloPlugin {
fn build(&self, app: &mut App) {
app.insert_resource(GreetTimer(Timer::from_seconds(2.0, TimerMode::Repeating)))
.add_startup_system(add_people)
.add_system(greet_people);
}
}
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(bevy::diagnostic::FrameTimeDiagnosticsPlugin)
.add_plugin(bevy::diagnostic::EntityCountDiagnosticsPlugin)
.add_plugin(HelloPlugin)
.run();
}
Cargo.toml
[package]
name = "bevy_getting_started"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy = "0.10.1"
bevy-inspector-egui = "0.18.3"
bevy_editor_pls = "0.4.0"
[profile.dev.package."*"]
opt.level =3
At the same time I run some crypto tasks, so 4 of 8 threads were fully busy - and I got this error. When I completed with crypto task - error is gone. And this is tricky to reproduce again.
@volodalexey if you remember what you did or manage to reproduce it reproduce, please add a note. I couldn't either.
EDIT: also doesn't happen under the s-tui
stress test.
@volodalexey if you remember what you did or manage to reproduce it reproduce, please add a note. I couldn't either.
EDIT: also doesn't happen under the
s-tui
stress test.
No, I can not reproduce this anymore. Tried to start new project again. Added some cargo dependecies and started at the same time some crypto tasks...
I'll close this as there is no reproduction. Given that this should be in theory impossible I imagine this might just be the salsa bug that is plaguing as occasionally
While collecting data for #9162, I opened the RA language server logs in VSCodium and found the following error. It seems to be unrelated to #9162. I have no idea what caused it, but maybe it's useful to have it reported anyways: