helix-editor / helix

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

Crash when trying to debug: "no entry found for key" #11483

Open CastilloDel opened 1 month ago

CastilloDel commented 1 month ago

Summary

If I have try to debug after having set a breakpoint helix crashes with the following error. The code is using async I don't know if that matters

RUST_BACKTRACE=full hx -vv .
thread 'main' panicked at 'no entry found for key', /build/helix-oy5n63/helix-23.10/helix-view/src/handlers/dap.rs:40:17
stack backtrace:
   0:     0x599ddf9544dd - <unknown>
   1:     0x599ddee178ce - <unknown>
   2:     0x599ddf9366e5 - <unknown>
   3:     0x599ddf9542a5 - <unknown>
   4:     0x599ddf94681f - <unknown>
   5:     0x599ddf9464df - <unknown>
   6:     0x599ddf946e14 - <unknown>
   7:     0x599ddf954816 - <unknown>
   8:     0x599ddf95461c - <unknown>
   9:     0x599ddf946992 - <unknown>
  10:     0x599dded3f8f3 - <unknown>
  11:     0x599ddee13b11 - <unknown>
  12:     0x599ddee13abb - <unknown>
  13:     0x599dded3f7e6 - <unknown>
  14:     0x599ddf707fad - <unknown>
  15:     0x599ddf70f4e9 - <unknown>
  16:     0x599ddf704f6b - <unknown>
  17:     0x599ddf71b5ed - <unknown>
  18:     0x599ddf71c672 - <unknown>
  19:     0x599ddf7575a9 - <unknown>
  20:     0x599ddf76ec5a - <unknown>
  21:     0x599ddf727f43 - <unknown>
  22:     0x599ddf74f5dd - <unknown>
  23:     0x599ddf935475 - <unknown>
  24:     0x599ddf76ed55 - <unknown>
  25:     0x7881fb82a1ca - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  26:     0x7881fb82a28b - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:360:3
  27:     0x599dded96915 - <unknown>
  28:                0x0 - <unknown>

This is my configuration (I mainly copied it from the default):

[[language]]
name = "rust"
auto-format = true

[language.debugger]
name = "lldb-dap"
transport = "stdio"
command = "lldb-dap"

[[language.debugger.templates]]
name = "binary"
request = "launch"
completion = [ { name = "binary", completion = "filename" } ]
args = { program = "{0}" }

[[language.debugger.templates]]
name = "binary (terminal)"
request = "launch"
completion = [ { name = "binary", completion = "filename" } ]
args = { program = "{0}", runInTerminal = true }

[[language.debugger.templates]]
name = "attach"
request = "attach"
completion = [ "pid" ]
args = { pid = "{0}" }

[[language.debugger.templates]]
name = "gdbserver attach"
request = "attach"
completion = [ { name = "lldb connect url", default = "connect://localhost:3333" }, { name = "file", completion = "filename" }, "pid" ]
args = { attachCommands = [ "platform select remote-gdb-server", "platform connect {0}", "file {1}", "attach {2}" ] }

Reproduction Steps

I tried this:

  1. hx
  2. Open a test file
  3. Set a break point
  4. Run the debugger choosing a the binary

I expected this to happen: The debugger runs and stops at the breakpoint

Instead, this happened: A crash

Helix log

I ran RUST_BACKTRACE=full hx -v

log.txt

Platform

Linux

Terminal Emulator

Alacritty

Installation Method

helix/now 23.10-1~ubuntu23.04~ppa1 amd64

Helix Version

helix 23.10 (f6021dd0)

archseer commented 1 month ago

Can you reproduce on a build from master so we get the full backtrace? The PPA has symbols stripped so the backtrace isn't very useful. Looking at your commit sha, you're also using a a helix version from 10 months ago

CastilloDel commented 1 month ago

Wow I hadn't noticed the PPA was lagging behind so much. I'll try to reproduce with master and report back. Thanks for the quick response!

CastilloDel commented 1 month ago

I can also reproduce it on master. Here's the backtrace

thread 'main' panicked at /home/daniel/helix/helix-view/src/handlers/dap.rs:40:38:
no entry found for key
stack backtrace:
   0:     0x611132fa4771 - std::backtrace_rs::backtrace::libunwind::trace::h67a838aed1f4d6ec
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x611132fa4771 - std::backtrace_rs::backtrace::trace_unsynchronized::h1d1786bb1962baf8
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x611132fa4771 - std::sys_common::backtrace::_print_fmt::h5a0b1f807a002d23
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x611132fa4771 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf84ab6ad0b91784c
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x61113221e2ac - core::fmt::rt::Argument::fmt::h28f463bd1fdabed5
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/fmt/rt.rs:138:9
   5:     0x61113221e2ac - core::fmt::write::ha37c23b175e921b3
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/fmt/mod.rs:1114:21
   6:     0x611132fa048e - std::io::Write::write_fmt::haa1b000741bcbbe1
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/io/mod.rs:1763:15
   7:     0x611132fa4554 - std::sys_common::backtrace::_print::h1ff1030b04dfb157
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x611132fa4554 - std::sys_common::backtrace::print::hb982056c6f29541c
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x611132fa6293 - std::panicking::default_hook::{{closure}}::h11f92f82c62fbd68
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:272:22
  10:     0x611132fa5fd1 - std::panicking::default_hook::hb8810fe276772c66
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:292:9
  11:     0x611132fa68d4 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h87b887549356728a
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/alloc/src/boxed.rs:2021:9
  12:     0x611132fa68d4 - std::panicking::rust_panic_with_hook::hd2f0efd2fec86cb0
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:735:13
  13:     0x611132fa667e - std::panicking::begin_panic_handler::{{closure}}::h3651b7fc4f61d784
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:609:13
  14:     0x611132fa4c46 - std::sys_common::backtrace::__rust_end_short_backtrace::hbc468e4b98c7ae04
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/sys_common/backtrace.rs:170:18
  15:     0x611132fa6422 - rust_begin_unwind
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:597:5
  16:     0x611132122075 - core::panicking::panic_fmt::h979245e2fdb2fabd
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:72:14
  17:     0x611132122033 - core::panicking::panic_display::h9b355c58fd35af38
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:168:5
  18:     0x611132122033 - core::panicking::panic_str::h187a5146d72e7d2f
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:152:5
  19:     0x611132122033 - core::option::expect_failed::h7cdfa49208a82a89
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/option.rs:1988:5
  20:     0x611132d21603 - helix_view::handlers::dap::select_thread_id::{{closure}}::hfeafa1010c39ce42
  21:     0x611132d29016 - helix_view::handlers::dap::<impl helix_view::editor::Editor>::handle_debugger_message::{{closure}}::h36b43705d575ca0f
  22:     0x611132d1ec0f - helix_term::application::Application::run::{{closure}}::ha82a68673335b2fd
  23:     0x611132d3359d - tokio::runtime::park::CachedParkThread::block_on::h26a0c12762add91b
  24:     0x611132da554c - tokio::runtime::runtime::Runtime::block_on::hb79a5051ba6b1635
  25:     0x611132d78df3 - hx::main::hcb90d795e69d5f8b
  26:     0x611132d8e253 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0f50c8918add0b36
  27:     0x611132d96f6d - std::rt::lang_start::{{closure}}::h0eb8e4df86b9c9d8
  28:     0x611132f9816f - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hf9057cfaeeb252e2
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:284:13
  29:     0x611132f9816f - std::panicking::try::do_call::h629e203a624883e4
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:504:40
  30:     0x611132f9816f - std::panicking::try::h7b61614724d6a4f1
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:468:19
  31:     0x611132f9816f - std::panic::catch_unwind::h354ac1c0268491d8
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panic.rs:142:14
  32:     0x611132f9816f - std::rt::lang_start_internal::{{closure}}::h919fee3c5ba8f617
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/rt.rs:148:48
  33:     0x611132f9816f - std::panicking::try::do_call::h54583f67455bff32
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:504:40
  34:     0x611132f9816f - std::panicking::try::hb0e12c4e01d39dc2
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:468:19
  35:     0x611132f9816f - std::panic::catch_unwind::h367b6339e3ca9a3b
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panic.rs:142:14
  36:     0x611132f9816f - std::rt::lang_start_internal::ha5ce8533eaa0fda8
                               at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/rt.rs:148:20
  37:     0x611132d78ee5 - main
  38:     0x7ceabf22a1ca - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  39:     0x7ceabf22a28b - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:360:3
  40:     0x61113219acd5 - _start
  41:                0x0 - <unknown>