cargo 1.67+ doesn't support long file names in Windows headless session #11710
Labels
C-bug
Category: bug
O-windows
OS: Windows
regression-from-stable-to-stable
Regression in stable that worked in a previous stable release.
S-blocked-external
Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix
Problem
cargo clean, cargo tree, cargo build, etc. generates panic
thread 'main' panicked at 'range end index 270 out of range for slice of length 260',
C:\Users\runneradmin\.cargo\registry\src\git.luolix.top-1ecc6299db9ec823\is-terminal-0.4.0\src\lib.rs:169:14
stack backtrace:
0: 0x7ff6d75f5db2 - git_midx_writer_dump
1: 0x7ff6d761b89b - git_midx_writer_dump
2: 0x7ff6d75ecb4a - git_midx_writer_dump
3: 0x7ff6d75f5afb - git_midx_writer_dump
4: 0x7ff6d75f8ef9 - git_midx_writer_dump
5: 0x7ff6d75f8b7b - git_midx_writer_dump
6: 0x7ff6d75f9791 - git_midx_writer_dump
7: 0x7ff6d75f951e - git_midx_writer_dump
8: 0x7ff6d75f6aaf - git_midx_writer_dump
9: 0x7ff6d75f91d0 - git_midx_writer_dump
10: 0x7ff6d76ae435 - git_midx_writer_dump
11: 0x7ff6d761e267 - git_midx_writer_dump
12: 0x7ff6d76ae959 - git_midx_writer_dump
13: 0x7ff6d74a4659 - git_midx_writer_dump
14: 0x7ff6d6cc7087 - git_libgit2_prerelease
15: 0x7ff6d6cc15ba - git_libgit2_prerelease
16: 0x7ff6d6cc1499 - git_libgit2_prerelease
17: 0x7ff6d6c3f8c7 - git_libgit2_prerelease
18: 0x7ff6d6cb77be - git_libgit2_prerelease
19: 0x7ff6d6c34e16 - git_libgit2_prerelease
20: 0x7ff6d6c44c2c - git_libgit2_prerelease
21: 0x7ff6d75e4f0e - git_midx_writer_dump
22: 0x7ff6d6cba51c - git_libgit2_prerelease
23: 0x7ff6d7624ee0 - git_midx_writer_dump
24: 0x7ffb5eb184d4 - BaseThreadInitThunk
25: 0x7ffb60ca1791 - RtlUserThreadStart
Steps
Possible Solution(s)
Switch to version 1.66.0
Notes
Normal Windows command line Session works fine.
Problem lies in is_terminal:0.4.0, which failed if real terminal is not available.
The problem is related to the badly supported long file names:
260 is a MAX_PATH, and we have really long paths.
thread 'main' panicked at 'range end index 270 out of range for slice of length 260'
code```
The text was updated successfully, but these errors were encountered: