git svn clone died of signal 11 on OSX

左心房为你撑大大i 提交于 2020-01-14 07:04:06

问题


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.


回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/28228016/git-svn-clone-died-of-signal-11-on-osx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!