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

  • Done
  • quality assurance status badge
Details
3 participants
  • Clément Lassieur
  • Ludovic Courtès
  • Simon Tournier
Owner
unassigned
Submitted by
Clément Lassieur
Severity
normal
C
C
Clément Lassieur wrote on 28 Sep 2023 12:20
(address . bug-guix@gnu.org)
2458ef62-18af-4379-a6ff-0e9c02552ac2@app.fastmail.com
Toggle quote (1 lines)
> guix --version | cat | head -1
works

Toggle quote (1 lines)
> guix --version | head -1
crashes most of the time

(on foreign distro)

See attached log. Same bug with 'head' from Guix coreutils.

Thanks,
Clément
Attachment: file
clement@newt:~$ guix --version | head -1
guix (GNU Guix) ce0cc6137df81919389f61671096a6ce701c0889
clement@newt:~$ guix --version | head -1
guix (GNU Guix) ce0cc6137df81919389f61671096a6ce701c0889
Backtrace:
6 (primitive-load "/home/clement/.config/guix/current/bin…")
In guix/ui.scm:
2312:7 5 (run-guix . _)
557:2 4 (show-version-and-exit _)
In ice-9/format.scm:
1548:18 3 (format #t "Copyright ~a 2023 ~a" "(C)" "the Guix autho…")
216:11 2 (format:format-work "Copyright ~a 2023 ~a" ("(C)" "th…"))
65:8 1 (format:out-obj-padded _ _ _ _)
In unknown file:
0 (display "the Guix authors\n" #<output: file 1>)

ERROR: In procedure display:
In procedure fport_write: Broken pipe
clement@newt:~$ guix --version | head -1
guix (GNU Guix) ce0cc6137df81919389f61671096a6ce701c0889
Backtrace:
3 (primitive-load "/home/clement/.config/guix/current/bin…")
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 <…" …)

ERROR: In procedure display:
In procedure fport_write: Broken pipe
clement@newt:~$ guix --version | head -1
guix (GNU Guix) ce0cc6137df81919389f61671096a6ce701c0889
Backtrace:
6 (primitive-load "/home/clement/.config/guix/current/bin…")
In guix/ui.scm:
2312:7 5 (run-guix . _)
557:2 4 (show-version-and-exit _)
In ice-9/format.scm:
1548:18 3 (format #t "Copyright ~a 2023 ~a" "(C)" "the Guix autho…")
216:11 2 (format:format-work "Copyright ~a 2023 ~a" ("(C)" "th…"))
65:8 1 (format:out-obj-padded _ _ _ _)
In unknown file:
0 (display "the Guix authors\n" #<output: file 1>)

ERROR: In procedure display:
In procedure fport_write: Broken pipe
clement@newt:~$ guix --version | head -1
guix (GNU Guix) ce0cc6137df81919389f61671096a6ce701c0889
Backtrace:
3 (primitive-load "/home/clement/.config/guix/current/bin…")
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 <…" …)

ERROR: In procedure display:
In procedure fport_write: Broken pipe
clement@newt:~$ guix --version | head -1
guix (GNU Guix) ce0cc6137df81919389f61671096a6ce701c0889
Backtrace:
6 (primitive-load "/home/clement/.config/guix/current/bin…")
In guix/ui.scm:
2312:7 5 (run-guix . _)
557:2 4 (show-version-and-exit _)
In ice-9/format.scm:
1548:18 3 (format #t "Copyright ~a 2023 ~a" "(C)" "the Guix autho…")
216:11 2 (format:format-work "Copyright ~a 2023 ~a" ("(C)" "th…"))
65:8 1 (format:out-obj-padded _ _ _ _)
In unknown file:
0 (display "the Guix authors\n" #<output: file 1>)

ERROR: In procedure display:
In procedure fport_write: Broken pipe
clement@newt:~$ guix --version | head -1
guix (GNU Guix) ce0cc6137df81919389f61671096a6ce701c0889
Backtrace:
3 (primitive-load "/home/clement/.config/guix/current/bin…")
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 <…" …)

ERROR: In procedure display:
In procedure fport_write: Broken pipe
clement@newt:~$ guix --version | head -1
guix (GNU Guix) ce0cc6137df81919389f61671096a6ce701c0889
Backtrace:
3 (primitive-load "/home/clement/.config/guix/current/bin…")
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 <…" …)

ERROR: In procedure display:
In procedure fport_write: Broken pipe
clement@newt:~$ guix --version | head -1
guix (GNU Guix) ce0cc6137df81919389f61671096a6ce701c0889
Backtrace:
6 (primitive-load "/home/clement/.config/guix/current/bin…")
In guix/ui.scm:
2312:7 5 (run-guix . _)
557:2 4 (show-version-and-exit _)
In ice-9/format.scm:
1548:18 3 (format #t "Copyright ~a 2023 ~a" "(C)" "the Guix autho…")
216:11 2 (format:format-work "Copyright ~a 2023 ~a" ("(C)" "th…"))
65:8 1 (format:out-obj-padded _ _ _ _)
In unknown file:
0 (display "the Guix authors\n" #<output: file 1>)

ERROR: In procedure display:
In procedure fport_write: Broken pipe
S
S
Simon Tournier wrote on 12 Oct 2023 00:30
86v8bcdc65.fsf@gmail.com
Hi Clément,

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

Not for me.

Toggle snippet (14 lines)
$ 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

Toggle quote (3 lines)
>> guix --version | head -1
> crashes most of the time

And note that:

Toggle snippet (5 lines)
$ guix --version | head -2
guix (GNU Guix) 6113e0529d61df7425f64e30a6bf77f7cfdfe5a5
Copyright (C) 2023 the Guix authors

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

Toggle snippet (7 lines)
(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"

Anyway. The issue is from leave-on-EPIPE. This patch fixes the issue,
I guess.
Toggle diff (13 lines)
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
C
C
Clément Lassieur wrote on 12 Oct 2023 10:58
(name . Simon Tournier)(address . zimon.toutoune@gmail.com)(address . 66254@debbugs.gnu.org)
87pm1k6wuu.fsf@lassieur.org
Simon Tournier <zimon.toutoune@gmail.com> writes:

Toggle quote (2 lines)
> Hi Clément,

Hey Simon,

[...]

Toggle quote (20 lines)
> 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?

Yes indeed! Thanks :)

Clément
L
L
Ludovic Courtès wrote on 28 Oct 2023 12:00
control message for bug #66254
(address . control@debbugs.gnu.org)
871qdf9idu.fsf@gnu.org
close 66254
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 66254@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 66254
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch