From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: wolf Newsgroups: gmane.lisp.guile.user Subject: Re: How to get better stack trace from a script executed via shebang? Date: Thu, 2 Feb 2023 17:51:42 +0100 Message-ID: References: <7e43a34a-3bad-4e21-506d-51e27c0b2080@abou-samra.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d2ujWC4s2vhBtiw4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14677"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user@gnu.org To: Jean Abou Samra Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Feb 02 17:52:18 2023 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pNcor-0003ea-T7 for guile-user@m.gmane-mx.org; Thu, 02 Feb 2023 17:52:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNcoS-0008Ve-En; Thu, 02 Feb 2023 11:51:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNcoQ-0008TB-2K for guile-user@gnu.org; Thu, 02 Feb 2023 11:51:50 -0500 Original-Received: from wolfsden.cz ([37.205.8.62]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNcoN-0005I0-IB for guile-user@gnu.org; Thu, 02 Feb 2023 11:51:49 -0500 Original-Received: by wolfsden.cz (Postfix, from userid 104) id 40A551CD85; Thu, 2 Feb 2023 16:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1675356704; bh=YBPuK2CogA3VYknu+WIqCy+qH1mj/i/BTHIXzYcbeXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Yb2Pg7ApZwHa2/9Hnd9F57NoBHzgo7v8MaZhiVM/nka7uNYK/YO1gFAk8fmhOoj08 PHWSAmTvM1pyodcVwlRWnjTNAuZSNSVcgJYY2GTTdFpx2HP8GiUCs41hVkEN9yY63J rdmRq1pRauE/dT5+vcLstdqq0gTKckpBwRFiXq/DryOFOMTNtTbit+DZ/tOsSBMMLy jitXY0RzGExKwbNrsOwaAqGR6ti98kBwTYddQeTd6++AQIWnkETRtPPJ7pGfIH79gj oBoRtzVp9cBJqDHqw+2KQ21mwWjE77E8O7PXvaO53Aun9NUYVW65ciUTeriL5726VJ XWjXgcJPcTCtJlzY6F0KkhNEEK6AkiuLzV6qEVxxg3OSuBK9paJl0ghZBVMzCZ/Bgj viIe4di8InQZXMgWHEGMYF6XNitOBcBb3RtT0QuSoqocvz9Fq4m+0MdQKH2+hTnxXV aINkPpcY3qoJ2o0Mzmb/ifWwKxXpj5t4po2XLtN6DMZ+DjE/84oiFl4ZGVL9lbbNy1 tHXhNGNQ6+BptFMoy9mHtEElVIORLO3KuqqnzlM90CIzOCdHQds0W3K20RkVZXyuMk QYdNYdFEvyjjTrnjE2P7HZGyGZF0XVVIuHDywdR+vta852jQlB8oYObIq2OxnwvuCd 8lyinXXkvcOwdbd6NeAkdnH4= Original-Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 35FE11CD83; Thu, 2 Feb 2023 16:51:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1675356703; bh=YBPuK2CogA3VYknu+WIqCy+qH1mj/i/BTHIXzYcbeXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=umvJOrUk71Rl8sVZD0kLopiimWTxU2tHI3E6QRApMvS4NgPTZ1xd+lE6gnwNqg/rr agjjPIF2+uFMsr4kTZxNyP2K/MfBbey3GDs5IHLSyKgOiMxltWpPoRwzxZigM/lvMA N2F8lJ6sEXXCN+fgOJDCbRCsXaYecV0m7vCIWieBoyfcRBqeiYHFinBbN+lH/5rvIH NCLgFeAYA/AJdhKf9YSkzlqf4KkhN5xjGJ9KAmWRHtMavSN5xzZpvWKwumwtcxWmxu sw24K9S7VXBtgBLaZUAXN9WNpkOOCoGXGc3FB7BPjA0g+BtYf0DsuvUq2AIQSd+5j2 dxN+ooQPZwdZiNazeV9x8iyePQiYbRhREdSedhzz/1nKuVUnXF4lyQh6JM6iZpab3a 2Md4lLZ+sDNwVHqQE3kCmdU1VCBAkcVyTKRGp8LHVudnqeuZYlhXD8hhRQ5OKiUYXw VSdGtkKMRYlv8peOZRWRPeNRNWFcQUF+V1zIa2Qb9Q0RweNeJStFw/7HZDdamvCHE8 Z7qxqw/+pq5ourjUFILWKIRbS+jQ0sY7ahTuQUUnayHJ3BgKmOTqjzd+y84hDsTJFX PC5I/hDLsDuqm+BC5QSPqXI76gVXIb9rkDxr6p02h4Vfw69tiv+ZURzCk2RFytZgUO QB/Dm6nKJ9j31miRDfV5jrHk= Mail-Followup-To: Jean Abou Samra , guile-user@gnu.org Content-Disposition: inline In-Reply-To: <7e43a34a-3bad-4e21-506d-51e27c0b2080@abou-samra.fr> Received-SPF: pass client-ip=37.205.8.62; envelope-from=wolf@wolfsden.cz; helo=wolfsden.cz X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:18883 Archived-At: --d2ujWC4s2vhBtiw4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2023-02-02 17:39:50 +0100, Jean Abou Samra wrote: > On 02/02/2023 17:11, Wolf wrote: > > Hello, > >=20 > > 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: > >=20 > > $ cat /tmp/x.scm=20 > > #!/bin/sh > > exec guile --no-auto-compile -e main -s "$0" "$@" > > !# > > =20 > > (define (main args) > > (foo)) > > =20 > > (define (foo) > > (bar)) > > =20 > > (define (bar) > > (error "x")) > >=20 > > When I execute it directly, the error message is not great: > >=20 > > $ /tmp/x.scm > > Backtrace: > > In ice-9/boot-9.scm: > > 1752:10 4 (with-exception-handler _ _ #:unwind? _ #:unwind-for-t= ype _) > > In unknown file: > > 3 (apply-smob/0 #) > > In ice-9/boot-9.scm: > > 724:2 2 (call-with-prompt ("prompt") # #) > > In ice-9/eval.scm: > > 619:8 1 (_ #(#(#))) > > In ice-9/boot-9.scm: > > 2007:7 0 (error _ . _) > > =20 > > ice-9/boot-9.scm:2007:7: In procedure error: > > x > >=20 > > 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. >=20 >=20 >=20 > This is a known issue for code that is evaluated, as opposed > to being compiled. Consider leaving out --no-auto-compile. Oh, I was not aware of that. You suggestion does indeed make it better, tha= nk you. ;;; note: source file /mnt/shared/system/./run ;;; newer than compiled /root/.cache/guile/ccache/3.0-LE-8-4.6/mn= t/shared/system/run.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /mnt/shared/system/./run ;;; compiled /root/.cache/guile/ccache/3.0-LE-8-4.6/mnt/shared/system/r= un.go Now there is this output that as far as I know cannot be suppressed (that w= as the reason for --no-auto-compile), but that seems like lesser of two evils here. So, thanks :) W. --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --d2ujWC4s2vhBtiw4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmPb6h4ACgkQL7/ufbZ/ wamuKBAAgmui4fRxCG5LPZmq1jsaBiEI2V5sQJduDcCJviQut5cgrA9ZJQYcUbPI f8OXe195OuFqEuEOJun6OydOX1AcLDF/yF45XmuBo2uLCbW8PZ6mopEj8M2SkDnu 8c5H4sXXm3GLI8WWot/WPHpTNuLACDFXIdxXR3l+1coe/873DD3/4/dvAf6tCV7o STG08xKi5UKtklZ3pI3sgHg7XHCzi5In68C/IDhYUZFu5xoTdJBYIdVBl9LrnE6r dMwc5vNCGmSXSllW6izmukP/QmqjwElUwjk21FiHl0CM2Gxt1KEPVG63pwpyktFB DU4HDVx2zDXjczwMuqozN2neUQ2BoANvU0YLlfm2QCAw4CVVyipBKrfJ/WCnR6XN RIJJ9QNFhzXTaiJTJW5DuQwcrH41T0miqylWgeeeMgJORmepuRNizfFBvO/2m6uf c0pPtVeyP5m0VcZNYgnseV7Bqg8bHvb2BG2f4igiNCpwbSjOIGBamruyHrnwWVL+ 961QlGr38AI45fDn59e7fD6/vhHyqxEy7mt/JyOCClMFclKxL2XXzUqNcYZ4lZzK qqKY5uG1TWfqPWd2W0FlpWb76c/TfQyKWFuEvPYZnQp75Fc2psFyb/qNhCghWr/H dMhr1Lpk4T0Q6th5IK9jHbbQ2mXHoXffNgncRZPx8rO+m9ql9n8= =+gNt -----END PGP SIGNATURE----- --d2ujWC4s2vhBtiw4--