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: How to get better stack trace from a script executed via shebang? Date: Thu, 2 Feb 2023 17:11:21 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yF6h7jimBRQvXD0a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12109"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Feb 02 17:13:58 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 1pNcDm-00030c-KW for guile-user@m.gmane-mx.org; Thu, 02 Feb 2023 17:13:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNcBZ-0003Oz-Ae; Thu, 02 Feb 2023 11:11:41 -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 1pNcBR-0002xL-BO for guile-user@gnu.org; Thu, 02 Feb 2023 11:11:36 -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 1pNcBO-0008CB-BF for guile-user@gnu.org; Thu, 02 Feb 2023 11:11:32 -0500 Original-Received: by wolfsden.cz (Postfix, from userid 104) id A7CDD1BADB; Thu, 2 Feb 2023 16:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1675354282; bh=8lEOFJSSPkKoVTJsTH9XfemcFpQxWYRo4NmiXQLYe6M=; h=Date:From:To:Subject; b=HEo5uMjmsqSPTAHPGyfo0NGqIzAVbAdlHEQHQv8MPBW6OeKN4Bv39eqTiynMTFTpn Fc7I8eqzSmo1hOaMOHfSzD6vuszw1bf1Pe2xwEgBaNJQMZ/9BsmnMKdrj7FF7g29jS XWTlIUYNVuPi3IHHddLJWZXOSlMlzid2fnBCZMz1FvREM/I51HI6ZY9FyWGuDUHEp+ CBiUQz/xXP8ryKkztD2JneVXjXf31aXVTr/Ukb9gKDwgWoygNXw4V3QSoyFL8ndlwy BOR122IUB3ytEbC2pOcEzQORzWUlOf2Fjd7CpXBkRH+mNCRjBEigi5a404WRLb4fvY 4hzkKuUi82CSDuhBld2Ysu3dytTEP4IypoZomWIi9Y5o7Wei7gzzp//R2zU1E9eicU vIq0S0Gq80/jdqsQFX6RmNiN+yqTtQz9knruiqUH71FZsn5KnE35oGfUU2JJRwGOGK 60Y5fUG9yfMx5dCXrKpgEfAaHI1GoC9ydhtOxoKrfWZnKG9wgEjvyfqOLT55jRRTht AaFBtPtSmtKXn8/fTn3jKGp1mnd4LUvMfsG/f9X0dFlhUq3ALZGJcRvNX+aMUJrnWu GmdPOgUkrhBBr44I6ekkkqrxp5telNfZPThMBJw0tANqBJUmTVySPLxSYgkhlso5bR /yiXW+/3uANaO1GZZFFZWIKo= Original-Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 2BC701BF7E for ; Thu, 2 Feb 2023 16:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1675354282; bh=8lEOFJSSPkKoVTJsTH9XfemcFpQxWYRo4NmiXQLYe6M=; h=Date:From:To:Subject; b=HEo5uMjmsqSPTAHPGyfo0NGqIzAVbAdlHEQHQv8MPBW6OeKN4Bv39eqTiynMTFTpn Fc7I8eqzSmo1hOaMOHfSzD6vuszw1bf1Pe2xwEgBaNJQMZ/9BsmnMKdrj7FF7g29jS XWTlIUYNVuPi3IHHddLJWZXOSlMlzid2fnBCZMz1FvREM/I51HI6ZY9FyWGuDUHEp+ CBiUQz/xXP8ryKkztD2JneVXjXf31aXVTr/Ukb9gKDwgWoygNXw4V3QSoyFL8ndlwy BOR122IUB3ytEbC2pOcEzQORzWUlOf2Fjd7CpXBkRH+mNCRjBEigi5a404WRLb4fvY 4hzkKuUi82CSDuhBld2Ysu3dytTEP4IypoZomWIi9Y5o7Wei7gzzp//R2zU1E9eicU vIq0S0Gq80/jdqsQFX6RmNiN+yqTtQz9knruiqUH71FZsn5KnE35oGfUU2JJRwGOGK 60Y5fUG9yfMx5dCXrKpgEfAaHI1GoC9ydhtOxoKrfWZnKG9wgEjvyfqOLT55jRRTht AaFBtPtSmtKXn8/fTn3jKGp1mnd4LUvMfsG/f9X0dFlhUq3ALZGJcRvNX+aMUJrnWu GmdPOgUkrhBBr44I6ekkkqrxp5telNfZPThMBJw0tANqBJUmTVySPLxSYgkhlso5bR /yiXW+/3uANaO1GZZFFZWIKo= Mail-Followup-To: guile-user@gnu.org Content-Disposition: inline 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:18878 Archived-At: --yF6h7jimBRQvXD0a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, I'm having a problem of getting borderline useless stack traces from a scri= pt executed via a shebang. For example, let's consider following script: $ 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")) 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 #) 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 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. Thank you, W. --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --yF6h7jimBRQvXD0a Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmPb4KkACgkQL7/ufbZ/ wakgAA//TrYdZQxrE1wl9bxZ1r9Tvw1kg+n9eK74ME6d3FkN71pxZHAZ/3mXvyT/ DKUSfzyCRGl73aKjvfbWGrp62TcihtBbTP1hYlLJ6umMnoM1cm1WPBzkj/uWQmEU YlBAVORexCgWg6vUsovHwDi6RZPmwRGMnWy44VsT4QPcijX2y3v4eUuR4utN+HS9 D3rb4Qf3RA9wgvScl0pYi50UV3JQwzH6ARlD/npjjcH5M4h50zuoLjh86+Ntlgn9 xqY9THbrd0DuUu63GgwqZfVPtWzGzHGfuH/ynUph1Ut9Q9HcVaVXeJk0oBjpz/aB HMseTEZz/x0XN++b6wfHm77Ypwy8gD97/PFarYHaRwvc4pFxKFBTiJt17/KKeb5Z qDMEJx+6vYKkGbVM24wDvt02TfbAXRLWneOV1KBPlJSu1thZRaPzo3X2fy5wOXOy pciPrSK+MIqV4fBuF3XAD1oDxE7MOD9L/fGgPSSUdgsmjyU+Eoz3JqOlOawvO4jV 3ccPRp+RY0Qt8We/pUy6KNiBbPPgVtwTuNfh1MObzRSV/tZtlltQI4eqvxZaCBk5 2kFwOSjiucKhd6C39np2IK7fvhvOPQNT4JEnqG7/pcNkzfTswYSpngC4BvSSQGKr RIsZEhucYKTwuyE4znwiFHtK1l+UGJY4888GUNIAuAFDEY6X2zU= =Sncf -----END PGP SIGNATURE----- --yF6h7jimBRQvXD0a--