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

RA started to crash on non-utf8 files in the repository #16914

Closed
Kimundi opened this issue Mar 21, 2024 · 1 comment · Fixed by #16918
Closed

RA started to crash on non-utf8 files in the repository #16914

Kimundi opened this issue Mar 21, 2024 · 1 comment · Fixed by #16918
Labels
C-bug Category: bug

Comments

@Kimundi
Copy link
Member

Kimundi commented Mar 21, 2024

I have a few test files in a git repository that do contain non-utf8 characters in their name s(specifically, a single 0xff byte).

This was not an issue until recently (a few weeks back? Not sure exactly when this happened), but with current RA versions I've started to get crashes because of this.

This is inside a WSL on a ext4 filesystem, so standard Linux filesystem semantic of filenames.

rust-analyzer version: rust-analyzer version: 0.4.1889-standalone (5e276ae51 2024-03-20)

rustc version: rustc 1.77.0 (aedd173a2 2024-03-17)

relevant settings: none that I'm aware of

repository link: https://github.com/Kimundi/ra_bug_2024_non_utf8

RA error log

thread 'VfsLoader' panicked at crates/vfs-notify/src/lib.rs:217:80:
called `Result::unwrap()` on an `Err` value: "/home/kimundi/experiment/ra_bug_2024_non_utf8/tests/special_files/a\xFFz.txt"
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/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/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/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.
thread '<unnamed>' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsp-server-0.7.6/src/stdio.rs:28:37:
receiver was dropped, failed to send a message: "SendError(..)"
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jod-thread-0.1.2/src/lib.rs:33:22:
called `Result::unwrap()` on an `Err` value: Any { .. }
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
   3: stdx::thread::JoinHandle<T>::join
   4: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Info  - 9:12:14 PM] Connection to server got closed. Server will restart.

[...]
@Kimundi Kimundi added the C-bug Category: bug label Mar 21, 2024
@Veykril
Copy link
Member

Veykril commented Mar 21, 2024

I switched our path stuff to utf8 paths intentionally to simplify things but I guess we should at least filter those out instead of unwrapping 🙃 Although I am very confused as to why r-a event attempts to load a txt file for you here It happens in the filter step nvm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants