helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.69k stars 2.5k forks source link

Helix panicked #10586

Closed bluecube closed 6 months ago

bluecube commented 6 months ago

Summary

During when either saving a file or :reload-all (Don't know which, I was kind of running on muscle memory) of a C++ file, Helix crashed with the following panic message:

thread 'main' panicked at helix-core/src/transaction.rs:478:9:
Positions [(25037, Before)] are out of range for changeset len 24947!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I currently have a horrifyingly broken clangd setup, which might have been the cause.

Reproduction Steps

I can't really provide anything better than the error message, it was just a random crash.

Helix log

Skipped everything older than about 5min, from the log. The whole thing is 290MB, I'll upload it somewhere if necessary.

2024-04-24T18:01:24.148 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.148] <-- textDocument/didChange\n"
2024-04-24T18:01:24.151 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.151] <-- textDocument/didChange\n"
2024-04-24T18:01:24.176 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.176] <-- textDocument/didChange\n"
2024-04-24T18:01:24.199 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.199] --> textDocument/publishDiagnostics\n"
2024-04-24T18:01:24.200 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.200] ASTWorker building file /home/cube/mosaic/firmware/apps/pubapi/pubapi/m51_rest_api.cpp version 3806 with command \n"
2024-04-24T18:01:24.200 helix_lsp::transport [ERROR] clangd err <- "[/home/cube/mosaic/firmware/apps]\n"
2024-04-24T18:01:24.200 helix_lsp::transport [ERROR] clangd err <- "/usr/lib/llvm/18/bin/clang++ --driver-mode=g++ --sysroot=/project/tools/../buildroot/output_os/host/aarch64-buildroot-linux-gnu/sysroot/ -o build/aarch64_debug/pubapi/pubapi/m51_rest_api.o -c -std=c++17 -ggdb3 -pipe -pthread -fPIC -fsigned-char -fvisibility=hidden -ffunction-sections -fdata-sections -fmax-errors=10 -pedantic -Wall -Wextra -Werror -Wno-psabi -Og -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-inline-functions -funwind-tables \"-DPROJECT_ROOT=\\\"/project/apps\\\"\" -DGSL_TERMINATE_ON_CONTRACT_VIOLATION -DWIN_INTERFACE_CUSTOM -DUSE_OS_TZDB=1 -D_DEBUG -I/project/buildroot/output_os/host/aarch64-buildroot-linux-gnu/sysroot/usr/include -I/project/buildroot/output_os/host/aarch64-buildroot-linux-gnu/sysroot/usr/local/include -Ibuild/aarch64_debug/messages -Imessages -Ibrokerclient -Ibrokercommon -Ivideo -Icommon -Isharedstorageclient -Isharedstoragecommon -Ipreviewconsumer -Ipubapi -resource-dir=/usr/lib/llvm/18/bin/../../../../lib/clang/18 -- /home/cube/mosaic/firmware/apps/pubapi/pubapi/m51_rest_api.cpp\n"
2024-04-24T18:01:24.201 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.201] ASTWorker building file /home/cube/mosaic/firmware/apps/pubapi/pubapi/m51_rest_api.hpp version 3614 with command inferred from pubapi/pubapi/m51_rest_api.cpp\n"
2024-04-24T18:01:24.201 helix_lsp::transport [ERROR] clangd err <- "[/home/cube/mosaic/firmware/apps]\n"
2024-04-24T18:01:24.201 helix_lsp::transport [ERROR] clangd err <- "/usr/lib/llvm/18/bin/clang++ --driver-mode=g++ --sysroot=/project/tools/../buildroot/output_os/host/aarch64-buildroot-linux-gnu/sysroot/ -c -ggdb3 -pipe -pthread -fPIC -fsigned-char -fvisibility=hidden -ffunction-sections -fdata-sections -fmax-errors=10 -pedantic -Wall -Wextra -Werror -Wno-psabi -Og -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-inline-functions -funwind-tables \"-DPROJECT_ROOT=\\\"/project/apps\\\"\" -DGSL_TERMINATE_ON_CONTRACT_VIOLATION -DWIN_INTERFACE_CUSTOM -DUSE_OS_TZDB=1 -D_DEBUG -I/project/buildroot/output_os/host/aarch64-buildroot-linux-gnu/sysroot/usr/include -I/project/buildroot/output_os/host/aarch64-buildroot-linux-gnu/sysroot/usr/local/include -Ibuild/aarch64_debug/messages -Imessages -Ibrokerclient -Ibrokercommon -Ivideo -Icommon -Isharedstorageclient -Isharedstoragecommon -Ipreviewconsumer -Ipubapi -resource-dir=/usr/lib/llvm/18/bin/../../../../lib/clang/18 -std=c++17 -- /home/cube/mosaic/firmware/apps/pubapi/pubapi/m51_rest_api.hpp\n"
2024-04-24T18:01:24.202 helix_lsp::transport [ERROR] clangd err <- "/home/cube/mosaic/firmware/.clang-format:76:5: error: unknown key 'Delimiter'\n"
2024-04-24T18:01:24.202 helix_lsp::transport [ERROR] clangd err <- "  - Delimiter:       pb\n"
2024-04-24T18:01:24.202 helix_lsp::transport [ERROR] clangd err <- "    ^~~~~~~~~\n"
2024-04-24T18:01:24.202 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.202] getStyle() failed for file /home/cube/mosaic/firmware/apps/pubapi/pubapi/m51_rest_api.cpp: Error reading /home/cube/mosaic/firmware/.clang-format: Invalid argument. Fallback is LLVM style.\n"
2024-04-24T18:01:24.203 helix_lsp::transport [ERROR] clangd err <- "/home/cube/mosaic/firmware/.clang-format:76:5: error: unknown key 'Delimiter'\n"
2024-04-24T18:01:24.203 helix_lsp::transport [ERROR] clangd err <- "  - Delimiter:       pb\n"
2024-04-24T18:01:24.203 helix_lsp::transport [ERROR] clangd err <- "    ^~~~~~~~~\n"
2024-04-24T18:01:24.203 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.203] getStyle() failed for file /home/cube/mosaic/firmware/apps/pubapi/pubapi/m51_rest_api.hpp: Error reading /home/cube/mosaic/firmware/.clang-format: Invalid argument. Fallback is LLVM style.\n"
2024-04-24T18:01:24.210 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.210] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.210 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.210] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.210 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.210] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.210 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.210] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.210 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.210] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.210 helix_lsp::transport [ERROR] clangd err <- "/home/cube/mosaic/firmware/.clang-format:76:5: error: unknown key 'Delimiter'\n"
2024-04-24T18:01:24.210 helix_lsp::transport [ERROR] clangd err <- "  - Delimiter:       pb\n"
2024-04-24T18:01:24.210 helix_lsp::transport [ERROR] clangd err <- "    ^~~~~~~~~\n"
2024-04-24T18:01:24.210 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.210] Couldn't infer style\n"
2024-04-24T18:01:24.212 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.212] --> textDocument/publishDiagnostics\n"
2024-04-24T18:01:24.226 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.226] ASTWorker building file /home/cube/mosaic/firmware/apps/pubapi/tests/m51_rest_api.cpp version 18 with command \n"
2024-04-24T18:01:24.226 helix_lsp::transport [ERROR] clangd err <- "[/home/cube/mosaic/firmware/apps]\n"
2024-04-24T18:01:24.226 helix_lsp::transport [ERROR] clangd err <- "/usr/lib/llvm/18/bin/clang++ --driver-mode=g++ --sysroot=/project/tools/../buildroot/output_os/host/aarch64-buildroot-linux-gnu/sysroot/ -o build/aarch64_debug/pubapi/tests/m51_rest_api.o -c -std=c++17 -ggdb3 -pipe -pthread -fPIC -fsigned-char -fvisibility=hidden -ffunction-sections -fdata-sections -fmax-errors=10 -pedantic -Wall -Wextra -Werror -Wno-psabi -Og -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-inline-functions -funwind-tables \"-DPROJECT_ROOT=\\\"/project/apps\\\"\" -DGSL_TERMINATE_ON_CONTRACT_VIOLATION -DWIN_INTERFACE_CUSTOM -DUSE_OS_TZDB=1 -D_DEBUG -Iupdater/tests -Iupdater -Ipubapi/tests -Ipubapi -Imcu_interface/tests -Imcu_interface -Igps/tests -Igps -Iarbiter/tests -Iarbiter -Imessages/tests -Imessages -Ivideo/tests -Icommon/tests -Itests -I/project/buildroot/output_os/host/aarch64-buildroot-linux-gnu/sysroot/usr/include -I/project/buildroot/output_os/host/aarch64-buildroot-linux-gnu/sysroot/usr/local/include -Ibuild/aarch64_debug/messages -Imessages -Ibrokerclient -Ibrokercommon -Ivideo -Icommon -Isharedstorageclient -Isharedstoragecommon -Ipreviewconsumer -resource-dir=/usr/lib/llvm/18/bin/../../../../lib/clang/18 -- /home/cube/mosaic/firmware/apps/pubapi/tests/m51_rest_api.cpp\n"
2024-04-24T18:01:24.228 helix_lsp::transport [ERROR] clangd err <- "/home/cube/mosaic/firmware/.clang-format:76:5: error: unknown key 'Delimiter'\n"
2024-04-24T18:01:24.228 helix_lsp::transport [ERROR] clangd err <- "  - Delimiter:       pb\n"
2024-04-24T18:01:24.228 helix_lsp::transport [ERROR] clangd err <- "    ^~~~~~~~~\n"
2024-04-24T18:01:24.228 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.228] getStyle() failed for file /home/cube/mosaic/firmware/apps/pubapi/tests/m51_rest_api.cpp: Error reading /home/cube/mosaic/firmware/.clang-format: Invalid argument. Fallback is LLVM style.\n"
2024-04-24T18:01:24.234 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.234] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.234 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.234] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.234 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.234] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.234 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.234] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.234 helix_lsp::transport [ERROR] clangd err <- "/home/cube/mosaic/firmware/.clang-format:76:5: error: unknown key 'Delimiter'\n"
2024-04-24T18:01:24.234 helix_lsp::transport [ERROR] clangd err <- "  - Delimiter:       pb\n"
2024-04-24T18:01:24.234 helix_lsp::transport [ERROR] clangd err <- "    ^~~~~~~~~\n"
2024-04-24T18:01:24.234 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.234] Couldn't infer style\n"
2024-04-24T18:01:24.235 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.235] --> textDocument/publishDiagnostics\n"
2024-04-24T18:01:24.247 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.247] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.247 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.247] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.247 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.247] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.247 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.247] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.247 helix_lsp::transport [ERROR] clangd err <- "/home/cube/mosaic/firmware/.clang-format:76:5: error: unknown key 'Delimiter'\n"
2024-04-24T18:01:24.247 helix_lsp::transport [ERROR] clangd err <- "  - Delimiter:       pb\n"
2024-04-24T18:01:24.247 helix_lsp::transport [ERROR] clangd err <- "    ^~~~~~~~~\n"
2024-04-24T18:01:24.247 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.247] Couldn't infer style\n"
2024-04-24T18:01:24.249 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.249] --> textDocument/publishDiagnostics\n"
2024-04-24T18:01:24.395 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.395] Built preamble of size 5020396 for file /home/cube/mosaic/firmware/apps/pubapi/pubapi/m51_rest_api.hpp version 3614 in 0.19 seconds\n"
2024-04-24T18:01:24.397 helix_lsp::transport [ERROR] clangd err <- "/home/cube/mosaic/firmware/.clang-format:76:5: error: unknown key 'Delimiter'\n"
2024-04-24T18:01:24.397 helix_lsp::transport [ERROR] clangd err <- "  - Delimiter:       pb\n"
2024-04-24T18:01:24.397 helix_lsp::transport [ERROR] clangd err <- "    ^~~~~~~~~\n"
2024-04-24T18:01:24.397 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.397] getStyle() failed for file /home/cube/mosaic/firmware/apps/pubapi/pubapi/m51_rest_api.hpp: Error reading /home/cube/mosaic/firmware/.clang-format: Invalid argument. Fallback is LLVM style.\n"
2024-04-24T18:01:24.408 helix_lsp::transport [ERROR] clangd err <- "/home/cube/mosaic/firmware/.clang-format:76:5: error: unknown key 'Delimiter'\n"
2024-04-24T18:01:24.408 helix_lsp::transport [ERROR] clangd err <- "  - Delimiter:       pb\n"
2024-04-24T18:01:24.408 helix_lsp::transport [ERROR] clangd err <- "    ^~~~~~~~~\n"
2024-04-24T18:01:24.408 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.408] Couldn't infer style\n"
2024-04-24T18:01:24.409 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.409] --> textDocument/publishDiagnostics\n"
2024-04-24T18:01:24.435 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.435] Built preamble of size 5883336 for file /home/cube/mosaic/firmware/apps/pubapi/pubapi/m51_rest_api.cpp version 3806 in 0.23 seconds\n"
2024-04-24T18:01:24.435 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.435] Built preamble of size 5313876 for file /home/cube/mosaic/firmware/apps/pubapi/tests/m51_rest_api.cpp version 18 in 0.21 seconds\n"
2024-04-24T18:01:24.437 helix_lsp::transport [ERROR] clangd err <- "/home/cube/mosaic/firmware/.clang-format:13876 for file /home/cube/mosaic/firmwar:76:5: 7u:5: error: unknown key 'Delimiter'\n"
2024-04-24T18:01:24.437 helix_lsp::transport [ERROR] clangd err <- "  - Delimiter:       pb\n"
2024-04-24T18:01:24.437 helix_lsp::transport [ERROR] clangd err <- "    ^~~~~~~~~\n"
2024-04-24T18:01:24.437 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.437] getStyle() failed for file /home/cube/mosaic/firmware/apps/pubapi/tests/m51_rest_api.cpp: Error reading /home/cube/mosaic/firmware/.clang-format: Invalid argument. Fallback is LLVM style.\n"
2024-04-24T18:01:24.437 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.437] getStyle() failed for file /home/cube/mosaic/firmware/apps/pubapi/pubapi/m51_rest_api.cpp: Error reading /home/cube/mosaic/firmware/.clang-format: Invalid argument. Fallback is LLVM style.\n"
2024-04-24T18:01:24.452 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.452] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.452 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.452] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.452 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.452] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.452 helix_lsp::transport [ERROR] clangd err <- "/home/cube/mosaic/firmware/.clang-format:76:5: error: unknown key 'Delimiter'\n"
2024-04-24T18:01:24.452 helix_lsp::transport [ERROR] clangd err <- "  - Delimiter:       pb\n"
2024-04-24T18:01:24.452 helix_lsp::transport [ERROR] clangd err <- "    ^~~~~~~~~\n"
2024-04-24T18:01:24.452 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.452] Couldn't infer style\n"
2024-04-24T18:01:24.453 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.453] --> textDocument/publishDiagnostics\n"
2024-04-24T18:01:24.472 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.472] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.472 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.472] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.472 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.472] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
2024-04-24T18:01:24.472 helix_lsp::transport [ERROR] clangd err <- "/home/cube/mosaic/firmware/.clang-format:76:5: error: unknown key 'Delimiter'\n"
2024-04-24T18:01:24.472 helix_lsp::transport [ERROR] clangd err <- "  - Delimiter:       pb\n"
2024-04-24T18:01:24.472 helix_lsp::transport [ERROR] clangd err <- "    ^~~~~~~~~\n"
2024-04-24T18:01:24.472 helix_lsp::transport [ERROR] clangd err <- "E[18:01:24.472] Couldn't infer style\n"
2024-04-24T18:01:24.473 helix_lsp::transport [ERROR] clangd err <- "I[18:01:24.473] --> textDocument/publishDiagnostics\n"
2024-04-24T18:01:27.401 helix_lsp::transport [ERROR] clangd err <- "I[18:01:27.401] <-- textDocument/didChange\n"

Platform

Linux

Terminal Emulator

rxvt-unicode (urxvt) v9.31 - released: 2023-01-02

Installation Method

Installed from Gentoo portage

Helix Version

helix 24.3 (2cadec0b)

woojiq commented 6 months ago

Duplicate of https://github.com/helix-editor/helix/issues/9830 ?