guix-devel
[Top][All Lists]
Advanced

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

Re: Sanitizer of record fields?


From: Maxime Devos
Subject: Re: Sanitizer of record fields?
Date: Thu, 8 Sep 2022 13:43:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0


On 08-09-2022 13:35, bokr@bokr.com wrote:
Hi Simon, et al

On +2022-09-08 09:59:15 +0200, zimoun wrote:
Hi,

The website is currently failing [1] to build because a typo in some
package declaration.  The error message is not very helpful,

         srfi/srfi-1.scm:241:2: In procedure map:
         In procedure map: Wrong type argument: "https://www.qt.io/";
         building pages in '/tmp/gnu.org/software/guix'...

ISTM this "wrong type argument" is an infuriatingly common
and typically useless error message.

Would it be possible to have a debugging hook where the message is output
which if activated would show the call stack, so one could see where in
the user code it happened?

Activation could I imagine be by guile checking e.g.
"GUILE_THROW_DEBUG_WRONG_ARGUMENT" on invocation, to turn on the hook
in a way that would have zero performance effect if not activated.

Why a hook / environment variable in Guile? Backtraces are printed
by default, I do not see the benefit of disabling them by default and
adding an environment variable to enable them:

antipode@antipode ~$ guile -c '(map 0 1)'
Backtrace:
In ice-9/boot-9.scm:
  1752:10  6 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
           5 (apply-smob/0 #<thunk 7fa30cc882e0>)
In ice-9/boot-9.scm:
    724:2  4 (call-with-prompt ("prompt") #<procedure 7fa30cc9acc0 …> …)
In ice-9/eval.scm:
    619:8  3 (_ #(#(#<directory (guile-user) 7fa30cc8dc80>)))
In ice-9/command-line.scm:
   185:19  2 (_ #<input: string 7fa30cc87850>)
In unknown file:
           1 (eval (map 0 1) #<directory (guile-user) 7fa30cc8dc80>)
In ice-9/boot-9.scm:
    218:9  0 (map 0 1)

ice-9/boot-9.scm:218:9: In procedure map:
In procedure map: Not a list: 1
Problem is already solved.

It appears that the website code catches exceptions and prints the error message, but forgets to print the backtrace, but that seems to be a choice that the website
code made, not Guile. (Likely, an accidental choice, that can be improved.)

Greetings,
Maxime.


Attachment: OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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