GNU bug report logs - #53063
[PATCH wip-harden-installer 00/14] General improvements to the installer

Previous Next

Package: guix-patches;

Reported by: Josselin Poiret <dev <at> jpoiret.xyz>

Date: Thu, 6 Jan 2022 22:47:01 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: 53063 <at> debbugs.gnu.org
Cc: Josselin Poiret <dev <at> jpoiret.xyz>
Subject: [bug#53063] [PATCH wip-harden-installer 06/14] installer: Disable automatic finalization for child thread.
Date: Thu,  6 Jan 2022 23:48:04 +0100
* gnu/installer/utils.scm (run-external-command-with-handler): Disable
finalization manually, to avoid having the finalizer thread spout
"error in finalization thread: Success".
---
 gnu/installer/utils.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm
index 878434f074..ad220492d9 100644
--- a/gnu/installer/utils.scm
+++ b/gnu/installer/utils.scm
@@ -32,6 +32,8 @@ (define-module (gnu installer utils)
   #:use-module (ice-9 regex)
   #:use-module (ice-9 format)
   #:use-module (ice-9 textual-ports)
+  #:use-module (system foreign)
+  #:use-module (system foreign-library)
   #:export (read-lines
             read-all
             nearest-exact-integer
@@ -143,6 +145,14 @@ (define* (run-external-command-with-handler handler command)
     (match (primitive-fork)
       (0 ;; We're in the child
        (close-port input)
+       ;; XXX: Disable automatic finalization because we're going to exec.
+       ;; Might become unnecessary with newer Guile versions, as the
+       ;; *possible* finalization thread may stop properly when its pipe is
+       ;; closed.
+       ((foreign-library-function (load-foreign-library #f)
+                                  "scm_set_automatic_finalization_enabled"
+                                  #:return-type int
+                                  #:arg-types (list int)) 0)
        (reset-fds
         (open-fdes "/dev/null" O_WRONLY)
         ;; Avoid port GC'ing closing the fd by increasing its revealed count.
-- 
2.34.0





This bug report was last modified 3 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.