]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-svn: control destruction order to avoid segfault
authorEric Wong <e@80x24.org>
Mon, 29 Jan 2018 23:11:07 +0000 (23:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Jan 2018 21:14:38 +0000 (13:14 -0800)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-svn.perl

index aa242d4f4f4363736730ccfcb4c2694d5be9a670..b0129802465265e82037ad58e921465f4b951ab1 100755 (executable)
@@ -1199,6 +1199,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;
 }