zed icon indicating copy to clipboard operation
zed copied to clipboard

Crash with inline hint inside git ui diff viewer

Open max-frai opened this issue 6 months ago • 3 comments
trafficstars

Summary

I wrote some commit message, pressed Ctrl + Enter and it crashed.

Description

Steps to trigger the problem:

  1. List with git changes (all changes to all files single tab) was opened
  2. Entered commit message
  3. Ctrl + Enter

Macos report stack trace:

Thread 0 Crashed:: main Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	       0x18fecb720 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x18ff03f70 pthread_kill + 288
2   libsystem_c.dylib             	       0x18fe10908 abort + 128
3   zed                           	       0x10ab5500c std::sys::pal::unix::abort_internal::h21ffa6232271560a + 12
4   zed                           	       0x10ab54078 std::process::abort::hf7d59222751e82fe + 12
5   zed                           	       0x1097fa08c _RNCNvNtCsebPbyUhKQPs_3zed11reliability15init_panic_hook0B5_ + 2508
6   zed                           	       0x108463c70 std::panicking::rust_panic_with_hook::h1882a30575fbb763 + 604
7   zed                           	       0x108463864 std::panicking::begin_panic_handler::_$u7b$$u7b$closure$u7d$$u7d$::h39275ef3005e6337 + 144
8   zed                           	       0x1084620b8 std::sys::backtrace::__rust_end_short_backtrace::h6ede323c05a76849 + 12
9   zed                           	       0x10846352c _RNvCscSpY9Juk0HT_7___rustc17rust_begin_unwind + 32
10  zed                           	       0x10a9c4814 core::panicking::panic_fmt::h529fda7ea817ba4f + 32
11  zed                           	       0x104336a40 core::str::slice_error_fail_rt::h88ad3ed5401bd849 + 256
12  zed                           	       0x10a9c4c34 core::str::slice_error_fail::h1a6bc2122f7e64f9 + 12
13  zed                           	       0x1048b4bc8 _RINvMs4_Cs1GPY5b2Q2Oq_4ropeNtB6_6Cursor7summaryNtB6_11TextSummaryECsdWQBU7gzBL0_6editor + 1264
14  zed                           	       0x1048d4558 _RINvMsd_CscdkGIAaLIAA_12multi_bufferNtB6_19MultiBufferSnapshot37text_summary_for_excerpt_offset_rangeNtCs1GPY5b2Q2Oq_4rope11TextSummaryECsdWQBU7gzBL0_6editor + 548
15  zed                           	       0x1048d263c _RINvMsd_CscdkGIAaLIAA_12multi_bufferNtB6_19MultiBufferSnapshot22text_summary_for_rangeNtCs1GPY5b2Q2Oq_4rope11TextSummaryjECsdWQBU7gzBL0_6editor + 1824
16  zed                           	       0x104c0c370 _RNvMsg_NtNtCsdWQBU7gzBL0_6editor11display_map9inlay_mapNtB5_8InlayMap4sync + 1748
17  zed                           	       0x104c0d6d0 _RNvMsg_NtNtCsdWQBU7gzBL0_6editor11display_map9inlay_mapNtB5_8InlayMap6splice + 1420
18  zed                           	       0x104d7dc60 _RNvMsj_CsdWQBU7gzBL0_6editorNtB5_6Editor13splice_inlays + 1980
19  zed                           	       0x104d7a188 _RNvMsj_CsdWQBU7gzBL0_6editorNtB5_6Editor19refresh_inlay_hints + 1864
20  zed                           	       0x104a1a2f4 _RNCINvMs2_NtCsiEx1vqybs33_4gpui3appNtB8_3App16update_window_idbNCNCINvMNtB8_7contextINtB17_7ContextNtCsdWQBU7gzBL0_6editor6EditorE12subscribe_inNtCscdkGIAaLIAA_12multi_buffer11MultiBufferNtB2k_5EventNvMsj_B1B_B1z_15on_buffer_eventE00E0B1B_ + 4976
21  zed                           	       0x104a0cd6c _RNCINvMNtNtCsiEx1vqybs33_4gpui3app7contextINtB5_7ContextNtCsdWQBU7gzBL0_6editor6EditorE12subscribe_inNtCscdkGIAaLIAA_12multi_buffer11MultiBufferNtB1D_5EventNvMsj_BU_BS_15on_buffer_eventE0BU_ + 80
22  zed                           	       0x1059f47c8 _RNvMs2_NtCsiEx1vqybs33_4gpui3appNtB5_3App13flush_effects + 11744
23  zed                           	       0x10572c338 _RNCNvMNtCsf2CqHcMr0tt_6git_ui12project_diffNtB4_11ProjectDiff21handle_status_updates0B6_ + 964
24  zed                           	       0x1055c60c4 _RNC

