unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#66254: "guix --version | head -1" crashes most of the time
@ 2023-09-28 10:20 Clément Lassieur
  2023-10-11 22:30 ` Simon Tournier
  0 siblings, 1 reply; 3+ messages in thread
From: Clément Lassieur @ 2023-09-28 10:20 UTC (permalink / raw)
  To: 66254


[-- Attachment #1.1: Type: text/plain, Size: 203 bytes --]

> guix --version | cat | head -1
works

> 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 #1.2: Type: text/html, Size: 561 bytes --]

[-- Attachment #2: log.txt --]
[-- Type: text/plain, Size: 4314 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#66254: "guix --version | head -1" crashes most of the time
  2023-09-28 10:20 bug#66254: "guix --version | head -1" crashes most of the time Clément Lassieur
@ 2023-10-11 22:30 ` Simon Tournier
  2023-10-12  8:58   ` Clément Lassieur
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Tournier @ 2023-10-11 22:30 UTC (permalink / raw)
  To: Clément Lassieur, 66254

[-- Attachment #1: Type: text/plain, Size: 1767 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: p.patch --]
[-- Type: text/x-diff, Size: 493 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 39 bytes --]


Does it fix the issue?

Cheers,
simon

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#66254: "guix --version | head -1" crashes most of the time
  2023-10-11 22:30 ` Simon Tournier
@ 2023-10-12  8:58   ` Clément Lassieur
  0 siblings, 0 replies; 3+ messages in thread
From: Clément Lassieur @ 2023-10-12  8:58 UTC (permalink / raw)
  To: Simon Tournier; +Cc: 66254

Simon Tournier <zimon.toutoune@gmail.com> writes:

> Hi Clément,

Hey Simon,

[...]

> 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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-12  8:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-28 10:20 bug#66254: "guix --version | head -1" crashes most of the time Clément Lassieur
2023-10-11 22:30 ` Simon Tournier
2023-10-12  8:58   ` Clément Lassieur

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).