From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: Re: (guix git) and guile-git finalizers. Date: Sat, 01 Jul 2017 12:16:47 +0200 Message-ID: <87r2y0h374.fsf@gmail.com> References: <86h8zliddr.fsf@gmail.com> <87zidc2thj.fsf@gnu.org> <86vans0xws.fsf@gmail.com> <87fues6yjt.fsf@igalia.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRFSS-0001gh-4Z for guix-devel@gnu.org; Sat, 01 Jul 2017 06:16:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRFSO-0004Em-V4 for guix-devel@gnu.org; Sat, 01 Jul 2017 06:16:56 -0400 In-reply-to: <87fues6yjt.fsf@igalia.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Andy Wingo Cc: guix-devel , Amirouche --=-=-= Content-Type: text/plain Hi Andy, > Why do you feel the need to "shut down" libgit? Honestly I would punt. > Most other libraries aren't like that. Thanks for the review and pointing out those two issues. So our best option may be to stop using libgit2-shutdown in (guix git). I attached a patch, what do you guys think ? Thanks, Mathieu --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-guix-git-Stop-using-libgit2-shutdown.patch >From d8336eb41574d41bd36330c26f56da8090c8907e Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sat, 1 Jul 2017 12:14:05 +0200 Subject: [PATCH] guix: git: Stop using libgit2-shutdown. * guix/git.scm (with-libgit2): Stop calling (libgit2-shutdown) to prevent segfaults when pointer finalizers are run. --- guix/git.scm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index 17a6784ae..406c81734 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -34,13 +34,12 @@ (make-parameter "/var/cache/guix/checkouts")) (define-syntax-rule (with-libgit2 thunk ...) - (dynamic-wind - (lambda () - (libgit2-init!)) - (lambda () - thunk ...) - (lambda () - (libgit2-shutdown)))) + (begin + ;; XXX: The right thing to do would be to call (libgit2-shutdown) here, + ;; but pointer finalizers used in guile-git may be called after shutdown, + ;; resulting in a segfault. Hence, let's skip shutdown call for now. + (libgit2-init!) + thunk ...)) (define* (url-cache-directory url #:optional (cache-directory -- 2.13.1 --=-=-=--