rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.62k stars 1.49k forks source link

thread 'VfsLoader' panicked at crates/vfs-notify/src/lib.rs:225:80 #17158

Closed bjorn3 closed 2 weeks ago

bjorn3 commented 2 weeks ago

rust-analyzer version: rust-analyzer version: 0.4.1938-standalone (f216be4a0 2024-04-27)

rustc version: rustc 1.79.0-nightly (aed2187d5 2024-04-27)

editor or extension: VSCode

relevant settings: None

reproducer: I think cloning the rust repo and running ./x.py test tests/run-make once is enough to get into a state where this crash happens.

thread 'VfsLoader' panicked at crates/vfs-notify/src/lib.rs:225:80:
called `Result::unwrap()` on an `Err` value: "/home/gh-bjorn3/cg_clif/rust/build/aarch64-unknown-linux-gnu/test/run-make/non-unicode-in-incremental-dir/non-unicode-in-incremental-dir/\xFF"
stack backtrace:
   0: rust_begin_unwind
             at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:647:5
   1: core::panicking::panic_fmt
             at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/result.rs:1649:5
   3: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
   4: <alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<T,I>>::spec_extend
   5: vfs_notify::NotifyActor::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'LspServer' panicked at crates/rust-analyzer/src/main_loop.rs:219:38:
called `Result::unwrap()` on an `Err` value: RecvError
stack backtrace:
   0: rust_begin_unwind
             at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:647:5
   1: core::panicking::panic_fmt
             at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/result.rs:1649:5
   3: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   4: rust_analyzer::main_loop::main_loop
   5: rust_analyzer::run_server
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Veykril commented 2 weeks ago

That's https://github.com/rust-lang/rust-analyzer/blob/c973701a3d572e6646720b954e4e14388b665b3e/crates/vfs-notify/src/lib.rs#L225 whichit panics because the path isn't utf8, should probably just discard instead of unwrapping here