helix-editor / helix

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

Panic on unreachable code #7994

Closed RobinWebbers closed 1 year ago

RobinWebbers commented 1 year ago

Summary

While editing, Helix crashed on me with the following error:

thread 'main' panicked at 'internal error: entered unreachable code: (Some(Retain(18446744073709551328)))', helix-core/src/transaction.rs:160:46

Reproduction Steps

I wasn't able to reproduce the result. However the crash occurred while deleting brackets using the sequence m d m .

While editing a simple Haskell main file with the line:

main' :: (MonadIO m) => m ()

Trying to delete the brackets around MonadIO m.

I was running with the latest version (2.1.0.0) of the Haskell Language Server.

Helix log

~/.cache/helix/helix.log 2023-08-18T18:38:02.961 helix_lsp::transport [ERROR] err <- "2023-08-18T16:38:02.960943Z | Info | invoking build tool to determine build flags (this may take some time depending on the cache)\n" 2023-08-18T18:38:04.087 helix_lsp::transport [ERROR] err <- "2023-08-18T16:38:04.086856Z | Info | Interface files cache directory: /home/turtle/.cache/ghcide/main-d7249a737b1dc22e5d75dabdd805d244f4b1bfb6-d7249a737b1dc22e5d75dabdd805d244f4b1bfb6\n" 2023-08-18T18:38:04.087 helix_lsp::transport [ERROR] err <- "2023-08-18T16:38:04.087157Z | Info | Making new HscEnv. In-place unit ids: [ main-d7249a737b1dc22e5d75dabdd805d244f4b1bfb6 ]\n" 2023-08-18T18:38:04.110 helix_lsp::transport [ERROR] err <- "2023-08-18T16:38:04.109968Z | Info | Cradle path: app/Main.hs\n" 2023-08-18T18:38:04.110 helix_lsp::transport [ERROR] err <- "2023-08-18T16:38:04.110146Z | Warning | No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for app/Main.hs.\n" 2023-08-18T18:38:04.110 helix_lsp::transport [ERROR] err <- "Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).\n" 2023-08-18T18:38:04.110 helix_lsp::transport [ERROR] err <- "You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.\n" 2023-08-18T18:38:04.112 helix_lsp::transport [ERROR] err <- "2023-08-18T16:38:04.112118Z | Info | invoking build tool to determine build flags (this may take some time depending on the cache)\n" 2023-08-18T18:38:05.086 helix_lsp::transport [ERROR] err <- "2023-08-18T16:38:05.086599Z | Info | Interface files cache directory: /home/turtle/.cache/ghcide/main-a512f423414d65983005919b7052c4284f925fe4-a512f423414d65983005919b7052c4284f925fe4\n" 2023-08-18T18:38:05.086 helix_lsp::transport [ERROR] err <- "2023-08-18T16:38:05.086865Z | Info | Interface files cache directory: /home/turtle/.cache/ghcide/main-d7249a737b1dc22e5d75dabdd805d244f4b1bfb6-a512f423414d65983005919b7052c4284f925fe4\n" 2023-08-18T18:38:05.087 helix_lsp::transport [ERROR] err <- "2023-08-18T16:38:05.086952Z | Info | Making new HscEnv. In-place unit ids: [ main-a512f423414d65983005919b7052c4284f925fe4\n" 2023-08-18T18:38:05.087 helix_lsp::transport [ERROR] err <- " , main-d7249a737b1dc22e5d75dabdd805d244f4b1bfb6 ]\n" 2023-08-18T18:38:08.823 helix_view::editor [ERROR] editor error: Surround pair not found around all cursors 2023-08-18T18:38:12.469 helix_lsp::transport [ERROR] err <- "2023-08-18T16:38:12.469202Z | Info | Could not identify reverse dependencies for NormalizedFilePath \"/home/turtle/Code/course/dpll-smt/app/Main.hs\"\n" 2023-08-18T18:39:02.329 helix_lsp::transport [ERROR] err <- "2023-08-18T16:39:02.329064Z | Info | Live bytes: 0.00MB Heap size: 0.00MB\n" 2023-08-18T18:39:35.268 helix_view::editor [ERROR] Failed to initialize the LSP for `source.yaml` { cannot find binary path } 2023-08-18T18:40:02.429 helix_lsp::transport [ERROR] err <- "2023-08-18T16:40:02.429618Z | Info | Live bytes: 0.00MB Heap size: 0.00MB\n" 2023-08-18T18:41:02.519 helix_lsp::transport [ERROR] err <- "2023-08-18T16:41:02.518721Z | Info | Live bytes: 0.00MB Heap size: 0.00MB\n" 2023-08-18T18:42:02.521 helix_lsp::transport [ERROR] err <- "2023-08-18T16:42:02.521015Z | Info | Live bytes: 0.00MB Heap size: 0.00MB\n" 2023-08-18T18:43:02.621 helix_lsp::transport [ERROR] err <- "2023-08-18T16:43:02.621567Z | Info | Live bytes: 0.00MB Heap size: 0.00MB\n" 2023-08-18T18:44:02.721 helix_lsp::transport [ERROR] err <- "2023-08-18T16:44:02.720717Z | Info | Live bytes: 0.00MB Heap size: 0.00MB\n" 2023-08-18T18:45:02.821 helix_lsp::transport [ERROR] err <- "2023-08-18T16:45:02.821306Z | Info | Live bytes: 0.00MB Heap size: 0.00MB\n" 2023-08-18T18:46:02.829 helix_lsp::transport [ERROR] err <- "2023-08-18T16:46:02.828807Z | Info | Live bytes: 0.00MB Heap size: 0.00MB\n"

Platform

Linux (Pop!_OS 22.04)

Terminal Emulator

kitty

Helix Version

helix 23.05 (7f5940be)

pascalkuthe commented 1 year ago

please test if this crash still happen on latest master, it may already be fixed but we have no way to tell without a repoduction case

RobinWebbers commented 1 year ago

I've tried some stuff, but I really did not find a way to reproduce this case. As there is no way to tell how this bug is triggered or even if it was already fixed or not, I'll close the issue. Sorry for bothering you!