Skip to content

Inline Git blame annotations crashes Zed under certain repos #17155

@VernonGrant

Description

@VernonGrant

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

I opened a local project and Zed immediately crashed, I tried opening the project multiple times but it keeps crashing.

I did the following, that leads me to believe it's related to the inline Git blame annotations:

  • I looked at the Zed log file and saw a couple GitRepository entires in the backtrace property of the error object.
  • I decided to just delete the .git folder inside of my project, after which Zed opened the project without crashing.
  • I then restored the .git folder and Zed immediately crashed, as soon as I focused on the editor.
  • I then opened my Zed settings.json and set inline_blame to false. This time I opened the project without it crashing, but as soon as I set inline_blame to true, it crashed again.

I digged a bit deeper and found that the repository of the project I'm trying to open has a remote origin, but no path URL (Not sure why or how, but ok).

For example:

  • Running git remote gives me origin
  • Running git remote show origin gives me fatal: no path specified; see 'git help pull' for valid url syntax
  • Running git remote -v gives me:
origin	 (fetch)
origin	 (push)

I'm going to guess that the repo's bad remote origin is causing Zed to crash.

Environment

Zed: v0.150.4 (Zed)
OS: macOS 14.6.1
Memory: 16 GiB
Architecture: aarch64

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

Zed.log
2024-08-30T11:49:47.006054Z [ERROR] {
  "thread": "",
  "payload": "called `Option::unwrap()` on a `None` value",
  "location_data": {
    "file": "/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/git2-0.19.0/src/remote.rs",
    "line": 150
  },
  "backtrace": [
    "::create",
    "::new",
    "zed::reliability::init_panic_hook::{closure#0}",
    "std::panicking::rust_panic_with_hook",
    "std::panicking::begin_panic_handler::{{closure}}",
    "std::sys_common::backtrace::__rust_end_short_backtrace",
    "_rust_begin_unwind",
    "core::panicking::panic_fmt",
    "core::panicking::panic",
    "core::option::unwrap_failed",
    "::remote_url",
    "::blame",
    "::blame_buffer::{closure#0}",
    "> + core::marker::Send>>, core::result::Result, ::spawn_internal>::{closure#0}, ()>>::run",
    "_pthread_mach_thread_np"
  ],
  "app_version": "0.150.4",
  "release_channel": "Zed",
  "os_name": "macOS",
  "os_version": "14.6.1",
  "architecture": "aarch64",
  "panicked_on": 1725018587006,
  "installation_id": "34df8b72-2251-44a6-8084-179a4a9d55f9",
  "session_id": "cacf79c7-276e-4e76-bf9f-f8a135f88b9d"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions