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

Crash when using '*' at the end of a file #12634

Closed
5quiwyrm opened this issue Jan 22, 2025 · 3 comments
Closed

Crash when using '*' at the end of a file #12634

5quiwyrm opened this issue Jan 22, 2025 · 3 comments
Labels
C-bug Category: This is a bug

Comments

@5quiwyrm
Copy link

Summary

As the title suggests, helix crashes when you use * at the end of a file (the "ghost" character at the end, labelled ~ at the end of the file.
Full error:

thread 'main' panicked at C:\Users\runneradmin/.cargo\registry\src\index.crates.io-6f17d22bba15001f\ropey-1.6.1\src\slice.rs:492:13:
Attempt to index past end of slice: char index 2, slice char length 2
stack backtrace:
   0:     0x7ff640e0d313 - <unknown>
   1:     0x7ff63fde371a - <unknown>
   2:     0x7ff640e07577 - <unknown>
   3:     0x7ff640e0d145 - <unknown>
   4:     0x7ff640e0fdf0 - <unknown>
   5:     0x7ff640e0fbd5 - <unknown>
   6:     0x7ff640e104d2 - <unknown>
   7:     0x7ff640e10319 - <unknown>
   8:     0x7ff640e0de1f - <unknown>
   9:     0x7ff640e0ff0e - <unknown>
  10:     0x7ff640ef9f11 - <unknown>
  11:     0x7ff64087dbdd - <unknown>
  12:     0x7ff6406ee227 - <unknown>
  13:     0x7ff64087d4ad - <unknown>
  14:     0x7ff6408b4397 - <unknown>
  15:     0x7ff6408b42c0 - <unknown>
  16:     0x7ff6408b6f2a - <unknown>
  17:     0x7ff6408a509b - <unknown>
  18:     0x7ff640b674d4 - <unknown>
  19:     0x7ff640b80b06 - <unknown>
  20:     0x7ff640bf6201 - <unknown>
  21:     0x7ff640c3e5d6 - <unknown>
  22:     0x7ff640c24b1b - <unknown>
  23:     0x7ff640c0d246 - <unknown>
  24:     0x7ff640c0d1aa - <unknown>
  25:     0x7ff640dff8d0 - <unknown>
  26:     0x7ff640c24cbc - <unknown>
  27:     0x7ff640ef3e9c - <unknown>
  28:     0x7ffecc20259d - BaseThreadInitThunk
  29:     0x7ffecd34af38 - RtlUserThreadStart

This happens when I try navigate to the end of a file and press *.

Reproduction Steps

I am unable to provide an asciinema without doxxing myself.

  1. hx (this open a scratch, but this works with any file)
  2. gegll
  3. *

I expected there to be no character set to /, but instead helix crashes.

Helix log

2025-01-22T20:25:10.898 globset [DEBUG] glob converted to regex: Glob { glob: "*/Dockerfile.*", re: "(?-u)^.*/Dockerfile\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('D'), Literal('o'), Literal('c'), Literal('k'), Literal('e'), Literal('r'), Literal('f'), Literal('i'), Literal('l'), Literal('e'), Literal('.'), ZeroOrMore]) }
2025-01-22T20:25:10.899 globset [DEBUG] glob converted to regex: Glob { glob: "*/dockerfile.*", re: "(?-u)^.*/dockerfile\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('d'), Literal('o'), Literal('c'), Literal('k'), Literal('e'), Literal('r'), Literal('f'), Literal('i'), Literal('l'), Literal('e'), Literal('.'), ZeroOrMore]) }
2025-01-22T20:25:10.899 globset [DEBUG] glob converted to regex: Glob { glob: "*/Containerfile.*", re: "(?-u)^.*/Containerfile\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('C'), Literal('o'), Literal('n'), Literal('t'), Literal('a'), Literal('i'), Literal('n'), Literal('e'), Literal('r'), Literal('f'), Literal('i'), Literal('l'), Literal('e'), Literal('.'), ZeroOrMore]) }
2025-01-22T20:25:10.899 globset [DEBUG] glob converted to regex: Glob { glob: "*/containerfile.*", re: "(?-u)^.*/containerfile\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('c'), Literal('o'), Literal('n'), Literal('t'), Literal('a'), Literal('i'), Literal('n'), Literal('e'), Literal('r'), Literal('f'), Literal('i'), Literal('l'), Literal('e'), Literal('.'), ZeroOrMore]) }
2025-01-22T20:25:10.899 globset [DEBUG] glob converted to regex: Glob { glob: "*/.*ignore", re: "(?-u)^.*/\\..*ignore$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), ZeroOrMore, Literal('i'), Literal('g'), Literal('n'), Literal('o'), Literal('r'), Literal('e')]) }
2025-01-22T20:25:10.899 globset [DEBUG] glob converted to regex: Glob { glob: "*/BUILD.*", re: "(?-u)^.*/BUILD\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('B'), Literal('U'), Literal('I'), Literal('L'), Literal('D'), Literal('.'), ZeroOrMore]) }
2025-01-22T20:25:10.899 globset [DEBUG] glob converted to regex: Glob { glob: "*/.env.*", re: "(?-u)^.*/\\.env\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), Literal('e'), Literal('n'), Literal('v'), Literal('.'), ZeroOrMore]) }
2025-01-22T20:25:10.899 globset [DEBUG] glob converted to regex: Glob { glob: "*/.envrc.*", re: "(?-u)^.*/\\.envrc\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), Literal('e'), Literal('n'), Literal('v'), Literal('r'), Literal('c'), Literal('.'), ZeroOrMore]) }
2025-01-22T20:25:10.899 globset [DEBUG] glob converted to regex: Glob { glob: "*/conf/*/*.{inc,conf}", re: "(?-u)^.*/conf/.*/.*\\.(?:conf|inc)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('c'), Literal('o'), Literal('n'), Literal('f'), Literal('/'), ZeroOrMore, Literal('/'), ZeroOrMore, Literal('.'), Alternates([Tokens([Literal('c'), Literal('o'), Literal('n'), Literal('f')]), Tokens([Literal('i'), Literal('n'), Literal('c')])])]) }
2025-01-22T20:25:10.899 globset [DEBUG] glob converted to regex: Glob { glob: "*/Jenkinsfile.*", re: "(?-u)^.*/Jenkinsfile\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('J'), Literal('e'), Literal('n'), Literal('k'), Literal('i'), Literal('n'), Literal('s'), Literal('f'), Literal('i'), Literal('l'), Literal('e'), Literal('.'), ZeroOrMore]) }
2025-01-22T20:25:10.899 globset [DEBUG] built glob set; 1 literals, 0 basenames, 0 extensions, 0 prefixes, 143 suffixes, 11 required extensions, 10 regexes
2025-01-22T20:25:10.909 helix_tui::backend::crossterm [DEBUG] The keyboard enhancement protocol is not supported in this terminal (checked in 200ns)
2025-01-22T20:25:10.909 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2025-01-22T20:25:10.916 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2025-01-22T20:25:11.162 helix_term::application [DEBUG] received editor event: IdleTimer
2025-01-22T20:25:11.320 helix_term::application [DEBUG] received editor event: Redraw
2025-01-22T20:25:11.322 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2025-01-22T20:25:11.460 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2025-01-22T20:25:11.718 helix_term::application [DEBUG] received editor event: IdleTimer
2025-01-22T20:25:11.861 helix_term::application [DEBUG] received editor event: Redraw
2025-01-22T20:25:11.863 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0

This is the entire helix.log section for the crash. I hope this is sufficient.

Platform

Windows

Terminal Emulator

Windows Powershell

Installation Method

Releases page

Helix Version

helix 25.1 (dabfb6c)

@5quiwyrm 5quiwyrm added the C-bug Category: This is a bug label Jan 22, 2025
@RoloEdits
Copy link
Contributor

This was fixed with #12611

@5quiwyrm
Copy link
Author

Thank you for notifying. Is this change pushed to the current version?

@RoloEdits
Copy link
Contributor

I believe its on master only.

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

2 participants