git-svn: control destruction order to avoid segfault
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>
Eric Wong committed
Jan 29, 2018 at 23:11 UTC
7f6f75e97acd25f8e95ce431e16d2e1c2093845d
1 file changed
+5
git-svn.perl
+5
@@ -1199,6 +1199,11 @@ sub cmd_branch {
1199
$ctx->copy($src, $rev, $dst)
1200
unless $_dry_run;
1201
1202
+ # Release resources held by ctx before creating another SVN::Ra
1203
+ # so destruction is orderly. This seems necessary with SVN 1.9.5
1204
+ # to avoid segfaults.
1205
+ $ctx = undef;
1206
+
1207
$gs->fetch_all;
1208
}
1209