zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
48.71k stars 2.92k forks source link

Crash when opening a certain project (directory) #19492

Open erik-balfe opened 2 days ago

erik-balfe commented 2 days ago

Check for Existing Issues

Bug Description

Zed IDE crashes when opening certain projects or when launching it with the last opened project. This results in a recurring crash on startup since the last project is automatically loaded. To circumvent this issue, I must start Zed in a different directory that is not associated with the problematic project, e.g., zed /some/another/path.

Environment

Zed: v0.157.5 (Zed) OS: Linux Wayland bluefin 40 Memory: 31 GiB Architecture: x86_64 GPU: Intel(R) Xe Graphics (TGL GT2) || Intel open-source Mesa driver || Mesa 24.1.6

Log File

The relevant error that likely leads to the crash is as follows:

Error that i suppose crashes the program ``` 2024-10-20T18:28:20.58325496+04:00 [ERROR] { "thread": "main", "payload": "`at` split index (is 4) should be <= len (is 1)", "location_data": { "file": "/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/vec/mod.rs", "line": 2319 }, "backtrace": [ "core::panicking::panic_fmt", "alloc::vec::Vec::split_off::assert_failed", "workspace::pane::Pane::render_tab_bar", "::render", "gpui::view::any_view::render", "::prepaint::{{closure}}", "::prepaint", " as gpui::element::ElementObject>::prepaint", "gpui::element::AnyElement::prepaint", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}", "::prepaint", " as gpui::element::ElementObject>::prepaint", "gpui::element::AnyElement::prepaint", " as gpui::element::ElementObject>::prepaint", "gpui::element::AnyElement::prepaint", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}", "::prepaint", " as gpui::element::ElementObject>::prepaint", "gpui::element::AnyElement::prepaint", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}", "::prepaint", " as gpui::element::ElementObject>::prepaint", "gpui::element::AnyElement::prepaint", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}", "::prepaint", " as gpui::element::ElementObject>::prepaint", "gpui::element::AnyElement::prepaint", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}", "::prepaint", " as gpui::element::ElementObject>::prepaint", "gpui::element::AnyElement::prepaint", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}", "::prepaint", " as gpui::element::ElementObject>::prepaint", "gpui::element::AnyElement::prepaint", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}", "::prepaint", " as gpui::element::ElementObject>::prepaint", "gpui::element::AnyElement::prepaint", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}::{{closure}}", "gpui::elements::div::Interactivity::prepaint::{{closure}}", "::prepaint", " as gpui::element::ElementObject>::prepaint", "gpui::element::AnyElement::prepaint", "::prepaint", " as gpui::element::ElementObject>::prepaint", "gpui::element::AnyElement::prepaint", "gpui::window::WindowContext::draw", "gpui::window::WindowContext::dispatch_event", "gpui::window::Window::new::{{closure}}", "gpui::platform::linux::wayland::window::WaylandWindowStatePtr::handle_input", ">::event", "wayland_client::event_queue::queue_callback", "> as calloop::sources::EventDispatcher>::process_events", "::run", "gpui::platform::linux::platform::::run", "gpui::app::App::run", "zed::main", "std::sys::backtrace::__rust_begin_short_backtrace", "std::rt::lang_start::{{closure}}", "std::rt::lang_start_internal", "main", "__libc_start_call_main", "__libc_start_main@@GLIBC_2.34", "_start" ], "app_version": "0.157.5", "release_channel": "Zed", "os_name": "Linux Wayland", "os_version": "bluefin 40", "architecture": "x86_64", "panicked_on": 1729434500583, "system_id": "3acdd293-70c0-4183-a519-6b76539d16d4", "installation_id": "4bc8b480-c404-4042-9edf-81061d7796e9", "session_id": "1b8ac22c-5a9b-403a-9dd8-5050ad674ecb" } } ```

Complete log including the error: Zed.log

CharlesChen0823 commented 2 days ago

this should be an bug in pin_tab feature, hit here

        let unpinned_tabs = tab_items.split_off(self.pinned_tab_count);

you can open recent project, then delete the project which cause crashed. then open the project should normally.

erik-balfe commented 2 days ago

That helped, thanks @CharlesChen0823. If the bug is still not fixed, I can provide a few more details: I had several pinned tabs in the project, including the terminal pane along with the usual editor tabs.

DeveloperPaul123 commented 49 minutes ago

I'm also facing this bug or something similar?

[2024-10-23T09:32:59-04:00 ERROR fs.rs] Error { kind: Generic("Input watch path is neither a file nor a directory."), paths: [] } [2024-10-23T09:32:59-04:00 ERROR blade_graphics::hal::init] No composite alpha flag for transparency: OPAQUE [2024-10-23T09:32:59-04:00 ERROR blade_graphics::hal::init] No composite alpha flag for transparency: OPAQUE [2024-10-23T09:32:59-04:00 ERROR blade_graphics::hal::init] No composite alpha flag for transparency: OPAQUE [2024-10-23T09:32:59-04:00 ERROR fs.rs] Error { kind: Generic("Input watch path is neither a file nor a directory."), paths: [] } [2024-10-23T09:32:59-04:00 ERROR auto_update] auto-update failed: error:failed to fetch release: "invalid os and arch parameters" [2024-10-23T09:32:59-04:00 ERROR] Error { code: HRESULT(0x80070057), message: "The parameter is incorrect." } [2024-10-23T09:32:59-04:00 ERROR] Error { code: HRESULT(0x80070057), message: "The parameter is incorrect." } [2024-10-23T09:32:59-04:00 ERROR] no worktrees when constructing LocalLspAdapterDelegate

This is on Windows.

CharlesChen0823 commented 45 minutes ago

this is not crash report, could you enable RUST_LOG=debug, then paste the log