guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (guix git) and guile-git finalizers.


From: Mathieu Othacehe
Subject: Re: (guix git) and guile-git finalizers.
Date: Sat, 01 Jul 2017 12:16:47 +0200
User-agent: mu4e 0.9.18; emacs 25.2.1

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
>From d8336eb41574d41bd36330c26f56da8090c8907e Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <address@hidden>
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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]