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

Error while working with GoLang. #6550

Closed
vikaskaliramna0 opened this issue Apr 2, 2023 · 5 comments
Closed

Error while working with GoLang. #6550

vikaskaliramna0 opened this issue Apr 2, 2023 · 5 comments
Labels
C-bug Category: This is a bug

Comments

@vikaskaliramna0
Copy link

Summary

I was learning GoLang and writing some basic program. After writing some basic array, pointers and loop stuff, I tried to save the GoLang file. The editor crashed.

  • No Syntax Error or any other error by LSP.
  • LSP is working fine, no issues.
  • Go is configured properly, hx --health go returns all options checked green.
  • Never had any issue like this before with other languages.
  • NOTE: Haven't tried other languages after this error with GoLang.

Files in the directory

  • go.mod
  • main.go

Install Location

Helix is installed in the /bin/ directory. Which I did manually are building the binary from source.

Reproduction Steps

I tried this:

  1. :write

I expected this to happen:

Save the GoLang file normally.

Instead, this happened:

The editor crashed, also didn't save the GoLang file.

Helix log

RUST_BACKTRACE=1
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::panicking::panic
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:48:5
   3: helix_core::transaction::Transaction::change
             at /home/vikas/Repository/helix/helix-core/src/transaction.rs:512:13
   4: helix_lsp::util::generate_transaction_from_edits
             at /home/vikas/Repository/helix/helix-lsp/src/lib.rs:497:9
   5: helix_view::document::Document::format::{{closure}}
             at /home/vikas/Repository/helix/helix-view/src/document.rs:627:16
   6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/future/mod.rs:91:19
   7: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/future/future.rs:124:9
   8: helix_term::commands::make_format_callback::{{closure}}
             at /home/vikas/Repository/helix/helix-term/src/commands.rs:2715:24
   9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/future/mod.rs:91:19
  10: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/futures-util-0.3.27/src/future/future/map.rs:55:37
  11: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/futures-util-0.3.27/src/lib.rs:91:13
  12: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/future/future.rs:124:9
  13: <futures_util::stream::futures_unordered::FuturesUnordered<Fut> as futures_core::stream::Stream>::poll_next
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/futures-util-0.3.27/src/stream/futures_unordered/mod.rs:518:17
  14: futures_util::stream::stream::StreamExt::poll_next_unpin
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/futures-util-0.3.27/src/stream/stream/mod.rs:1632:9
  15: <futures_util::stream::stream::next::Next<St> as core::future::future::Future>::poll
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/futures-util-0.3.27/src/stream/stream/next.rs:32:9
  16: helix_term::application::Application::event_loop_until_idle::{{closure}}::{{closure}}
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/tokio-1.27.0/src/macros/select.rs:524:49
  17: <tokio::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/tokio-1.27.0/src/future/poll_fn.rs:58:9
  18: helix_term::application::Application::event_loop_until_idle::{{closure}}
             at /home/vikas/Repository/helix/helix-term/src/application.rs:316:13
  19: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/future/mod.rs:91:19
  20: helix_term::application::Application::event_loop::{{closure}}
             at /home/vikas/Repository/helix/helix-term/src/application.rs:299:57
  21: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/future/mod.rs:91:19
  22: helix_term::application::Application::run::{{closure}}
             at /home/vikas/Repository/helix/helix-term/src/application.rs:1108:38
  23: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/future/mod.rs:91:19
  24: hx::main_impl::{{closure}}
             at /home/vikas/Repository/helix/helix-term/src/main.rs:157:53
  25: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/future/mod.rs:91:19
  26: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/tokio-1.27.0/src/runtime/park.rs:283:63
  27: tokio::runtime::coop::with_budget
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/tokio-1.27.0/src/runtime/coop.rs:107:5
  28: tokio::runtime::coop::budget
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/tokio-1.27.0/src/runtime/coop.rs:73:5
  29: tokio::runtime::park::CachedParkThread::block_on
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/tokio-1.27.0/src/runtime/park.rs:283:31
  30: tokio::runtime::context::BlockingRegionGuard::block_on
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/tokio-1.27.0/src/runtime/context.rs:315:13
  31: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/tokio-1.27.0/src/runtime/scheduler/multi_thread/mod.rs:66:9
  32: tokio::runtime::runtime::Runtime::block_on
             at /home/vikas/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/tokio-1.27.0/src/runtime/runtime.rs:304:45
  33: hx::main_impl
             at /home/vikas/Repository/helix/helix-term/src/main.rs:159:5
  34: hx::main
             at /home/vikas/Repository/helix/helix-term/src/main.rs:38:21
  35: core::ops::function::FnOnce::call_once
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Platform

Linux (Ubuntu 22.10)

Terminal Emulator

Default Ubuntu Terminal, I guess...

Helix Version

helix 23.03 (406c5c3)

@vikaskaliramna0 vikaskaliramna0 added the C-bug Category: This is a bug label Apr 2, 2023
@the-mikedavis
Copy link
Member

Could you post the log file created when this happens while running in verbose mode? (hx -v --log log.txt and then post that log.txt file. Also see https://github.com/helix-editor/helix/wiki/FAQ#access-the-log-file)

It sounds like the language server is sending an invalid edit when the end comes before the start. Fixing that is an upstream issue. The panic will be fixed by #6512 though

@vikaskaliramna0
Copy link
Author

The log file doesn't have anything more than a single typo that I made while running :quit command.

And I am not able to re-create that error today, I don't know if it's good thing or bad thing.
I didn't update helix or golang.

I remember updating dart and an unknown package that I don't know what it was.
I reinstalled ubuntu-desktop-minimal and changed my desktop environment because of some issue with desktop.

Don't know what fixed my editor.

@vikaskaliramna0
Copy link
Author

vikaskaliramna0 commented Apr 3, 2023

I am new to advanced stuff and I was try to implement bubble sort in go, wrote it so fast fluently without any mistakes and tried to saved.

Didn't save before because I forgot about this crashing, it crashed 😭

EDIT : Log file is empty :(

@the-mikedavis
Copy link
Member

You need to run in verbose mode with the -v flag. That will raise the log level, so the log file will contain the communication between Helix and the language server

@pascalkuthe
Copy link
Member

I am closing this as stale as not enough information (specifically a log file) was provided tomakw this actionable

@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants