{"thread":{"id":"34396","subject":"segmentation fault after successful completion of certain git svn commands","startedAt":"2013-07-10T10:51:16Z","lastAt":"2013-07-10T10:51:16Z","messageCount":1,"participants":["Friedrich Delgado"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"223006","messageId":"20130710105116.GA31645@rosita.dfn-cert.de","threadId":"34396","inReplyTo":null,"subject":"segmentation fault after successful completion of certain git svn commands","fromName":"Friedrich Delgado","fromEmail":"delgado@dfn-cert.de","sentAt":"2013-07-10T10:51:16Z","receivedAt":"2013-07-10T10:51:16Z","isPatch":false,"sender":{"key":"delgado@dfn-cert.de","avatar":null},"body":"Hi!\n\nI suspect I may have found a problem in the way git-svn uses SVN::Core\nthat leads to a segmentation fault. That's a hypothesis based on the\nfollowing incomplete findings:\n\ngit version 1.8.3.2.50.g531c8dd      (from recent git maint)\nsvn, version 1.7.10 (r1485443)       (from openSUSE 12.2)\nsubversion-perl-1.7.10-4.16.1.x86_64 (from openSUSE 12.2)\n\n,----[ ~/.subversion/config ]\n  [auth]\n  password-stores = kwallet\n  store-passwords = yes\n  store-ssl-client-cert-pp = yes\n`----\n\n~/.subversion/servers is set up to use a pkcs12 certificate for\ncertain projects.\n\nUnfortunately I'm not the administrator of the box, so I'd have to ask\nthe system administrator to install the debug packages for me if you\nneed a useful gdb backtrace. Maybe the following information helps, if\nnot, I'll see what I can do to provide a meaningful gdb backtrace.\n\nIn a git-svn checkout of such a project:\n\n,----[ redacted ]\n  > perl -d:Trace ~/anon-vc/git/git-svn rebase 2>&1|tail\n  >> /usr/lib/perl5/5.16.0/File/Temp.pm:895:                   @{ $dirs_to_unlink{$$} } : () );\n  >> /usr/lib/perl5/5.16.0/File/Temp.pm:896:       foreach my $dir (@dirs) {\n  >> /usr/lib/perl5/5.16.0/File/Temp.pm:908:       @{ $files_to_unlink{$$} } = ()\n  >> /usr/lib/perl5/5.16.0/File/Temp.pm:910:       @{ $dirs_to_unlink{$$} } = ()\n  >> /home/user/local/stow/git/lib/perl5/site_perl/5.16.0/Git/SVN.pm:1659:     unmemoize_svn_mergeinfo_functions();\n  >> /home/user/local/stow/git/lib/perl5/site_perl/5.16.0/Git/SVN.pm:1626:             return if not $memoized;\n  >> /home/user/local/stow/git/lib/perl5/site_perl/5.16.0/Git/SVN.pm:85:       unlink keys %LOCKFILES if %LOCKFILES;\n  >> /home/user/local/stow/git/lib/perl5/site_perl/5.16.0/Git/SVN.pm:86:       unlink keys %INDEX_FILES if %INDEX_FILES;\n  >> /usr/lib/perl5/vendor_perl/5.16.0/x86_64-linux-thread-multi/SVN/Core.pm:390:     $globaldestroy = 1;\n  >> /usr/lib/perl5/vendor_perl/5.16.0/x86_64-linux-thread-multi/SVN/Core.pm:58:     SVN::_Core::apr_terminate();\n  [1]    1631 segmentation fault (core dumped)  perl -d:Trace ~/anon-vc/git/git-svn rebase 2>&1 | \n         1632 done                              tail\n`----\n\n(The segfault will also occur after git svn clone.)\n\nIt appears that rebase and clone lead to correct results. An strace\nseems to indicate that the segfault occurs after a munmap.\n\n,----[ redacted ]\n  > strace -f git svn rebase 2>&1|tail -20\n  [pid  2355] rt_sigaction(SIGRT_32, NULL, {SIG_DFL, [], 0}, 8) = 0\n  [pid  2355] rt_sigaction(SIGABRT, NULL, {SIG_DFL, [], 0}, 8) = 0\n  [pid  2355] rt_sigaction(SIGCHLD, NULL, {0x7ff0c737d250, [], SA_RESTORER|SA_NOCLDSTOP, 0x7ff0d00a1140}, 8) = 0\n  [pid  2355] rt_sigaction(SIGIO, NULL, {SIG_DFL, [], 0}, 8) = 0\n  [pid  2355] rt_sigaction(SIGSYS, NULL, {SIG_DFL, [], 0}, 8) = 0\n  [pid  2355] futex(0x7ff0ca0372c0, FUTEX_WAKE_PRIVATE, 2147483647) = 0\n  [pid  2355] futex(0x7ff0ca037280, FUTEX_WAKE_PRIVATE, 2147483647) = 0\n  [pid  2355] futex(0x7ff0cab9a0a0, FUTEX_WAKE_PRIVATE, 2147483647) = 0\n  [pid  2355] write(6, \"XXXIXTAMPEREDXWITHXTHISXSTRINGXXXXXXX\"..., 37) = 37\n  [pid  2355] brk(0x30f7000)              = 0x30f7000\n  [pid  2355] close(6)                    = 0\n  [pid  2355] munmap(0x7ff0c7940000, 2113920) = 0\n  [pid  2355] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x7ff0c7941df0} ---\n  [pid  2355] +++ killed by SIGSEGV (core dumped) +++\n  <... wait4 resumed> [{WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV && WCOREDUMP(s)}], 0, NULL) = 2355\n  --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_DUMPED, si_pid=2355, si_status=SIGSEGV, si_utime=22, si_stime=95} ---\n  write(2, \"error: git-svn died of signal 11\"..., 33error: git-svn died of signal 11\n  ) = 33\n  exit_group(139)                         = ?\n  +++ exited with 139 +++\n`----\n\n(both traces were edited a bit by me)\n\nMaybe the following two urls I found are related or helpful:\n\nhttp://bugs.debian.org/cgi-bin/bugreport.cgi?bug=551769\nhttp://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2356032\n\nThat's all I can think of right now. Please tell me if there's any\nmore information I should provide to help you narrow this down.\n\nThanks in advance and kind regards\n       Friedrich Delgado\n-- \nDipl.-Inform Friedrich Delgado             (Projekt- und Entwicklungsteam)\n\nDFN-CERT Services GmbH, https://www.dfn-cert.de/\nSitz/Register: Hamburg,  AG Hamburg,  HRB 88805,  Ust-IdNr.: DE 232129737\nSachsenstraße 5, 20097 Hamburg/Germany,  CEO: Dr. Klaus-Peter Kossakowski\n"}]}