Installer does not display full backtrace on error

  • Done
  • quality assurance status badge
Details
4 participants
  • Danny Milosavljevic
  • Ludovic Courtès
  • Mathieu Othacehe
  • pelzflorian (Florian Pelz)
Owner
unassigned
Submitted by
pelzflorian (Florian Pelz)
Severity
normal

Debbugs page

pelzflorian (Florian Pelz) wrote 6 years ago
(address . bug-guix@gnu.org)
20190503085927.ib5gudynudeknclm@pelzflorian.localdomain
When the Newt installer displays a backtrace, it is possible to scroll
up and down, but not left and right. This cuts off important error
messages.
Danny Milosavljevic wrote 6 years ago
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)(address . 35542@debbugs.gnu.org)
20190503114019.1dfba960@scratchpost.org
On Fri, 3 May 2019 10:59:27 +0200
"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> wrote:

Toggle quote (4 lines)
> When the Newt installer displays a backtrace, it is possible to scroll
> up and down, but not left and right. This cuts off important error
> messages.

IMO the better solution would be to wrap the text--and not to add another
scrollbar.

It might help to change gnu/installer/newt/page.scm's run-file-textbox-page
so that it uses make-reflowed-textbox instead of make-textbox in file-textbox.

(I have no idea how to test that, though)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlzMDIMACgkQ5xo1VCww
uqW5TQf/dnTMIQUiqK6vbu0df9uNzI04hhG6ho4tOhdS7TDgw/KBrPA7cUmsAsi2
KenIX0T4LIflo9wY0U7h6G1T+iUx4rEQHFniTkcxTY4FoDPfrwKL3RwpNS2K8yfc
B0uyOWf9iKyDPnxAwev7aSnF70Ay3r4i9dug98bixclP6wQ6TRoH+MzaURxBsTEO
LF6QzYNGjTyqHU1ZFojVhrDZw5tz7P3cpIE2+Bs48UUC1jdIOtAGIw/lsl8BGtEs
N5O6Wqn3CbBV5VoCjy0tw1AMh8rvuVf/v5qab20cO2cvXb1P5fq2HSRxcNM+42Aj
Yy3ofBboKSoR1NjI6jfciZAaUbZP2Q==
=Zaus
-----END PGP SIGNATURE-----


Ludovic Courtès wrote 6 years ago
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87ef5fetnv.fsf@gnu.org
"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (4 lines)
> When the Newt installer displays a backtrace, it is possible to scroll
> up and down, but not left and right. This cuts off important error
> messages.

Not sure if this can be fixed. Mathieu?

The backtrace is kept in /tmp though.

Ludo'.
Mathieu Othacehe wrote 6 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)
8736lvka3k.fsf@gmail.com
Hey,

Toggle quote (2 lines)
> Not sure if this can be fixed. Mathieu?

The textbox object used for the backtrace window only supports vertical
scrolling. However, the text should be broken in lines that fit the box
horizontally, I'll try to find why it doesn't work.

Mathieu
pelzflorian (Florian Pelz) wrote 6 years ago
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190503174633.otzjizlfjhr4bkca@pelzflorian.localdomain
On Fri, May 03, 2019 at 02:15:27PM +0200, Mathieu Othacehe wrote:
Toggle quote (11 lines)
>
> Hey,
>
> > Not sure if this can be fixed. Mathieu?
>
> The textbox object used for the backtrace window only supports vertical
> scrolling. However, the text should be broken in lines that fit the box
> horizontally, I'll try to find why it doesn't work.
>
> Mathieu

I believe I read about Guile error messages not doing line wrapping in
terminals on the Guix or Guile mailing lists recently, but I cannot
find it. Proper line wrapping may be the better solution.
Mathieu Othacehe wrote 6 years ago
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87y33msgmy.fsf@gmail.com
Hello,

Toggle quote (4 lines)
> I believe I read about Guile error messages not doing line wrapping in
> terminals on the Guix or Guile mailing lists recently, but I cannot
> find it. Proper line wrapping may be the better solution.

In fact the textbox where the backtrace is displayed isn't doing any
line wrapping. The attached patch fixes the issue.

Thanks,

Mathieu
From f68ded2f134d55c20f98300c0514c4fc18cd1d50 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@gmail.com>
Date: Sat, 4 May 2019 11:33:33 +0200
Subject: [PATCH] installer: Reflow run-file-textbox-page text.

* gnu/installer/newt/page.scm (run-file-textbox-page): Reflow FILE-TEXT so
that it fits horizontally in the textbox.
---
gnu/installer/newt/page.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Toggle diff (20 lines)
diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm
index 3173d54737..8a32c403df 100644
--- a/gnu/installer/newt/page.scm
+++ b/gnu/installer/newt/page.scm
@@ -559,7 +559,12 @@ ITEMS when 'Ok' is pressed."
'())))))
(form (make-form)))
- (set-textbox-text file-textbox file-text)
+ (set-textbox-text file-textbox
+ (receive (_w _h text)
+ (reflow-text file-text
+ file-textbox-width
+ 0 0)
+ text))
(add-form-to-grid grid form #t)
(make-wrapped-grid-window grid title)
--
2.17.1
pelzflorian (Florian Pelz) wrote 6 years ago
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190504122403.noe5hirk6u3qtmcm@pelzflorian.localdomain
On Sat, May 04, 2019 at 11:43:28AM +0200, Mathieu Othacehe wrote:
Toggle quote (10 lines)
> Hello,
>
> > I believe I read about Guile error messages not doing line wrapping in
> > terminals on the Guix or Guile mailing lists recently, but I cannot
> > find it. Proper line wrapping may be the better solution.
>
> In fact the textbox where the backtrace is displayed isn't doing any
> line wrapping. The attached patch fixes the issue.
>

I now get linewrapping, but provoked errors (these are not new bugs!)
are cut off like

In ./gnu/installer/keymap.scm
163:7 8 (_ _)
In unknown file:
7 (scm-error misc-error #f "~A" ("Unable to locate
keym…") …)

This seems like the same issue as Guile error backtraces only reaching
until the right end of the terminal and then getting cut off with
ellipses ….

I hope it is enough to guix pull from a Guix repo with the patch
applied and I do not get wrong output because I have not changed the
gnu/packages/package-management.scm Guix package to refer to a patched
version as well.

Regards,
Florian
Danny Milosavljevic wrote 6 years ago
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
20190504145409.00768bf6@scratchpost.org
Hi,

On Sat, 4 May 2019 14:24:03 +0200
"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> wrote:

Toggle quote (13 lines)
> I now get linewrapping, but provoked errors (these are not new bugs!)
> are cut off like
>
> In ./gnu/installer/keymap.scm
> 163:7 8 (_ _)
> In unknown file:
> 7 (scm-error misc-error #f "~A" ("Unable to locate
> keym…") …)
>
> This seems like the same issue as Guile error backtraces only reaching
> until the right end of the terminal and then getting cut off with
> ellipses ….

Oh, that again. I've had it before and worked around it before.

Try

,use (system repl debug) ; or #:use-module (system repl debug)
(terminal-width 2000000)

f.e. at the top of gnu/installer.scm
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlzNi3EACgkQ5xo1VCww
uqWorAf+MrtIKmYI/X6MBSC5j0U/lfovg9ok97H2/gS6eTs8wcEsR7QuICUft7HS
aeEAh0KvzlnBL02ujQObPoDLSrpPOiHqHl8QllFqdkZF0Oj33V00rgAdq3bwhHgD
0BbYbMBTBXWFN5sBPwLrfmVxpTY/0htNZfVzBHmC4sPCKKnDrcz5DU99yqSFdAfO
+Fj2+oWzpiU2xjb+23UldHGgxiWJLA43qfZkHkNtgw1iEdty+RkctIQjWWD74yVd
Wl5JVwpRb7NdYkaz9r/UG8o62fi51VtodHYt+5MCcAc6Cp6pf0qFJnImap+qVk3T
dsPcOb1+Un1pILQ4gi5Urr7RKHP8Uw==
=nBAA
-----END PGP SIGNATURE-----


Mathieu Othacehe wrote 6 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
87pnoy42o7.fsf@gmail.com
Hey,

Toggle quote (5 lines)
> ,use (system repl debug) ; or #:use-module (system repl debug)
> (terminal-width 2000000)
>
> f.e. at the top of gnu/installer.scm

Thanks for testing Florian. Based on Danny suggestion we could set
COLUMNS to 200 to have a more verbose backtrace (like guix itself).

Using higher values, the backtrace becomes really long and harder to
read. WDYT?

Mathieu
Mathieu Othacehe wrote 6 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
87o94i42md.fsf@gmail.com
And the patch ...

Sorry,

Mathieu
From 3348df0c72e9bcdf31b63155d9c6bdbaee515524 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@gmail.com>
Date: Sat, 4 May 2019 18:10:40 +0200
Subject: [PATCH] installer: Increase backtrace verbosity.

* gnu/installer.scm (installer-program): Set COLUMNS env variable to 200 to
make guile backtraces more verbose.
---
gnu/installer.scm | 4 ++++
1 file changed, 4 insertions(+)

Toggle diff (16 lines)
diff --git a/gnu/installer.scm b/gnu/installer.scm
index fe2841397e..435cad507d 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -400,5 +400,9 @@ selected keymap."
;; some reason, unicode support is not correctly installed
;; when calling this in 'installer-builder'.
(setenv "LANG" "en_US.UTF-8")
+ ;; Initialize 'terminal-width' in (system repl debug)
+ ;; to a large-enough value to make backtrace more
+ ;; verbose.
+ (setenv "COLUMNS" "200")
(execl #$(program-file "installer-real" installer-builder)
"installer-real"))))
--
2.17.1
Danny Milosavljevic wrote 6 years ago
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190504190617.1b8a8efa@scratchpost.org
Hi Mathieu,

On Sat, 04 May 2019 18:14:48 +0200
Mathieu Othacehe <m.othacehe@gmail.com> wrote:

Toggle quote (3 lines)
> Thanks for testing Florian. Based on Danny suggestion we could set
> COLUMNS to 200 to have a more verbose backtrace (like guix itself).

Good idea in principle.

Toggle quote (3 lines)
> Using higher values, the backtrace becomes really long and harder to
> read. WDYT?

When we have a designed error message, we present one--and, there, brevity
is good.

But backtraces are for developers only anyway, and are not designed error
messages.
So for backtraces I'm against throwing *anything* of the backtrace
message away because we don't know what part of it is important (if we
did, we'd print a designed error message instead--I'm all for doing that).

I think this is something the default Guile setting gets wrong and I
don't understand how it can be a good idea to suppress half of a
message intended to simplify debugging for a developer "because it's
too long". The length is nothing compared to the amount of text a
developer has to type in order to reproduce the missing parts later on,
if it's even possible.

I'm even actually using core files (including attaching to them using a
debugger in order to examine variable values), so I might be an outlier.

So I'd be for either presenting the entire backtrace or suppressing the
entire backtrace, not having teaser backtraces :)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlzNxokACgkQ5xo1VCww
uqWrtggAjM1wnHPwxkPEpC5vjdrIj45hnnsyPK5LieaMAkdbbFceFtBs65Hbsnvu
FFdoqcsVJMnpAjx4iBSMKnh+qdofE3A9MiRjcgNfRe1cxfENvtefcrPb/6iq5goT
UN83bhqeQ/DMzmpKDY/Io/NBA65nFRPnmtxo7LYVXiw8RUdFjAX26pYwuAqQyE+4
ygeyhKA3mJZQO9Ekuusi0sxkPjwbGqVaovPiMU4248LtKYwd8xY5QgldLaPhj5AE
EG2lWCMhBG5IOuP/DfZoK6Z2gwIWzxTo8wYDIZFo0+cRvyJOKUtVerNbgsmwMjhw
HMO2DdbZMq2sAUhF/xltMS2n1Ppn2w==
=m2Xv
-----END PGP SIGNATURE-----


pelzflorian (Florian Pelz) wrote 6 years ago
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190504172647.ta3aaigex2tzb5ry@pelzflorian.localdomain
On Sat, May 04, 2019 at 06:14:48PM +0200, Mathieu Othacehe wrote:
Toggle quote (4 lines)
> Thanks for testing Florian. Based on Danny suggestion we could set
> COLUMNS to 200 to have a more verbose backtrace (like guix itself).
>

It works (I have applied both patches).

This is one of the longer backtrace steps:

In ice-9/eval.scm:
619:8 17 (_ #(#(#(#<directory (guile-user) 1775140>
#<<installer> name: newt init: #<procedure init ()> exit:
#<procedure exit ()> exit-error: #<procedure exit-error (file
key args)> fi…> …)) …))
pelzflorian (Florian Pelz) wrote 6 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20190504173807.2fxseiyoa4nvaoae@pelzflorian.localdomain
On Sat, May 04, 2019 at 07:06:17PM +0200, Danny Milosavljevic wrote:
Toggle quote (3 lines)
> So I'd be for either presenting the entire backtrace or suppressing the
> entire backtrace, not having teaser backtraces :)

Let’s assume someone is getting an error in the installer for some
reason. If they are Guix developers, maybe they understand the issue
from the (trimmed) backtrace. If they are not well-versed in Unix,
with the backtrace they can exfiltrate the (trimmed) error with a
camera. I hope I understand the purpose correctly. Maybe it saves
the people on the mailing list complicated explanations. These maybes
become more likely with a fuller backtrace, I suppose.

Regards,
Florian
pelzflorian (Florian Pelz) wrote 6 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20190504174032.r756yfjld5gqyabh@pelzflorian.localdomain
On Sat, May 04, 2019 at 07:38:07PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (13 lines)
> On Sat, May 04, 2019 at 07:06:17PM +0200, Danny Milosavljevic wrote:
> > So I'd be for either presenting the entire backtrace or suppressing the
> > entire backtrace, not having teaser backtraces :)
>
> Let’s assume someone is getting an error in the installer for some
> reason. If they are Guix developers, maybe they understand the issue
> from the (trimmed) backtrace. If they are not well-versed in Unix,
> with the backtrace they can exfiltrate the (trimmed) error with a
> camera. I hope I understand the purpose correctly. Maybe it saves
> the people on the mailing list complicated explanations. These maybes
> become more likely with a fuller backtrace, I suppose.
>

On the other hand the error message after the backtrace is hopefully
enough most of the time. But maybe it is not.

Regards,
Florian
Ludovic Courtès wrote 6 years ago
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87y33hui96.fsf@gnu.org
Hi Mathieu,

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (5 lines)
> + ;; Initialize 'terminal-width' in (system repl debug)
> + ;; to a large-enough value to make backtrace more
> + ;; verbose.
> + (setenv "COLUMNS" "200")

What about instead doing something like this:

(use-modules ((system repl debug) #:select (terminal-width)))

(with-fluids ((terminal-width 200))
…)

?

That would ensure we’re only changing Guile’s notion of the terminal
width and not interfering with other tools we might launch as child
processes.

Thoughts?

Ludo’.
Mathieu Othacehe wrote 6 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)
87y339i6en.fsf@gmail.com
Hey Ludo,

Toggle quote (6 lines)
> That would ensure we’re only changing Guile’s notion of the terminal
> width and not interfering with other tools we might launch as child
> processes.
>
> Thoughts?

Seems like a better idea indeed. Here's an update patch.

About using 200 or a much larger value as Danny suggested, I don't have
a strong opinion myself. WDYT?

Thanks,

Mathieu
From d5f792414d0666d554dc8c7b6fee351bbe7a1c14 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@gmail.com>
Date: Tue, 14 May 2019 14:05:36 +0200
Subject: [PATCH] installer: Increase backtrace verbosity.

* gnu/installer.scm (installer-program): Set terminal-width to 200 to
make guile backtraces more verbose.
---
gnu/installer.scm | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (27 lines)
diff --git a/gnu/installer.scm b/gnu/installer.scm
index 3dd76707bf..40c06af320 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -336,6 +336,8 @@ selected keymap."
(gnu services herd)
(guix i18n)
(guix build utils)
+ ((system repl debug)
+ #:select (terminal-width))
(ice-9 match))
;; Initialize gettext support so that installers can use
@@ -359,6 +361,11 @@ selected keymap."
(bindtextdomain "xkeyboard-config"
#+(file-append xkeyboard-config "/share/locale"))
+ ;; Initialize 'terminal-width' in (system repl debug)
+ ;; to a large-enough value to make backtrace more
+ ;; verbose.
+ (terminal-width 200)
+
(let* ((current-installer newt-installer)
(steps (#$steps current-installer)))
((installer-init current-installer))
--
2.17.1
Danny Milosavljevic wrote 6 years ago
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190514180119.3506313b@scratchpost.org
Hi Mathieu,

On Sat, 04 May 2019 11:43:28 +0200
Mathieu Othacehe <m.othacehe@gmail.com> wrote:

Toggle quote (9 lines)
> Hello,
>
> > I believe I read about Guile error messages not doing line wrapping in
> > terminals on the Guix or Guile mailing lists recently, but I cannot
> > find it. Proper line wrapping may be the better solution.
>
> In fact the textbox where the backtrace is displayed isn't doing any
> line wrapping. The attached patch fixes the issue.

I've tested and applied that patch.

I've also fixed the btrfs problem.

I've also added fat16 support (there was ar report about it--although I
can't for the life of me find the associated bug report anymore). Oh well,
should be an improvement.

All these things are available on guix master now.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlza5k8ACgkQ5xo1VCww
uqWRJAf/T88b4F8yEuVhyy+l7WriiEKvaNfKfuBSOA16cQPu0R4asuOz7R9Wlbf0
T13zQZT/8eu7T+jHsWMdLzVFF5eC22YPAiW34wrQHT9GxJAYvzkEn4vR/xhcpwqE
rwnsPJk4s5wqCWZhcdZlWS7Yv/BKpP7gLewYN+87DkScIiWc1IwTlM5Z12ypTnjZ
8LPyh7xyFUa/T+QtZB7n6d3yQd5+CitJt8ysEyi2jRATv4v9wMpA6bnIqdBLrcXZ
YoXhT85mOKnGyQR63eIOAWoHIZBt+8bjy3ojkeOxdzAGjGSvT6fXbTEVghK1BR6X
GQF6Nf9yovptd8hGiXon+y5yd0AP/w==
=8qa3
-----END PGP SIGNATURE-----


Ludovic Courtès wrote 6 years ago
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87pnokwy0m.fsf@gnu.org
Hi Mathieu,

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (11 lines)
>> That would ensure we’re only changing Guile’s notion of the terminal
>> width and not interfering with other tools we might launch as child
>> processes.
>>
>> Thoughts?
>
> Seems like a better idea indeed. Here's an update patch.
>
> About using 200 or a much larger value as Danny suggested, I don't have
> a strong opinion myself. WDYT?

I think 200 is good. You wouldn’t want the backtrace to be filled with
bytevectors, for instance.

Also, if people take pictures of their screen with a backtrace, I hope
there’ll still be enough stack frames on the picture. :-) With a large
‘terminal-width’, there’s a risk that a single frame would fill 10
lines.

Toggle quote (8 lines)
> From d5f792414d0666d554dc8c7b6fee351bbe7a1c14 Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <m.othacehe@gmail.com>
> Date: Tue, 14 May 2019 14:05:36 +0200
> Subject: [PATCH] installer: Increase backtrace verbosity.
>
> * gnu/installer.scm (installer-program): Set terminal-width to 200 to
> make guile backtraces more verbose.

LGTM!

Thank you,
Ludo’.
Mathieu Othacehe wrote 6 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)
87v9yci393.fsf@gmail.com
Hey,

Toggle quote (3 lines)
> I think 200 is good. You wouldn’t want the backtrace to be filled with
> bytevectors, for instance.

Fine with me. Pushed.

Thanks for reviewing,

Mathieu
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 35542
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
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help