Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git/cygwin silent failure

Tags:

git

cygwin

I've got a personal/private repository on bitbucket that I'm trying to clone. When I clone from an Ubuntu box, I am able to clone the repository:

$ git clone https://<user>@bitbucket.org/<user>/<repo>.git
Cloning into '<repo>'...
Password for 'https://<user>@bitbucket.org':
remote: Counting objects: 586, done.
remote: Compressing objects: 100% (519/519), done.
remote: Total 586 (delta 65), reused 583 (delta 65)
Receiving objects: 100% (586/586), 2.55 MiB | 650 KiB/s, done.
Resolving deltas: 100% (65/65), done.

However, when I try the same command from cygwin, I get a silent failure:

$ git clone -v --progress https://<user>@bitbucket.org/<user>/<repo>.git
Cloning into <repo>...

And then git exits. I've spent an hour trying to track this down, but silent errors are kind of hard to google.

Things I've tried:

  • reinstalling git in cygwin
  • downgrading git in cygwin
  • removing and rebuilding the .gitconfig file
  • echo $? prints 141 (possibly relating to SIGPIPE?)
  • setting GIT_CURL_VERBOSE did not produce any added output

note: git version is 1.7.5.1

Does anyone have any insight into what might be going on here?

edit/update

After finding no solution to the problem, I did a complete reinstall of cygwin and the problem seems to have gone away.

like image 920
Andrew Prock Avatar asked Mar 02 '13 16:03

Andrew Prock


2 Answers

As a workaround, consider install Github for Windows, right-clicking in Explorer the directory where you want to clone, and choosing Git Bash here. Then, clone the repository using Git Bash. What's nice is that Cygwin git, Github for Windows, and Git Bash can all access the same repository (they are interacting with the same .git directory), so they won't clobber each other. If clone in Git Bash succeeds, you may be able to do regular operations in Cygwin.

A fourth option for getting a working git in that directory is to use vagrant.

like image 26
Dan Kohn Avatar answered Oct 21 '22 16:10

Dan Kohn


I had this issue, and for me it turned out to be a dodgy version of cygcurl-4.dll I'd compiled and installed to /usr/local/bin. I deleted that file, and now git works.

The particulars of my fix may be different for others, but this is how I went about debugging. There is now a basic version of strace for Cygwin, I'm not sure what package it came from though.

To track spawning of child processes (among other things), I used strace --mask=sigp git clone https://github.com/<user>/<repo>.git. Looking through, I found this block:

--- Process 12224 created
  922    5807 [main] git 11849! child_info_spawn::worker: new process name \\?\C:\cygwin64\usr\libexec\git-core\git-remote-https.exe
--- Process 12224 loaded C:\Windows\System32\ntdll.dll at 0000000077830000
   25    5832 [main] git 11849! child_info_spawn::worker: spawned windows pid 12224
   41    5873 [main] git 11849! child_info::sync: n 2, waiting for subproc_ready(0x188) and child process(0x178)
--- Process 12224 loaded C:\Windows\System32\kernel32.dll at 0000000077610000
--- Process 12224 loaded C:\Windows\System32\KernelBase.dll at 000007fefd870000
--- Process 12224 loaded C:\cygwin64\usr\local\bin\cygcurl-4.dll at 0000000482aa0000
--- Process 12224 loaded C:\cygwin64\bin\cygcrypto-1.0.0.dll at 00000003d5120000
--- Process 12224 loaded C:\cygwin64\bin\cygwin1.dll at 0000000180040000
--- Process 12224 loaded C:\cygwin64\bin\cygz.dll at 00000003b0490000
--- Process 12224 loaded C:\cygwin64\bin\cygrtmp-0.dll at 00000003ac650000
--- Process 12224 loaded C:\cygwin64\bin\cygssl-1.0.0.dll at 00000003ab640000
--- Process 12224 loaded C:\cygwin64\bin\cygssh2-1.dll at 00000003ab6b0000
--- Process 12224, exception c0000139 at 00000000778f8078
--- Process 12224 exited with status 0xc0000139

After that comes all the exit cleanup. So the problem occurs during DLL loading for /usr/libexec/git-core/git-remote-https.exe. Cygwin usually doesn't tell you much about these errors, but if you launch the program "with Windows", it'll show an error box.

cygstart /usr/libexec/git-core/git-remote-https.exe pops up a box that says

The procedure entry point curl_global_sslset could not be located
in the dynamic link library cygcurl-4.dll.

Checking which libraries it's trying to load with cygcheck /usr/libexec/git-core/git-remote-https.exe:

C:\cygwin64\usr\libexec\git-core\git-remote-https.exe
  C:\cygwin64\usr\local\bin\cygcurl-4.dll
    C:\cygwin64\bin\cygcrypto-1.0.0.dll
      C:\cygwin64\bin\cygwin1.dll
        C:\Windows\system32\KERNEL32.dll
          C:\Windows\system32\ntdll.dll
          C:\Windows\system32\KERNELBASE.dll

          (... many more Windows 7 DLLs ...)

      C:\cygwin64\bin\cygz.dll
    C:\cygwin64\bin\cygrtmp-0.dll
      C:\cygwin64\bin\cygssl-1.0.0.dll
    C:\cygwin64\bin\cygssh2-1.dll
  C:\cygwin64\bin\cygiconv-2.dll
  C:\cygwin64\bin\cygintl-8.dll

So the manually installed C:\cygwin64\usr\local\bin\cygcurl-4.dll is a very likely candidate, and deleting it fixed the issue for me.

like image 79
Tim__K Avatar answered Oct 21 '22 15:10

Tim__K