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 if double colon is input in path when changing directory #1557

Closed
ChimpSpin opened this issue Jan 22, 2022 · 2 comments · Fixed by #5570
Closed

Crash if double colon is input in path when changing directory #1557

ChimpSpin opened this issue Jan 22, 2022 · 2 comments · Fixed by #5570
Labels
C-bug Category: This is a bug upstream

Comments

@ChimpSpin
Copy link

Reproduction steps

Open hx.
type :cd c::

The error
thread 'main' panicked at 'range start index 2 out of range for slice of length 0', library\std\src\path.rs:713:24
stack backtrace:
   0:     0x7ff6bee7e459 - <unknown>
   1:     0x7ff6be8958ba - <unknown>
   2:     0x7ff6bee78208 - <unknown>
   3:     0x7ff6bee81bb2 - <unknown>
   4:     0x7ff6bee81652 - <unknown>
   5:     0x7ff6bed443ab - <unknown>
   6:     0x7ff6bee822b7 - <unknown>
   7:     0x7ff6bee81de5 - <unknown>
   8:     0x7ff6bee7f687 - <unknown>
   9:     0x7ff6bee81d4f - <unknown>
  10:     0x7ff6bef01f90 - <unknown>
  11:     0x7ff6bef02127 - <unknown>
  12:     0x7ff6bee7a1fd - <unknown>
  13:     0x7ff6bee7a002 - <unknown>
  14:     0x7ff6bee7bd5a - <unknown>
  15:     0x7ff6beac3aad - <unknown>
  16:     0x7ff6bead8c6f - <unknown>
  17:     0x7ff6beb3e66c - <unknown>
  18:     0x7ff6bea62b24 - <unknown>
  19:     0x7ff6bea6ae39 - <unknown>
  20:     0x7ff6bea6ccb8 - <unknown>
  21:     0x7ff6beafba1b - <unknown>
  22:     0x7ff6bec33a1c - <unknown>
  23:     0x7ff6bed3e1b6 - <unknown>
  24:     0x7ff6bed4d468 - <unknown>
  25:     0x7ff6bed210b6 - <unknown>
  26:     0x7ff6bed37a6f - <unknown>
  27:     0x7ff6bed3c224 - <unknown>
  28:     0x7ff6bed23d5e - <unknown>
  29:     0x7ff6bed1b116 - <unknown>
  30:     0x7ff6bed38ffa - <unknown>
  31:     0x7ff6bee7debc - <unknown>
  32:     0x7ff6bed24127 - <unknown>
  33:     0x7ff6beefddac - <unknown>
  34:     0x7ff838da7034 - BaseThreadInitThunk
  35:     0x7ff839ae2651 - RtlUserThreadStart

Environment

  • Platform: Windows
  • Terminal emulator: PowerShell
  • Helix version: v0.5.0-395-g0b55b21
@ChimpSpin ChimpSpin added the C-bug Category: This is a bug label Jan 22, 2022
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Jan 22, 2022
@sudormrfbin
Copy link
Member

I cannot reproduce this on Linux with v0.5.0-432-g7d510429, so this might be Windows specific.

@archseer archseer added the O-windows Operating system: Windows label Jan 23, 2022
@TrueBers
Copy link

Confirm the issue.

But it's not Windows specific, it's from the Rust upstream.

There was a panic in Path::strip_prefix if both the path and the prefix have the same value like at the line:

path.strip_prefix(&dir).unwrap_or(path).to_path_buf()

Fixed in rust-lang/rust#93675, scheduled for 1.62 stable.

@the-mikedavis the-mikedavis added upstream and removed A-helix-term Area: Helix term improvements labels Jun 20, 2022
@the-mikedavis the-mikedavis removed the O-windows Operating system: Windows label Jun 28, 2022
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 upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants