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

Git 2.19.1 crashes while git gc in Windows #1866

Closed
1 task done
guoxiao opened this issue Oct 6, 2018 · 14 comments
Closed
1 task done

Git 2.19.1 crashes while git gc in Windows #1866

guoxiao opened this issue Oct 6, 2018 · 14 comments

Comments

@guoxiao
Copy link

guoxiao commented Oct 6, 2018

  • I was not able to find an open or closed issue matching what I'm seeing

I found previous issues like this which was fixed in 2.19.1, but git still crashes on my machine after I upgraded to the latest version.

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.19.1.windows.1
cpu: x86_64
built from commit: 11a3092e18f2201acd53e45aaa006f1601b6c02a
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.17134.320]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VIM
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: WinSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Enabled
Enable Builtin Rebase: Enabled
Enable Builtin Stash: Enabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I use powershell with poshgit plugin.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Powershell

git gc
  • What did you expect to occur after running these commands?

It works without error.

  • What actually happened instead?

It crashed with message:

Enumerating objects: 952556, done.
error: failed to run repack03/952556)
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

It occurs on a internal repo that I cannot share here. The crash dump file is here:
git.exe.14828.zip

I tried the latest snapshot at https://wingit.blob.core.windows.net/files/index.html but the error still exists.

@orgads
Copy link

orgads commented Oct 7, 2018

Happened to me too.

@dscho
Copy link
Member

dscho commented Oct 12, 2018

This looks quite similar to #1839 with the notable difference that this here ticket does not provide a Minimal, Complete & Verifiable Example. Could somebody provide one?

@dscho
Copy link
Member

dscho commented Nov 28, 2018

@orgads could you please come up with an MCVE? If there is no way to reproduce this reliably, we cannot fix this.

@orgads
Copy link

orgads commented Nov 28, 2018

Didn't have this so far with 2.19.2.

@dscho
Copy link
Member

dscho commented Nov 29, 2018

843931b was already integrated in v2.19.1. I do not see anything relevant to gc that is different between v2.19.1 and v2.19.2...

And the symptom really looks like the one of the bug fixed in said commit. So I am really at a loss here.

@orgads
Copy link

orgads commented Nov 29, 2018

Good point. I have no idea then. If it happens again, I'll try to investigate further.

@dscho
Copy link
Member

dscho commented Nov 29, 2018 via email

@Neumann-A
Copy link

Neumann-A commented Dec 12, 2018

seems the issue is still there:

C:\Sources\Repos\SVN\mpiThirdParty>git --version
git version 2.20.0.windows.1

C:\Sources\Repos\SVN\mpiThirdParty>git gc
Enumerating objects: 49480, done.
fatal: failed to run repack4/49480)

C:\Sources\Repos\SVN\mpiThirdParty>ver

Microsoft Windows [Version 6.1.7601]

If you tell me how to build git by hand using VS Code or Visual Studio (or CMake). I could try debugging it or finding out where exactly it crashes.
figured it out. Just checkout vs/master ;)

@Neumann-A
Copy link

Ausnahmefehler bei 0x0000000077122B04 (ntdll.dll) in git.exe: 0xC0000005: Zugriffsverletzung beim Schreiben an Position 0x0000000000000024
(Access violation exception for those who don't speak german)

If I pause git in the debugger i see the following in the main thread:
gitbug
other thread(s) just seems to wait.

I cannot see anything obviously wrong with it, so i need a little bit more help with debugging it.

@ikmplx
Copy link

ikmplx commented Dec 13, 2018

I can reproduce crash with following steps:

# Initialize repo
git init

# Generate 3.6 GB of pseudorandom data
cat /dev/zero | openssl enc -aes-128-ctr -pass pass:"qwerty" -nosalt | dd bs=1M count=3600 iflag=fullblock of=test

git add test
git repack

gdb stacktrace:

(gdb) run
Starting program: D:\git-sdk-64\usr\src\git\git.exe "--exec-path=D:/git-sdk-64/usr/src/git" pack-objects --delta-base-offset .git/objects/pack/.tmp-13040-pack --keep-true-parents --honor-pack-keep --non-empty --all --reflog --indexed-objects --unpacked --incremental
[New Thread 5004.0x23bc]
[New Thread 5004.0x2838]
[New Thread 5004.0x2124]
[New Thread 5004.0x33b4]
14:48:36.163521 exec-cmd.c:236          trace: resolved executable dir: D:/git-sdk-64/usr/src/git
14:48:36.167013 git.c:418               trace: built-in: git pack-objects --delta-base-offset .git/objects/pack/.tmp-13040-pack --keep-true-parents --honor-pack-keep --non-empty --all --reflog --indexed-objects --unpacked --incremental
[New Thread 5004.0x97c]

Enumerating objects: 1, done.
[Thread 5004.0x97c exited with code 0]
[New Thread 5004.0x16e4]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ffbb371d979 in ntdll!TpSetWait () from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb)
(gdb) bt
#0  0x00007ffbb371d979 in ntdll!TpSetWait ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbb37183e7 in ntdll!RtlEnterCriticalSection ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffbb3718300 in ntdll!RtlEnterCriticalSection ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x000000000047026c in oe_get_size_slow (pack=0x73fc20 <to_pack>,
    e=0x3684248) at builtin/pack-objects.c:1996
#4  0x000000000046ba17 in oe_set_size (pack=0x73fc20 <to_pack>, e=0x3684248,
    size=3774873600) at ./pack-objects.h:362
#5  0x000000000046f957 in check_object (entry=0x3684248)
    at builtin/pack-objects.c:1655
#6  0x000000000046ff53 in get_object_details () at builtin/pack-objects.c:1873
#7  0x0000000000471c01 in prepare_pack (window=10, depth=50)
    at builtin/pack-objects.c:2615
#8  0x00000000004746f5 in cmd_pack_objects (argc=0, argv=0x3670a08,
    prefix=0x0) at builtin/pack-objects.c:3491
#9  0x0000000000402e3b in run_builtin (p=0x680700 <commands+1728>, argc=11,
    argv=0x3670a08) at git.c:421
#10 0x00000000004031f6 in handle_builtin (argc=11, argv=0x3670a08)
    at git.c:653
#11 0x0000000000403421 in run_argv (argcp=0x136fdc0, argv=0x136fd68)
    at git.c:707
#12 0x000000000040382f in cmd_main (argc=11, argv=0x3670a08) at git.c:829
#13 0x00000000004bfa6f in main (argc=13, argv=0x36709f8) at common-main.c:45
$ git --version --build-options
git version 2.20.0.windows.1
cpu: x86_64
built from commit: 95155834166f64fe9666f2c0a4909f076080893a
sizeof-long: 4
sizeof-size_t: 8

@dscho
Copy link
Member

dscho commented Jan 18, 2019

Good news: this looks like it might be fixed by https://public-inbox.org/git/nycvar.QRO.7.76.6.1901181150450.41@tvgsbejvaqbjf.bet/T/#t.

@peteri
Copy link

peteri commented Feb 5, 2019

I've just run into the same issue, applying the patch mentioned by @dscho did fix the problem (although the linked thread suggests the patch needs a bit more work).
NOTE if you apply the same patch locally you'll need to make sure the patched version of git is in your path as the "git gc" respawns git (to run in the Visual Studio debugger I patched exec-cmd.c to hard code the path back to my git.exe so I could test)

@dscho
Copy link
Member

dscho commented Feb 6, 2019

@peteri thanks for testing. The patch advanced already to git.git's master and will therefore be part of v2.21.0. According to https://tinyurl.com/gitCal, Git v2.21.0-rc0 should be out today, let's see how fast I can publish a Git for Windows v2.21.0-rc0 after that.

@dscho dscho closed this as completed Feb 27, 2019
@dscho dscho added this to the v2.21.0 milestone Feb 27, 2019
@peteri
Copy link

peteri commented Apr 9, 2019

Just as an FYI 2.21.0 has fixed the particular GC problem I was seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants