guile-user
[Top][All Lists]
Advanced

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

Re: How to get better stack trace from a script executed via shebang?


From: Jean Abou Samra
Subject: Re: How to get better stack trace from a script executed via shebang?
Date: Thu, 2 Feb 2023 17:39:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

On 02/02/2023 17:11, Wolf wrote:
> Hello,
> 
> I'm having a problem of getting borderline useless stack traces from a script
> executed via a shebang. For example, let's consider following script:
> 
>     $ cat /tmp/x.scm 
>     #!/bin/sh
>     exec guile --no-auto-compile -e main -s "$0" "$@"
>     !#
>     
>     (define (main args)
>       (foo))
>     
>     (define (foo)
>       (bar))
>     
>     (define (bar)
>       (error "x"))
> 
> When I execute it directly, the error message is not great:
> 
>     $ /tmp/x.scm
>     Backtrace:
>     In ice-9/boot-9.scm:
>       1752:10  4 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
>     In unknown file:
>                3 (apply-smob/0 #<thunk 7fdb1e7a2340>)
>     In ice-9/boot-9.scm:
>         724:2  2 (call-with-prompt ("prompt") #<procedure 7fdb1e7b2c80 at 
> ice-9/eval.scm:330:13 ()> #<procedure default-prompt-handler (k proc)>)
>     In ice-9/eval.scm:
>         619:8  1 (_ #(#(#<directory (guile-user) 7fdb1e7a5c80>)))
>     In ice-9/boot-9.scm:
>        2007:7  0 (error _ . _)
>     
>     ice-9/boot-9.scm:2007:7: In procedure error:
>     x
> 
> The /tmp/x.scm file is not even mentioned once in the output. Can this be
> somehow (command line arguments, changing the exec line, ...) improved?
> Currently it's not very useful when I need to find out what the problem was.



This is a known issue for code that is evaluated, as opposed
to being compiled. Consider leaving out --no-auto-compile.

Best,
Jean


Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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