rust-lang / rust-lang/rust-analyzer

Panic on file save from helix

Open
#20,815 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-vfs C-bug I-panic
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

After updating to 1.90.0 (1159e78c 2025-09-14), rust-analyzer now panics on save from the helix text editor. I think this is a rust-analyzer to kqueue thing? I don't know. I think somebody called .unwrap() on None somewhere... This didn't occur in the previous version of rust-analyzer.

rustc --version
rustc 1.90.0 (1159e78c4 2025-09-14)
rust-analyzer --version
rust-analyzer 1.90.0 (1159e78c 2025-09-14)

Toolchain:

stable-x86_64-unknown-freebsd (active, default)

The trace that appears in the helix log file when starting helix with th -vv (double verbose) flag:

2025-10-08T16:11:13.223 helix_term::application [DEBUG] document Some("./src/main.rs") saved with revision 1
2025-10-08T16:11:13.223 helix_view::document [DEBUG] doc 2 revision updated 1 -> 1
2025-10-08T16:11:13.223 helix_lsp::file_event [DEBUG] Received file event for "./src/main.rs"
2025-10-08T16:11:13.223 helix_lsp::transport [INFO] rust-analyzer -> {"jsonrpc":"2.0","method":"textDocument/didSave","params":{"textDocument":{"uri":"file:///usr/home/<redacted>/src/main.rs"}}}
2025-10-08T16:11:13.223 helix_lsp::transport [ERROR] rust-analyzer err <- "\n"
2025-10-08T16:11:13.223 helix_view::editor [DEBUG] editor status: 'src/main.rs' written, 256L 7.5KiB
2025-10-08T16:11:13.223 helix_lsp::transport [ERROR] rust-analyzer err <- "thread 'notify-rs kqueue loop' panicked at /rust/deps/kqueue-1.1.1/src/lib.rs:661:86:\n"
2025-10-08T16:11:13.223 helix_lsp::transport [ERROR] rust-analyzer err <- "called `Option::unwrap()` on a `None` value\n"
2025-10-08T16:11:13.223 helix_lsp::transport [ERROR] rust-analyzer err <- "stack backtrace:\n"
2025-10-08T16:11:13.223 helix_view::document [DEBUG] id 2 modified - last saved: 1, current: 1
2025-10-08T16:11:13.224 helix_view::document [DEBUG] id 2 modified - last saved: 1, current: 1
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   0: __rustc::rust_begin_unwind\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "             at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs:697:5\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   1: core::panicking::panic_fmt\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "             at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/panicking.rs:75:14\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   2: core::panicking::panic\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "             at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/panicking.rs:145:5\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   3: core::option::unwrap_failed\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "             at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/option.rs:2130:5\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   4: <kqueue::Event>::new\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   5: <kqueue::Watcher>::poll\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   6: <notify::kqueue::EventLoop>::event_loop_thread\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "thread 'VfsLoader' panicked at src/tools/rust-analyzer/crates/vfs-notify/src/lib.rs:93:72:\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "called `Result::unwrap()` on an `Err` value: RecvError\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "stack backtrace:\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   0: __rustc::rust_begin_unwind\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "             at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs:697:5\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   1: core::panicking::panic_fmt\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "             at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/panicking.rs:75:14\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   2: core::result::unwrap_failed\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "             at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/result.rs:1765:5\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   3: <vfs_notify::NotifyActor>::run\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "thread 'VfsLoader' panicked at /rust/deps/notify-8.0.0/src/kqueue.rs:454:51:\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "called `Result::unwrap()` on an `Err` value: SendError { .. }\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "stack backtrace:\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   0:      0x1cbbfd38732 - std::backtrace_rs::backtrace::libunwind::trace::h26096fd07ff9cc89\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   1:      0x1cbbfd38732 - std::backtrace_rs::backtrace::trace_unsynchronized::hf86b6ec1f523b9b4\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   2:      0x1cbbfd38732 - std::sys::backtrace::_print_fmt::h45728bf87fd11340\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/sys/backtrace.rs:66:9\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   3:      0x1cbbfd38732 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h7c9cbdf02bb2e1b7\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/sys/backtrace.rs:39:26\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   4:      0x1cbbfd83e03 - core::fmt::rt::Argument::fmt::hedc100a2d4739be8\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/fmt/rt.rs:173:76\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "   5:      0x1cbbfd83e03 - core::fmt::write::h817f4f1848439eb3\n"
2025-10-08T16:11:13.259 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/fmt/mod.rs:1468:25\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "   6:      0x1cbbfd2d703 - std::io::default_write_fmt::heb93a1d0f8d59f14\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/io/mod.rs:639:11\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "   7:      0x1cbbfd2d703 - std::io::Write::write_fmt::h24993c1620618c82\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/io/mod.rs:1954:13\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "   8:      0x1cbbfd38582 - std::sys::backtrace::BacktraceLock::print::h3eef05bc61231a27\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/sys/backtrace.rs:42:9\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "   9:      0x1cbbfd3c179 - std::panicking::default_hook::{{closure}}::ha405eb770fc1eefa\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs:300:27\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  10:      0x1cbbfd3bf5b - std::panicking::default_hook::h884335182fbcdefd\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs:327:9\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  11:      0x1c394854222 - <base_db[4d5be0539356339c]::DbPanicContext>::enter::set_hook::{closure#0}\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  12:      0x1cbbfd3cc3e - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h6d251b0796e1693d\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/alloc/src/boxed.rs:1985:9\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  13:      0x1cbbfd3cc3e - std::panicking::rust_panic_with_hook::hd95979e0b546d02f\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs:841:13\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  14:      0x1cbbfd3c92a - std::panicking::begin_panic_handler::{{closure}}::hb9b547bda4a116ee\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs:706:13\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  15:      0x1cbbfd38c39 - std::sys::backtrace::__rust_end_short_backtrace::h53e9b29e1d79cf30\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/sys/backtrace.rs:174:18\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  16:      0x1cbbfd3c5bd - __rustc[de2ca18b4c54d5b8]::rust_begin_unwind\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs:697:5\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  17:      0x1cbb92168a0 - core::panicking::panic_fmt::h40191d3ad235d4be\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/panicking.rs:75:14\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  18:      0x1cbb9216e36 - core::result::unwrap_failed::h6a27373538489c22\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/result.rs:1765:5\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  19:      0x1c3936a8630 - <notify[9317c645f9b1353f]::kqueue::KqueueWatcher as core[1844df0e6a7872ab]::ops::drop::Drop>::drop\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  20:      0x1c39367b627 - core[1844df0e6a7872ab]::ptr::drop_in_place::<core[1844df0e6a7872ab]::option::Option<(notify[9317c645f9b1353f]::kqueue::KqueueWatcher, crossbeam_channel[75b8ab8498c2a565]::channel::Receiver<core[1844df0e6a7872ab]::result::Result<notify_types[1924f33f0f1f26b7]::event::Event, notify[9317c645f9b1353f]::error::Error>>)>>\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  21:      0x1c39368043d - <vfs_notify[879755db1592f639]::NotifyActor>::run\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  22:      0x1c3936847d1 - std[c65862411a34f917]::sys::backtrace::__rust_begin_short_backtrace::<<stdx[159ecc9f681aaf82]::thread::Builder>::spawn<<vfs_notify[879755db1592f639]::NotifyHandle as vfs[c1fac3d79fe124a3]::loader::Handle>::spawn::{closure#0}, ()>::{closure#0}, ()>\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  23:      0x1c393687ca5 - <<std[c65862411a34f917]::thread::Builder>::spawn_unchecked_<<stdx[159ecc9f681aaf82]::thread::Builder>::spawn<<vfs_notify[879755db1592f639]::NotifyHandle as vfs[c1fac3d79fe124a3]::loader::Handle>::spawn::{closure#0}, ()>::{closure#0}, ()>::{closure#1} as core[1844df0e6a7872ab]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  24:      0x1cbbfd402af - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h92216d430ee7df04\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/alloc/src/boxed.rs:1971:9\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  25:      0x1cbbfd402af - std::sys::pal::unix::thread::Thread::new::thread_start::hf6e4ba5ac025e39f\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "                               at /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/sys/pal/unix/thread.rs:107:17\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "  26:      0x1cbb78f2b52 - <unknown>\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "thread 'VfsLoader' panicked at library/core/src/panicking.rs:233:5:\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "panic in a destructor during cleanup\n"
2025-10-08T16:11:13.260 helix_lsp::transport [ERROR] rust-analyzer err <- "thread caused non-unwinding panic. aborting.\n"
2025-10-08T16:11:14.011 helix_view::document [DEBUG] id 2 modified - last saved: 1, current: 1
2025-10-08T16:11:14.011 helix_view::document [DEBUG] id 2 modified - last saved: 1, current: 1
2025-10-08T16:11:14.177 helix_view::document [DEBUG] id 2 modified - last saved: 1, current: 1
2025-10-08T16:11:14.178 helix_view::document [DEBUG] id 2 modified - last saved: 1, current: 1
2025-10-08T16:11:14.430 helix_term::application [DEBUG] received editor event: IdleTimer
2025-10-08T16:11:14.520 helix_term::application [DEBUG] received editor event: LanguageServerMessage((LanguageServerId(1v1), Notification(Notification { jsonrpc: None, method: "exit", params: None })))
2025-10-08T16:11:14.520 helix_view::editor [DEBUG] editor status: Language server exited
2025-10-08T16:11:14.520 helix_lsp::file_event [DEBUG] Removing LSP client: 1v1
2025-10-08T16:11:14.520 helix_lsp::transport [ERROR] rust-analyzer err: <- StreamClosed
2025-10-08T16:11:14.556 helix_term::application [DEBUG] received editor event: Redraw
2025-10-08T16:11:14.556 helix_view::document [DEBUG] id 2 modified - last saved: 1, current: 1
2025-10-08T16:11:14.557 helix_view::document [DEBUG] id 2 modified - last saved: 1, current: 1

Good luck! Let me know if there's any other data I can provide.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the panic locations named in crates/vfs-notify/src/lib.rs:93, notify-8.0.0/src/kqueue.rs:454, and kqueue-1.1.1/src/lib.rs:661. Reproduce a save from Helix on the stable FreeBSD toolchain and compare behavior with the previous rust-analyzer version. Done means saving no longer panics the kqueue watcher or VfsLoader.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.