bug-guix
[Top][All Lists]
Advanced

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

bug#66254: "guix --version | head -1" crashes most of the time


From: Simon Tournier
Subject: bug#66254: "guix --version | head -1" crashes most of the time
Date: Thu, 12 Oct 2023 00:30:58 +0200

Hi Clément,

On Thu, 28 Sep 2023 at 12:20, Clément Lassieur <clement@lassieur.org> wrote:
>> guix --version | cat | head -1
> works

Not for me.

--8<---------------cut here---------------start------------->8---
$ guix --version | cat | head -1
guix (GNU Guix) 6113e0529d61df7425f64e30a6bf77f7cfdfe5a5
Backtrace:
           3 (primitive-load "/home/simon/.config/guix/current/bin/guix")
In guix/ui.scm:
   2312:7  2 (run-guix . _)
    563:2  1 (show-version-and-exit _)
In unknown file:
           0 (display "License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to 
change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by 
law.\n" #<unde…>)

ERROR: In procedure display:
In procedure fport_write: Broken pipe
--8<---------------cut here---------------end--------------->8---

>> guix --version | head -1
> crashes most of the time

And note that:

--8<---------------cut here---------------start------------->8---
$ guix --version | head -2
guix (GNU Guix) 6113e0529d61df7425f64e30a6bf77f7cfdfe5a5
Copyright (C) 2023 the Guix authors
--8<---------------cut here---------------end--------------->8---

Well, I do not know if it is related, please note:

--8<---------------cut here---------------start------------->8---
(define* (show-version-and-exit #:optional (command (car (command-line))))
  "Display version information for COMMAND and `(exit 0)'."
  (simple-format #t "~a (~a) ~a~%"
                 command %guix-package-name %guix-version)
  (format #t "Copyright ~a 2023 ~a"
--8<---------------cut here---------------end--------------->8---

Anyway.  The issue is from leave-on-EPIPE.  This patch fixes the issue,
I guess.

diff --git a/guix/ui.scm b/guix/ui.scm
index 6f2d4fe245..507bc67f1d 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -2309,7 +2309,7 @@ (define (run-guix . args)
       ((or ("-h") ("--help"))
        (leave-on-EPIPE (show-guix-help)))
       ((or ("-V") ("--version"))
-       (show-version-and-exit "guix"))
+       (leave-on-EPIPE (show-version-and-exit "guix")))
       (((? option? o) args ...)
        (format (current-error-port)
                (G_ "guix: unrecognized option '~a'~%") o)
Does it fix the issue?

Cheers,
simon

reply via email to

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