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

Zed crashes on large search results #26230

Open
LouisBrunner opened this issue Mar 6, 2025 · 3 comments
Open

Zed crashes on large search results #26230

LouisBrunner opened this issue Mar 6, 2025 · 3 comments
Labels
needs-repro Needs reproduction steps / someone to reproduce

Comments

@LouisBrunner
Copy link
Contributor

Summary

Zed shows the result for a fraction of a second before crashing when opening a large search result.

Steps to trigger the problem:

  1. git clone https://github.com/LouisBrunner/valgrind-macos
  2. Open the repo in Zed
  3. Search for x86
  4. Zed crashes

Actual Behavior:

Zed shows the result for a fraction of a second before crashing when opening a large search result.

Expected Behavior:

Zed doesn't crash.

Stdout:

[2025-03-06T17:57:51+00:00 INFO  language::syntax_map] create layer. language:C++, range:(1514, 32)..(1514, 61), included_ranges:[(0, 0)..(0, 29)]
[2025-03-06T17:57:51+00:00 INFO  language::syntax_map] create layer. language:C++, range:(1516, 32)..(1516, 52), included_ranges:[(0, 0)..(0, 20)]
[2025-03-06T17:57:51+00:00 INFO  language::syntax_map] create layer. language:C++, range:(1518, 32)..(1518, 61), included_ranges:[(0, 0)..(0, 29)]
Assertion failed: (length <= 1024), function ts_parser__external_scanner_serialize, file parser.c, line 410.
[2025-03-06T17:57:51+00:00 INFO  language::syntax_map] create layer. language:C++, range:(1520, 32)..(1520, 61), included_ranges:[(0, 0)..(0, 29)]

macOS Problem Reporter:

Thread 41 Crashed::  Dispatch queue: com.apple.root.user-initiated-qos
0   libsystem_kernel.dylib        	       0x19fc66600 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x19fc9ef70 pthread_kill + 288
2   libsystem_c.dylib             	       0x19fbab908 abort + 128
3   libsystem_c.dylib             	       0x19fbaac1c __assert_rtn + 284
4   zed                           	       0x10ce4e870 ts_parser__external_scanner_serialize + 176
5   zed                           	       0x10ce4b568 ts_parser__lex + 704
6   zed                           	       0x10ce305d0 ts_parser__advance + 348
7   zed                           	       0x10ce2f960 ts_parser_parse + 1592
8   zed                           	       0x10ce322cc ts_parser_parse_with_options + 96
9   zed                           	       0x10c5b55dc tree_sitter::Parser::parse_with_options::h791812ce47038193 + 440
10  zed                           	       0x10c5e14b0 language::syntax_map::parse_text::_$u7b$$u7b$closure$u7d$$u7d$::h518aaa759a1d2206 + 480
11  zed                           	       0x10c5e1c1c language::with_parser::h44d0470d80e6fe06 + 444
12  zed                           	       0x10c6c3688 language::syntax_map::parse_text::h84ae92f59c94cab7 + 80
13  zed                           	       0x10c6c19c4 language::syntax_map::SyntaxSnapshot::reparse_with_ranges::h00d7074fa2daac50 + 8504
14  zed                           	       0x10c6bf410 language::syntax_map::SyntaxSnapshot::reparse::h4cddc9c093d4f55f + 344
15  zed                           	       0x10c67acbc language::buffer::Buffer::reparse::_$u7b$$u7b$closure$u7d$$u7d$::hed7deb56172be66b + 100
16  zed                           	       0x10c703164 _$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$core..future..future..Future$GT$::poll::heb2066135e7eb468 + 80
17  zed                           	       0x10c6a728c async_task::raw::RawTask$LT$F$C$T$C$S$C$M$GT$::run::h93750fb45920167b + 580
18  zed                           	       0x10e5d2e00 async_task::runnable::Runnable$LT$M$GT$::run::h9fb03ca3e4adc097 + 120
19  zed                           	       0x10dfb83a8 gpui::platform::mac::dispatcher::trampoline::hf242971430d2256e + 68
20  libdispatch.dylib             	       0x19faec658 _dispatch_client_callout + 20
21  libdispatch.dylib             	       0x19fafe4e8 _dispatch_root_queue_drain + 860
22  libdispatch.dylib             	       0x19fafeb20 _dispatch_worker_thread2 + 156
23  libsystem_pthread.dylib       	       0x19fc9b39c _pthread_wqthread + 228
24  libsystem_pthread.dylib       	       0x19fc9a0f0 start_wqthread + 8

Zed Version and System Specs

Zed: v0.176.2 (Zed)
OS: macOS 15.1.1
Memory: 16 GiB
Architecture: aarch64

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@notpeter
Copy link
Member

notpeter commented Mar 6, 2025

I cannot reproduce. I was able to clone, search for x86 and navigate the multibuffer with 8130 results without incident.

Do you have any Zed Extensions installed or other relevant settings (languages, etc) which might be impacting this? Can you try removing your Zed Extensions and seeing if it still crashes? And if not, install them back one by one to come up with reproduction steps? If that doesn't work can you backup your Zed settings and try with an empty settings.json {} in case that helps?

@notpeter notpeter added the needs-repro Needs reproduction steps / someone to reproduce label Mar 6, 2025
@LouisBrunner
Copy link
Contributor Author

I have a bunch of extensions, I tried uninstalling them one-by-one, starting with C# and it stopped crashing right away. After reinstalling it, it is still not crashing.

So I cannot reproduce it anymore either.

@0x2CA
Copy link
Contributor

0x2CA commented Mar 7, 2025

In today's day I also suddenly crashed at the zed project, and I think the language extensions may have crashed zed

Zed output
[2025-03-07T16:01:55+08:00 ERROR languages::rust] failed to run rust-analyzer after detecting it in PATH: binary: "/Users/0x2ca/.asdf/shims/rust-analyzer": exit status: 1, stdout: "", stderr: "error: Unknown binary 'rust-analyzer' in official toolchain '1.85-aarch64-apple-darwin'.\n"
Thread "main" panicked with "assertion `left == right` failed: cannot call defer_draw during deferred drawing\n  left: 1\n right: 0" at crates/gpui/src/window.rs:1766:9
https://github.com/zed-industries/zed/blob/b0d1024f669dde9fa94d1ca317890d2ac45c68d2/src/crates/gpui/src/window.rs#L1766 (may not be uploaded, line may be incorrect if files modified)
   0: backtrace::backtrace::libunwind::trace
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/registry/src/index.crates.io-1949cf8c6b5b557f/backtrace-0.3.74/src/backtrace/libunwind.rs:116:5
      backtrace::backtrace::trace_unsynchronized
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/registry/src/index.crates.io-1949cf8c6b5b557f/backtrace-0.3.74/src/backtrace/mod.rs:66:5
   1: backtrace::backtrace::trace
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/registry/src/index.crates.io-1949cf8c6b5b557f/backtrace-0.3.74/src/backtrace/mod.rs:53:14
   2: backtrace::capture::Backtrace::create
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/registry/src/index.crates.io-1949cf8c6b5b557f/backtrace-0.3.74/src/capture.rs:292:9
   3: backtrace::capture::Backtrace::new
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/registry/src/index.crates.io-1949cf8c6b5b557f/backtrace-0.3.74/src/capture.rs:257:22
   4: zed::reliability::init_panic_hook::{{closure}}
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/zed/src/reliability.rs:56:29
   5: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/alloc/src/boxed.rs:2007:9
      std::panicking::rust_panic_with_hook
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:836:13
   6: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:701:13
   7: std::sys::backtrace::__rust_end_short_backtrace
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/sys/backtrace.rs:168:18
   8: rust_begin_unwind
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:692:5
   9: core::panicking::panic_fmt
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:75:14
  10: core::panicking::assert_failed_inner
  11: core::panicking::assert_failed
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:364:5
  12: gpui::window::Window::prepaint_deferred_draws
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/window.rs:1766:9
  13: gpui::window::Window::draw_roots
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/window.rs:1633:9
  14: gpui::window::Window::draw
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/window.rs:1529:9
  15: gpui::window::Window::new::{{closure}}::{{closure}}::{{closure}}
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/window.rs:801:33
  16: gpui::app::App::update_window_id::{{closure}}
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/app.rs:1008:26
  17: gpui::app::App::update
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/app.rs:422:22
  18: gpui::app::App::update_window_id
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/app.rs:997:9
  19: <gpui::app::App as gpui::AppContext>::update_window
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/app.rs:1674:9
  20: <gpui::app::async_context::AsyncApp as gpui::AppContext>::update_window
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/app/async_context.rs:92:9
  21: gpui::window::AnyWindowHandle::update
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/window.rs:3946:9
  22: gpui::window::Window::new::{{closure}}::{{closure}}
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/window.rs:799:25
  23: util::measure
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/util/src/util.rs:386:9
  24: gpui::window::Window::new::{{closure}}
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/window.rs:798:21
  25: <alloc::boxed::Box<F,A> as core::ops::function::FnMut<Args>>::call_mut
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/toolchains/1.85-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2000:9
  26: gpui::platform::mac::window::step
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/platform/mac/window.rs:1657:9
  27: <unknown>
  28: <unknown>
  29: <unknown>
  30: <unknown>
  31: <unknown>
  32: <unknown>
  33: <unknown>
  34: <unknown>
  35: <unknown>
  36: <unknown>
  37: <unknown>
  38: <unknown>
  39: <unknown>
  40: <unknown>
  41: <unknown>
  42: <() as objc::message::MessageArguments>::invoke
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/registry/src/index.crates.io-1949cf8c6b5b557f/objc-0.2.7/src/message/mod.rs:128:17
  43: objc::message::platform::send_unverified
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/registry/src/index.crates.io-1949cf8c6b5b557f/objc-0.2.7/src/message/apple/mod.rs:27:9
  44: objc::message::send_message
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/registry/src/index.crates.io-1949cf8c6b5b557f/objc-0.2.7/src/message/mod.rs:178:5
      <*mut objc::runtime::Object as cocoa::appkit::NSApplication>::run
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/registry/src/index.crates.io-1949cf8c6b5b557f/cocoa-0.26.0/src/appkit.rs:628:9
  45: <gpui::platform::mac::platform::MacPlatform as gpui::platform::Platform>::run
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/platform/mac/platform.rs:453:13
  46: gpui::app::Application::run
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/gpui/src/app.rs:164:9
  47: zed::main
             at /Users/0x2ca/WorkSpace/Rust/zed/crates/zed/src/main.rs:301:5
  48: core::ops::function::FnOnce::call_once
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/toolchains/1.85-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
  49: std::sys::backtrace::__rust_begin_short_backtrace
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/toolchains/1.85-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:152:18
  50: std::rt::lang_start::{{closure}}
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/toolchains/1.85-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/rt.rs:195:18
  51: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/ops/function.rs:284:13
      std::panicking::try::do_call
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:584:40
      std::panicking::try
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:547:19
      std::panic::catch_unwind
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panic.rs:358:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/rt.rs:174:48
      std::panicking::try::do_call
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:584:40
      std::panicking::try
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:547:19
      std::panic::catch_unwind
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panic.rs:358:14
      std::rt::lang_start_internal
             at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/rt.rs:174:20
  52: std::rt::lang_start
             at /Users/0x2ca/.asdf/installs/rust/1.85.0/toolchains/1.85-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/rt.rs:194:17
  53: _main

I'm guessing it's because the internet downloaded half of the lsp, then zed ran it and it crashed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-repro Needs reproduction steps / someone to reproduce
Projects
None yet
Development

No branches or pull requests

3 participants