Zed Version and System Specs

Zed Preview 0.188.0 219c7d5f83cce7252c45fed06a8e3144f410b18e

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

Zed.log
2025-05-21T22:52:01+02:00 INFO  [project.lsp_format] Formatting via LSP
2025-05-21T22:52:48+02:00 WARN  [project::lsp_store] Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 122, column: 17 }-PointUtf16 { row: 66, column: 0 }
2025-05-21T22:52:48+02:00 ERROR [editor::inlay_hint_cache] inlay hint update task for range failed: Error {
    context: "inlay hint fetch task",
    source: Error {
        context: "inlay hints LSP request",
        source: "Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 122, column: 17 }-PointUtf16 { row: 66, column: 0 }",
    },
}
2025-05-21T22:52:50+02:00 WARN  [project::lsp_store] Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 122, column: 17 }-PointUtf16 { row: 81, column: 0 }
2025-05-21T22:52:50+02:00 ERROR [editor::inlay_hint_cache] inlay hint update task for range failed: Error {
    context: "inlay hint fetch task",
    source: Error {
        context: "inlay hints LSP request",
        source: "Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 122, column: 17 }-PointUtf16 { row: 81, column: 0 }",
    },
}
2025-05-21T22:52:50+02:00 WARN  [project::lsp_store] Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 122, column: 17 }-PointUtf16 { row: 88, column: 0 }
2025-05-21T22:52:50+02:00 ERROR [editor::inlay_hint_cache] inlay hint update task for range failed: Error {
    context: "inlay hint fetch task",
    source: Error {
        context: "inlay hints LSP request",
        source: "Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 122, column: 17 }-PointUtf16 { row: 88, column: 0 }",
    },
}
2025-05-21T22:52:50+02:00 WARN  [project::lsp_store] Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 65, column: 0 }-PointUtf16 { row: 22, column: 23 }
2025-05-21T22:52:50+02:00 ERROR [editor::inlay_hint_cache] inlay hint update task for range failed: Error {
    context: "inlay hint fetch task",
    source: Error {
        context: "inlay hints LSP request",
        source: "Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 65, column: 0 }-PointUtf16 { row: 22, column: 23 }",
    },
}
2025-05-21T22:52:50+02:00 WARN  [project::lsp_store] Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 66, column: 0 }-PointUtf16 { row: 29, column: 13 }
2025-05-21T22:52:50+02:00 ERROR [editor::inlay_hint_cache] inlay hint update task for range failed: Error {
    context: "inlay hint fetch task",
    source: Error {
        context: "inlay hints LSP request",
        source: "Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 66, column: 0 }-PointUtf16 { row: 29, column: 13 }",
    },
}
2025-05-21T22:52:52+02:00 WARN  [project::lsp_store] Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 81, column: 0 }-PointUtf16 { row: 44, column: 19 }
2025-05-21T22:52:52+02:00 ERROR [editor::inlay_hint_cache] inlay hint update task for range failed: Error {
    context: "inlay hint fetch task",
    source: Error {
        context: "inlay hints LSP request",
        source: "Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 81, column: 0 }-PointUtf16 { row: 44, column: 19 }",
    },
}
2025-05-21T22:52:54+02:00 WARN  [project::lsp_store] Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 29, column: 13 }-PointUtf16 { row: 26, column: 22 }
2025-05-21T22:52:54+02:00 ERROR [editor::inlay_hint_cache] inlay hint update task for range failed: Error {
    context: "inlay hint fetch task",
    source: Error {
        context: "inlay hints LSP request",
        source: "Inlay hints via vtsls failed: Inverted range provided to an LSP request: PointUtf16 { row: 29, column: 13 }-PointUtf16 { row: 26, column: 22 }",
    },
}
2025-05-21T22:53:04+02:00 ERROR [zed::reliability] {
  "thread": "main",
  "payload": "byte index 55 is not a char boundary; it is inside 'і' (bytes 54..56) of `\n                                placeholder=\"Введіть текс`",
  "location_data": {
    "file": "/Users/administrator/actions-runner/_work/zed/zed/crates/rope/src/chunk.rs",
    "line": 158
  },
  "backtrace": [
    "<backtrace[e0035d54f06c1b55]::capture::Backtrace>::create+17483792",
    "<backtrace[e0035d54f06c1b55]::capture::Backtrace>::new+17483600",
    "zed[a549cc22f5ee3be8]::reliability::init_panic_hook::{closure#0}+114235624",
    "std::panicking::rust_panic_with_hook::h1882a30575fbb763+93699184",
    "std::panicking::begin_panic_handler::{{closure}}::h39275ef3005e6337+93698148",
    "std::sys::backtrace::__rust_end_short_backtrace::h6ede323c05a76849+93692088",
    "__rustc[95feac21a9532783]::rust_begin_unwind+93697324",
    "core::panicking::panic_fmt::h529fda7ea817ba4f+132892692",
    "core::str::slice_error_fail_rt::h88ad3ed5401bd849+25356864",
    "core::str::slice_error_fail::h1a6bc2122f7e64f9+132893748",
    "<rope[13b206762c3ca5a0]::Cursor>::summary::<rope[13b206762c3ca5a0]::TextSummary>+31116232",
    "<multi_buffer[8e46bf22c4328536]::MultiBufferSnapshot>::text_summary_for_excerpt_offset_range::<rope[13b206762c3ca5a0]::TextSummary>+31245656",
    "<multi_buffer[8e46bf22c4328536]::MultiBufferSnapshot>::text_summary_for_range::<rope[13b206762c3ca5a0]::TextSummary, usize>+31237692",
    "<editor[a27980758befaa80]::display_map::inlay_map::InlayMap>::sync+34620272",
    "<editor[a27980758befaa80]::display_map::inlay_map::InlayMap>::splice+34625232",
    "<editor[a27980758befaa80]::Editor>::splice_inlays+36133984",
    "<editor[a27980758befaa80]::Editor>::refresh_inlay_hints+36118920",
    "<gpui[d9459427aaac5cf7]::app::App>::update_window_id::<bool, <gpui[d9459427aaac5cf7]::app::context::Context<editor[a27980758befaa80]::Editor>>::subscribe_in<multi_buffer[8e46bf22c4328536]::MultiBuffer, multi_buffer[8e46bf22c4328536]::Event, <editor[a27980758befaa80]::Editor>::on_buffer_event>::{closure#0}::{closure#0}>::{closure#0}+32580340",
    "<gpui[d9459427aaac5cf7]::app::context::Context<editor[a27980758befaa80]::Editor>>::subscribe_in::<multi_buffer[8e46bf22c4328536]::MultiBuffer, multi_buffer[8e46bf22c4328536]::Event, <editor[a27980758befaa80]::Editor>::on_buffer_event>::{closure#0}+32525676",
    "<gpui[d9459427aaac5cf7]::app::App>::flush_effects+49203144",
    "<git_ui[af34da3abc55d48d]::project_diff::ProjectDiff>::handle_status_updates::{closure#0}+46285624",
    "<gpui[d9459427aaac5cf7]::app::App>::spawn::<<gpui[d9459427aaac5cf7]::window::Window>::spawn<<git_ui[af34da3abc55d48d]::project_diff::ProjectDiff>::new::{closure#5}, core[7ef867844175194f]::result::Result<(), anyhow[681c0f811db3b931]::Error>>::{closure#0}, core[7ef867844175194f]::result::Result<(), anyhow[681c0f811db3b931]::Error>>::{closure#0}+44818628",
    "<async_task[19fcc696f0676f54]::raw::RawTask<gpui[d9459427aaac5cf7]::executor::spawn_local_with_source_location::Checked<core[7ef867844175194f]::pin::Pin<alloc[b2f5842f192e62d9]::boxed::Box<dyn core[7ef867844175194f]::future::future::Future<Output = core[7ef867844175194f]::result::Result<(), anyhow[681c0f811db3b931]::Error>>>>>, core[7ef867844175194f]::result::Result<(), anyhow[681c0f811db3b931]::Error>, <gpui[d9459427aaac5cf7]::executor::ForegroundExecutor>::spawn::inner<core[7ef867844175194f]::result::Result<(), anyhow[681c0f811db3b931]::Error>>::{closure#0}, ()>>::run+45243748",
    "gpui[d9459427aaac5cf7]::platform::mac::dispatcher::trampoline+49503044",
    "<gpui[d9459427aaac5cf7]::platform::mac::platform::MacPlatform as gpui[d9459427aaac5cf7]::platform::Platform>::run+49566012",
    "<gpui[d9459427aaac5cf7]::app::Application>::run::<zed[a549cc22f5ee3be8]::main::{closure#6}>+112837360",
    "zed[a549cc22f5ee3be8]::main+114981884",
    "std[dece160403b877c5]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>+115786128",
    "std[dece160403b877c5]::rt::lang_start::<()>::{closure#0}+115693516",
    "std::rt::lang_start_internal::hdff9e551ec0db2ea+93633428",
    "_main+114997040"
  ],
  "app_version": "0.188.0",
  "app_commit_sha": "219c7d5f83cce7252c45fed06a8e3144f410b18e",
  "release_channel": "preview",
  "target": "aarch64-apple-darwin",
  "os_name": "macOS",
  "os_version": "15.3.2",
  "architecture": "aarch64",
  "panicked_on": 1747860784304,
  "system_id": "3fee2e0c-15dc-475a-a90f-a502ea9cddc5",
  "installation_id": "06bf7b6b-f822-4f1c-849e-300cb4ffe009",
  "session_id": "73435ef5-46e5-4a67-a2ae-e356f3e18089"
}

max-frai avatar May 21 '25 21:05 max-frai

Image Looks like somewhere here in ukrainian text with letter 'i'

max-frai avatar May 21 '25 21:05 max-frai

Thank you for the report. Report stack helps a lot. Though, I'm not able to reproduce this issue while committing with the following buffer:

const Component = () => {
  return (
    <div className="mx-3 my-2 bg-yellow-50 bg-center px-1.5 text-red-300">
      <div>
        <input placeholder="Введіть текст" />
      </div>
    </div>
  );
};

export default Component;

If you can provide the git diff (before and after text) for the exact scenario so I can reproduce the crash on my machine.

smitbarmase avatar May 27 '25 14:05 smitbarmase

I tried to replicate it, but with exactly same code after restart after crash It never crashed again :(

max-frai avatar May 27 '25 15:05 max-frai

Hopefully this was fixed as part of adjacent work. If you are still seeing this issue please open a clean issue. Thanks!

notpeter avatar Jul 22 '25 17:07 notpeter