Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go debug (delve) causing Helix to panic #6782

Closed
sbromberger opened this issue Apr 16, 2023 · 1 comment · Fixed by #6786
Closed

Go debug (delve) causing Helix to panic #6782

sbromberger opened this issue Apr 16, 2023 · 1 comment · Fixed by #6786
Labels
A-debug-adapter Area: Debug adapter client C-bug Category: This is a bug

Comments

@sbromberger
Copy link
Contributor

Summary

When running the debugger (<space>g, set a breakpoint, then start the debugger), helix panics with

seth@hydrogen:~/dev/go/helloworld $ RUST_BACKTRACE=1 hx helloworld.go
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })', helix-dap/src/transport.rs:264:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:142:14
   2: core::result::unwrap_failed
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/result.rs:1785:5
   3: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   4: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
   5: tokio::runtime::task::core::Core<T,S>::poll
   6: tokio::runtime::task::harness::Harness<T,S>::poll
   7: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
   8: tokio::runtime::scheduler::multi_thread::worker::Context::run
   9: tokio::macros::scoped_tls::ScopedKey<T>::set
  10: tokio::runtime::scheduler::multi_thread::worker::run
  11: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
  12: tokio::runtime::task::core::Core<T,S>::poll
  13: tokio::runtime::task::harness::Harness<T,S>::poll
  14: tokio::runtime::blocking::pool::Inner::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Reproduction Steps

I tried this:

  1. RUST_BACKTRACE=1 hx helloworld.go
  2. <space>gb to set a breakpoint
  3. l to launch debug target, select binary, enter in full path of the helloworld executable

I expected this to happen:
delve to start within helix

Instead, this happened:
panic as described above

Helix log

Here's an extract of helix.log run with -vv:

~/.cache/helix/helix.log
2023-04-16T17:58:11.194 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-04-16T17:58:11.194 helix_dap::transport [INFO] -> DAP {"type":"request","seq":1,"command":"launch","arguments":{"cwd":"/home/seth/dev/go/helloworld","mode":"exec","program":"/home/seth/dev/go/helloworld/helloworld"}}
2023-04-16T17:58:11.397 helix_dap::transport [INFO] <- DAP {"seq":0,"type":"event","event":"initialized"}
2023-04-16T17:58:11.397 helix_dap::transport [INFO] <- DAP event Initialized(None)
2023-04-16T17:58:11.397 helix_dap::transport [INFO] <- DAP {"seq":0,"type":"response","request_seq":1,"success":true,"command
":"launch"}
2023-04-16T17:58:11.397 helix_dap::transport [INFO] <- DAP success in response to 1
2023-04-16T17:58:11.397 helix_term::application [DEBUG] received editor event: DebuggerEvent(Event(Initialized(None)))2023-04-16T17:58:11.397 helix_dap::transport [INFO] -> DAP {"type":"request","seq":2,"command":"configurationDone","arguments
":null}
2023-04-16T17:58:11.398 helix_dap::transport [INFO] <- DAP {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Type 'dlv help' for list of commands.\n","source":{}}}
2023-04-16T17:58:11.398 helix_dap::transport [INFO] <- DAP event Output(Output { output: "Type 'dlv help' for list of commands.\n", category: Some("console"), group: None, line: None, column: None, variables_reference: None, source: Some(Source { name: None, path: None, source_reference: None, presentation_hint: None, origin: None, sources: None, adapter_data: None, checksums: None }), data: None })
2023-04-16T17:58:11.398 helix_dap::transport [INFO] <- DAP {"seq":0,"type":"response","request_seq":2,"success":true,"command":"configurationDone"}
2023-04-16T17:58:11.398 helix_dap::transport [INFO] <- DAP success in response to 2
2023-04-16T17:58:11.398 helix_view::editor [DEBUG] editor status: Debugged application started
2023-04-16T17:58:11.398 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-04-16T17:58:11.399 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-04-16T17:58:11.400 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-04-16T17:58:11.401 helix_dap::transport [INFO] <- DAP {"seq":0,"type":"event","event":"terminated","body":{}}
2023-04-16T17:58:11.401 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-04-16T17:58:11.401 helix_dap::transport [INFO] <- DAP event Terminated(Some(Terminated { restart: None }))
2023-04-16T17:58:11.402 helix_term::application [DEBUG] received editor event: DebuggerEvent(Event(Output(Output { output: "T
ype 'dlv help' for list of commands.\n", category: Some("console"), group: None, line: None, column: None, variables_reference: None, source: Some(Source { name: None, path: None, source_reference: None, presentation_hint: None, origin: None, sources: None, adapter_data: None, checksums: None }), data: None })))
2023-04-16T17:58:11.402 helix_view::handlers::dap [INFO] Type 'dlv help' for list of commands.

2023-04-16T17:58:11.402 helix_view::editor [DEBUG] editor status: Debug (console): Type 'dlv help' for list of commands.

2023-04-16T17:58:11.402 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-04-16T17:58:11.403 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-04-16T17:58:11.403 helix_term::application [DEBUG] received editor event: DebuggerEvent(Event(Terminated(Some(Terminated { restart: None }))))

Platform

linux (void) 6.1.21_1 #1 SMP PREEMPT_DYNAMIC Fri Mar 24 00:43:29 UTC 2023 x86_64 GNU/Linux

Terminal Emulator

blink.sh / mosh / tmux

Helix Version

22.12-577-g4cdba7cc

@sbromberger sbromberger added the C-bug Category: This is a bug label Apr 16, 2023
@A-Walrus
Copy link
Contributor

A-Walrus commented Apr 17, 2023

I encountered the same error with Rust and lldb-vscode, but only when I try to add a breakpoint after the debugging session has been terminated.
Reproduction steps:

  • Launch debug target
  • Run program to end
  • See Terminated debugging session and disconnected debugger.
  • try to add breakpoint
  • Same error about unwrap broken pipe.

Helix Version: 23.03

A-Walrus added a commit to A-Walrus/helix that referenced this issue Apr 17, 2023
@kirawi kirawi added the A-debug-adapter Area: Debug adapter client label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debug-adapter Area: Debug adapter client C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants