about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-01-29 23:11:07 +0000
committerEric Wong <e@80x24.org>2018-01-29 23:12:00 +0000
commit2784b8d68faca823489949cbc69ead2f296cfc07 (patch)
tree620b8323df0e3937930261fd3dcfdeb0308aa89f
parent5be1f00a9a701532232f57958efab4be8c959a29 (diff)
downloadgit-svn-svn-branch-segfault.tar.gz
It seems necessary to control destruction ordering to avoid a
segfault with SVN 1.9.5 when using "git svn branch".
I've also reported the problem against libsvn-perl to Debian
[Bug #888791], but releasing the SVN::Client instance can be
beneficial anyways to save memory.

ref: https://bugs.debian.org/888791
Tested-by: Todd Zullinger <tmz@pobox.com>
Reported-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Eric Wong <e@80x24.org>
-rwxr-xr-xgit-svn.perl5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 76a75d0b3d..a6b6c3e40c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1200,6 +1200,11 @@ sub cmd_branch {
         $ctx->copy($src, $rev, $dst)
                 unless $_dry_run;
 
+        # Release resources held by ctx before creating another SVN::Ra
+        # so destruction is orderly.  This seems necessary with SVN 1.9.5
+        # to avoid segfaults.
+        $ctx = undef;
+
         $gs->fetch_all;
 }