-
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
2.12.2: git status
crashes in repository with long paths
#1111
Comments
FWIW, I also observe failures upon git status, since installing 2.12.2 today. It only happens in one repository, where checkout contains long paths. As before, I use 64bit version. OS is win 8.1 When uninstalling and using 2.12.1 instead, everything is fine again. |
I think I don't see the "Segmentation fault" output when I'm running from |
I have a simular problem it seems with this git version and my IDEA. Witch points to this. |
We have a repo where "git status" after particular branch is checked out immediately causes "Segmentation fault" error. Of course the repo is huge and very much private, so I cannot publish it as a repro for the bug. 2.12.1 does not expose that problem. We'll try to debug it on our end, but we only have Microsoft stack devs around here and don't know how to build debug version of Git from sources. If somebody could help us with the version which does debug memory allocations and as much tracing as possible we can run it against our repo and send back the results. |
Same bug in Microsoft Windows [Version 10.0.15063] (MINGW64、IDEA 2017.1) with git 2.12.1 version, install 2.11.1 resolved |
I'm also seeing this issue. Additionally, viewing the log using TortoiseGit would report "Failed to get UnRevFileList". Reverting to 2.12.1 fixed both the "git status" and Tortoise log issues. |
I don't know if this is the problem but I am getting this in some repos but not others. In name-hash.c, handle_range_dir(), the line |
I don't get a crash but I am getting a "Segmentation fault" error in only one repo. I am on Windows 10, it's a new machine which I installed Git for Windows 64-bit on (git --version = 2.12.2.windows.1) all with default settings. If you need any more info please let me know. |
As reported by Konste above, we've been debugging this issue, unfortunately with no symbols. Our findings are very similar to tpaxatb above: strncmp() causes an Access Violation because the source address is invalid. First argument is null + offset, so it is 0x58 instead of + 0x58. The strncmp is using: First argument: 0x58 The call stack is not very helpful since we don't have GIT symbols: Call Site00 ntdll!strncmp Just in case, we enabled Full Page Heap. ANALYSIS After some reverse engineering, frame 2 seems to be related to handle_range_dir() and frame 1 seems to be related to handle_range_1(), specifically this line: static int handle_range_1(
frame 0 is stncmp() frame 2 has the content below, which pointed us to handle_range_dir(): 0000000001118BB7 0000000001118BBC 0000000001118BC8 0000000001118BD4 0000000001118BDE 0000000001118BE8 0000000001118BED 0000000001118B6E 0000000001118B70 0000000001118B84 0000000001118B89 0000000001118B8D 0000000001118B96 0000000001118BA0 0000000001118BA3 0000000001118BAB 0000000001118BB0 0000000001118BB5 frame 1 has this: 00000000011186DD mov rdx,qword ptr ss:[rsp+38] r9 000000002E985F68 "/Common/Access/Objects/Activation" r14+r12+8 = 0 (null) So r14+r12 = valid content Frame 0: In 64 bits the arguments are passed using @rcx, @RDX, @r8 and @r9 from left to right. So our strncmp() has: @rcx = 0x58 (0n88) Exception: ExceptionAddress: 00007ff840eaa439 (ntdll!strncmp+0x0000000000000049) |
I'm seeing this bug in 2.12.2, downgrade to 2.12.1 resolves the segmentation fault. My working copy does not have extraordinary long paths:
Reproduced on two machines with clones of the same repository. |
For people trying to debug this, have a look at Compiling Git with Visual Studio. The generated projects are for VS2015. |
Reverting back to the old 2.12.1 version and indeed the problem is solved. |
I think this is resolved by 59b761d |
I am currently uploading snapshots of 32-bit PortableGit, 64-bit PortableGit, 32-bit Git for Windows installer, and 64-bit Git for Windows installer. Could you please test at your convenience (probably using 64-bit PortableGit) that the commit I mentioned indeed fixes the issue? |
Ill test it right now (going to install it and test it on a huge repo with long paths in windows). I do not have debugging on so be warned. |
I tested the 64-bit portable version and "git status" and viewing the git log via Tortoise are both working fine now. |
No problems on my end. My IntelliJ intergration that was bugging out works fine now. |
Checked. Win7 64bit. |
This seems to have fixed the issue on my end too, especially with untracked files and large directory trees. |
Wonderful, thanks for all the feedback! And thank you, @kewillf for fixing this bug! |
What's ETA for 2.12.3? |
Your guess is as good as mine. If you are asking about the next Git for Windows release, though: as soon as I can convince myself that there are no other, critical bugs lurking. I want to get this out before the end of this week. |
Yes, of course! It is going to be 2.12.3, isn't it? |
No. The main part of Git for Windows' versions reflects the Git version on which it is based. It is unlikely that Git v2.12.3 will be released this week, but Git for Windows needs to be released to fix this problem (and a Git LFS related one we identified a couple of days ago). so it will most likely be v2.12.2(2). |
Ah, I got it now. Thanks for clarification. I keep pulling reins to prevent whole bunch of developers from upgrading their Git for Windows and need to know when I would be able to release it. |
A potential crash in `git status` with lots of files [was fixed](git-for-windows/git#1111). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@konste expect v2.12.2(2) Real Soon Now. |
@konste FYI v2.12.2(2) is available for download. |
@dscho Wow! It is even on Chocolatey already. Thank you for letting me know! I unleash all the devs waiting for it now. |
Setup
defaults?
I'll note that I've also reinstalled with
CURL Option: OpenSSL
and the crash remains.to the issue you're seeing?
The repository in question (URL provided at the end) has some very long paths. When the zip is unpacked to a "deep" directory,
git status
writes several lines like these:If I move it to a shorter path, like
C:\Temp\a
, these messages go away. With or without these "Filename too long" messages,git status
still crashes at the end.I have many other Git repositories, both bare and "normal" and
git status
runs without issue in them.Details
cmd
, Git Bash viacmd
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Status output
Git crashes with an access violation (seen in
cmd
) or a segmentation fault (seen from Git Bash, running incmd
).URL to that repository to help us with testing?
status-crash.zip
Unpack anywhere and run
git status
.git status
crashesgit status
runs without issue, listing a lot of deleted files with nothing staged for commit (the expected results)The text was updated successfully, but these errors were encountered: