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

Consistent hard crash on windows when started from nushell #8821

Closed
chtenb opened this issue Nov 15, 2023 · 10 comments · Fixed by #10039
Closed

Consistent hard crash on windows when started from nushell #8821

chtenb opened this issue Nov 15, 2023 · 10 comments · Fixed by #10039
Labels
A-language-support Area: Support for programming/text languages C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much

Comments

@chtenb
Copy link
Contributor

chtenb commented Nov 15, 2023

Summary

When editing the attached file in a specific way this gives a crash without any errors. Only seems to happen on windows when Helix is started from nushell.

crash.md

Reproduction Steps

I tried this:

  1. Open a terminal and start nu shell: nu
  2. $env.RUST_BACKTRACE = 1 (per instructions for detailed logging)
  3. hx -vv -c /dev/null crash.md (open attached crashing file in hx with default config)
  4. :100 (goto line 100)
  5. o (open a new line)
  6. start typing a moderate length sentence

This happened
image

Let me know if I can help trouble shooting. I'm compiling from source, so I can easily add compilation flags or something. But I'm no Rust programmer nor have I a debugger installed/setup.

Helix log

~/.cache/helix/helix.log
2023-11-15T11:16:16.288 helix_view::editor [ERROR] Failed to initialize the language servers for `source.md` - `marksman` { cannot find binary path }
2023-11-15T11:16:16.296 helix_view::editor [DEBUG] editor status: Loaded 1 file.
2023-11-15T11:16:16.296 helix_tui::backend::crossterm [DEBUG] The keyboard enhancement protocol is not supported in this terminal (checked in 0ns)
2023-11-15T11:16:16.298 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:16.302 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:16.527 helix_term::application [DEBUG] received editor event: IdleTimer
2023-11-15T11:16:17.705 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:17.913 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:17.960 helix_term::application [DEBUG] received editor event: IdleTimer
2023-11-15T11:16:17.997 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:18.141 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:18.326 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:20.702 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:20.940 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:21.095 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:21.158 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:21.189 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:21.200 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:21.231 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:21.236 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:21.288 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-15T11:16:21.300 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0```

Platform

Windows 11

Terminal Emulator

wezterm, cmd.exe

Installation Method

compiled from source

Helix Version

a98ad13

@chtenb chtenb added the C-bug Category: This is a bug label Nov 15, 2023
@pascalkuthe
Copy link
Member

what is the crash/panic message and backtrace?

@chtenb
Copy link
Contributor Author

chtenb commented Nov 15, 2023

I see none. The screenshot is what I see when the issue is triggered, and the log file contains what is posted in the OP.

@chtenb
Copy link
Contributor Author

chtenb commented Nov 16, 2023

I can only reproduce this issue so far in markdown files when adding lines in deeply-enough nested lists. This could suggest it is related to indent queries. I'm still surprised I don't get to see some form of error message.

@pascalkuthe
Copy link
Member

its probably the markdown grammar causing a segmentation fault (or TS itself)

@chtenb
Copy link
Contributor Author

chtenb commented Nov 17, 2023

I found a smaller repro.

  1. Open Helix
  2. :set-language markdown
  3. Enter the following text.
- test
  - test
    - test

This crashes when typing it. However, when you enter this text in another text editor and then open it with helix, it does not crash immediately. Only after you enter insert mode and start extending the last line.

@CptPotato
Copy link
Contributor

CptPotato commented Nov 24, 2023

I can't reproduce with either repro case on Win10 with nushell. But it's possible that my grammars aren't up to date.

Edit: Actually, I can reproduce it now after rebasing onto latest master. This must have been a pretty recent change.

It crashes regardless of the shell (nushell or cmd). I don't get a stack trace either, and windows reports the crash as 0xc0000374 heap corruption.

@pascalkuthe
Copy link
Member

pascalkuthe commented Nov 24, 2023

@CptPotato what commit were you using before? It could be a dependency bump or if you were using the stable release before a tree-sitter issue (most likely imo)

@gabydd
Copy link
Member

gabydd commented Nov 26, 2023

ah I think this crash is probably from this tree-sitter-grammars/tree-sitter-markdown#114, should just be able to update the markdown grammar to fix it

@kirawi
Copy link
Member

kirawi commented Jan 23, 2024

I think we can update to 1.7 since it seems to include the fix.

@kirawi kirawi added E-easy Call for participation: Experience needed to fix: Easy / not much A-language-support Area: Support for programming/text languages labels Jan 23, 2024
lytedev added a commit to lytedev/helix that referenced this issue Mar 29, 2024
@lytedev
Copy link
Contributor

lytedev commented Mar 29, 2024

Did you mean 0.1.7? Looks like the grammar is up to 0.2.3 now. Would this just look like bumping the rev for the markdown treesitter grammar? If so, I've submitted this PR #10039

Please let me know if I screwed anything up <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants