git svn clone died of signal 11 on OSX
Asked Answered
G

3

13

I'm trying to migrate a project from svn to git. I was using the osx svn package, but I also tried installing with homebrew. I keep getting this same error.

git svn clone http://myserver/myrepo
error: git-svn died of signal 11

Version information:

git --version
git version 2.2.1

svn --version
svn, version 1.7.17 (r1591372)
   compiled Sep 18 2014, 13:06:44

I'm running Yosemite.

Gilbertson answered 30/1, 2015 at 1:52 Comment(3)
I would suggest uninstalling these, and just download XCode which has both git and svn in reasonably new versions.Lloyd
in case you installed git via brew before upgrading to yosemite you might need to update your git installation via brew (brew upgrade git) - there were yosemite-related fixes in brewRawlinson
What does git svn --version say? You have to do this in a git repository, doesn't matter which one.Mcnamee
M
11

git svn executes git-svn which is a Perl program which uses bindings to libsvn and those bindings are touchy. If Perl changes, or SVN changes, that could cause a segfault. Both could happen in an OS upgrade.

Find out which version of the SVN bindings your git is using. Here's what I get for OS X 10.10.1

$ /usr/bin/git svn --version
git-svn version 1.9.3 (Apple Git-50) (svn 1.7.17)

Try brew upgrade git as suggested by @MykolaGurov in the comments. It seems there are fixes for 10.10 and git-svn. You might also try brew reinstall subversion --with-perl to reinstall the Perl bindings.

Or use the OS X provided /usr/bin/git which will be built with the OS provided SVN and Perl.

Or try MacPorts, I use it and its git-svn works. port install git +svn.

Mcnamee answered 30/1, 2015 at 18:58 Comment(5)
reinstalling the Perl bindings after upgrading git worked like a charm. Thanks!Gilbertson
brew upgrade git and brew reinstall subversion --perl worked for meBolen
After OS X upgrade: If brew upgrade git says the newest version is already installed, and you still get signal 11, try brew uninstall git and then reinstall with brew install git.Saar
From the log when reinstalling subversion: subversion: --perl was deprecated; using --with-perl instead!.Jenaejenda
--perl/--with-perl no longer seem to be valid options.Digester
P
5

First thing to do, is to debug git command to see on which component it fails by adding GIT_TRACE=1, e.g.

$ GIT_TRACE=1 git svn clone https://example.com/svn/foo/ foo
21:12:40.239238 git.c:557               trace: exec: 'git-svn' 'clone' 'https://example.com/svn/foo/ foo/' 'foo'
21:12:40.240158 run-command.c:347       trace: run_command: 'git-svn' 'clone' 'https://example.com/svn/foo/ foo/' 'foo'
error: git-svn died of signal 11

and re-run the last command in the corrupted repository which shows that the crash happened in git-svn binary.

In order to do that, you need to identify where you've git-svn binary, e.g.

$ which -a git-svn
$ locate git-svn | grep git-svn$
/Applications/GitHub.app/Contents/Resources/git/libexec/git-core/git-svn
/Applications/SourceTree.app/Contents/Resources/git_local/libexec/git-core/git-svn
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-svn
/Library/Developer/CommandLineTools/usr/libexec/git-core/git-svn
/usr/local/libexec/git-core/git-svn
/usr/local/Cellar/git/1.8.4.1/libexec/git-core/git-svn
/usr/local/Cellar/git/2.4.0/libexec/git-core/git-svn

If you've multiple git-svn binaries, to find out which one is used, run:

sudo fs_usage -f exec | grep git

in another terminal before running the failing git command again.

Once you've identified which git-svn you run, run it directly like:

/usr/local/libexec/git-core/git-svn ...
/usr/local/Cellar/git/2.4.0/libexec/git-core/git-svn 

and it's most likely that it'll crash no matter which parameter you will specify, otherwise specify as shown from trace output.

Sometimes it maybe a symbolic link, so check where it points to, e.g.:

$ stat /usr/local/libexec/git-core/git-svn
  File: ‘/usr/local/libexec/git-core/git-svn’ -> ‘/Applications/GitHub.app/Contents/Resources/git/libexec/git-core/git-svn’

If that's the case, change the symbolic link to the one which is not crashing, e.g.

$ ln -vfs /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-svn /usr/local/libexec/git-core/git-svn 
‘/usr/local/libexec/git-core/git-svn’ -> ‘/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-svn’

Alternatively identify to which package your git-svn belongs to and upgrade accordingly, e.g.

  • /Applications/Xcode.app -> upgrade Xcode,
  • /Applications/GitHub.app -> upgrade GitHub app
  • /usr/local/Cellar/git -> upgrade git via Homebrew, e.g.

    brew upgrade git
    

    If Homebrew will complain about the file conflicts, then run:

    brew link --overwrite git
    

If you still crashing after upgrade, use different version (as mentioned above) which doesn't crash, e.g.

/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-svn clone https://example.com/svn/foo/ foo

If that works for you, add to your PATH and later on use git-svn command instead, or add an alias, e.g.:

alias git-svn='/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-svn'

If you got any missing dependencies for the new git-svn, install Git::SVN by running:

sudo cpan install Git::SVN

Debugging

If above won't help, you may debug it further more. Here are some suggestions to run in separate terminal, then in run the failing command:

sudo dtruss -fn git

or:

sudo dtruss -fn git-svn

To identify which git-svn is called, you may try:

  • sudo /usr/bin/newproc.d
  • sudo fs_usage -f exec | grep git
Plott answered 18/3, 2016 at 22:27 Comment(0)
K
0

My case was different. I specified credentials in the https url to my svn repo. Removing the credentials solved the issue.

How I ran the command

git svn https://<key>:<pass>@example.com/repo

removed key/pass and the command passes.

Kuhl answered 8/2, 2021 at 9:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.