-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
"git status" crashes in repositories with long file paths #2494
Comments
Please do spend an effort in creating an MCVE. For all I know, this could be caused by your CPU and not reproducible here at all. |
You are welcome :-) |
The only thing that fails here is the checkout part of git clone. |
You need to set core.longpaths to true, as described in the Details of the issue |
Where? @default0 you could really make this easier for the people you ask for help. Please do so. |
Added the entry to the first set of commands |
Okay, this is not going to work. First of all, this is an open source project, not "your product". Second of all, you are asking for help. Because like it or not, there will be another set of security fixes like in v2.24.1, and then you will be forced to upgrade, or stay vulnerable. So it is in your interest to have this fixed. Further this attitude that you are doing others a favor by telling them what is wrong with their code that you are happily using without even saying thanks, this attitude is not friendly. We do want a friendly place over here, though, because otherwise everybody would have a foul time and the project would die. So let's avoid that, okay? |
Since this ticket took such an unpleasant turn, I will spend the rest of my work time today elsewhere. |
I faced the same issue on Windows 10 with the last version of GIT. Today I spent a lot of time trying to find a problem on my system and had despaired, then found this issue. As TS suggests above, I have downgraded git to v2.24.1 and now everything works fine. |
@lexeek an MCVE would be helpful: a small list of commands that initializes a new, tiny Git worktree and that reproduces the issue. |
@dscho Hm, I will try to emulate this error with a new git repo, but can't do it with the current project, the problem is the size of the repo more than 60Gb (C++ project with lots of models) and it takes time to reproduce. |
Sounds good. Thank you! |
I see this problem too for one of our projects with long filepaths. The minimal repro posted by @default0 reproduces it for me as well. $ git --version
git version 2.25.0.windows.1
$ git status
Illegal instruction My OS: Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, ServicePackMajorVersion, OSArchitecture
Caption Version ServicePackMajorVersion OSArchitecture
------- ------- ----------------------- --------------
Microsoft Windows 10 Pro 10.0.18363 0 64-Bit |
@henrik-m unfortunately, it does not reproduce here, most likely because the repro is actually not complete: it assumes that you already have a repository/worktree with a certain shape, but it is totally unclear what that shape would be, so people like me (who would be quite capable of debugging this, given a complete repro) are set up to fail. Therefore, if you can figure out an easy repro that is complete (i.e. that will reproduce the bug also on my machine), that would be quite helpful. |
@dscho I managed to reproduce this on a fresh Azure cloud VM based on a public VM image. What I did:
[diff "astextplain"]
textconv = astextplain
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[http]
sslBackend = schannel
[core]
autocrlf = input
fscache = true
symlinks = true
longpaths = true
[credential]
helper = manager
git clone https://github.com/default0/GitForWindowsBugRepro
|
Excellent! Cloning now. |
This is an outstanding MCVE, @henrik-m! Thank you:
|
In 4d3d891 (squash! Win32: add a cache below mingw's lstat and dirent implementations, 2013-10-01), we adjusted the FSCache feature to accommodate for the `en/fill-directory-fixes` patches, which insist on POSIX-like semantics where `struct dirent`'s `name` entry must be a `char` array and cannot be a `char` pointer. However, when squashing this adjustment into the appropriate patch during the nex rebase (which resulted in 1fcade1 (mingw: add a cache below mingw's lstat and dirent implementations, 2013-10-01)), this developer failed to split out the `MAX_LONG_PATH` part into the appropriate patch but by mistake dropped it instead. This patch fixes that, addressing git-for-windows#2494. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was a little bit tricky to debug, as the symptom did not reproduce in debug builds, and even DrMemory (at least in the version I have over here) could not help diagnose it because it crashed with an internal bug. The good news is that I think I found the culprit, and it was rather easy to fix. I put up a PR and will merge it as soon as the PR build passes (I deem it too obvious a fix to require a whole lot of reviews). |
Nice! Thank you for addressing this so quickly. |
@dscho Tested it on the cloud VM and then on my work PC where I originally encountered the problem. The error went away on both machines. Thank you very much! |
@henrik-m thank you so much for speedy testing and quick responses! |
I'm glad I could help. |
This was reported and fixed in #1111 but recently seems to have regressed.
Setup
64-bit, 2.25.0
Windows 10 64-bit
defaults?
to the issue you're seeing?
See details
Details
Git Bash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
The status of the repository was shown
The command crashed and wrote "Illegal instruction" instead
URL to that repository to help us with testing?
I cannot provide a URL to the repository, however the issue is relating to long file paths.
The repository contains files with paths that exceed a length of 260 characters.
I have core.longpaths (or w/e the option was called) set to true, deleting all files in the repository that have filenames longer than 260 characters fixes the issue.
This is a regression from 2.24.1.2 because in that version, the same repository works just fine.
The text was updated successfully, but these errors were encountered: