From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#26107: Inaccurate location info for unbound-variable errors Date: Wed, 15 Mar 2017 15:03:37 +0100 Message-ID: <874lyuab7q.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1489587027 15799 195.159.176.226 (15 Mar 2017 14:10:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 15 Mar 2017 14:10:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) To: 26107@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Mar 15 15:10:23 2017 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1co9d5-0003NO-Gm for guile-bugs@m.gmane.org; Wed, 15 Mar 2017 15:10:19 +0100 Original-Received: from localhost ([::1]:37509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1co9dB-0008B7-JX for guile-bugs@m.gmane.org; Wed, 15 Mar 2017 10:10:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1co9X6-0002e1-Pi for bug-guile@gnu.org; Wed, 15 Mar 2017 10:04:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1co9X0-00081t-LE for bug-guile@gnu.org; Wed, 15 Mar 2017 10:04:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59079) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1co9X0-00081l-Il for bug-guile@gnu.org; Wed, 15 Mar 2017 10:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1co9X0-0004k4-AF for bug-guile@gnu.org; Wed, 15 Mar 2017 10:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 15 Mar 2017 14:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26107 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148958663718215 (code B ref -1); Wed, 15 Mar 2017 14:04:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Mar 2017 14:03:57 +0000 Original-Received: from localhost ([127.0.0.1]:57278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1co9Wu-0004jj-PS for submit@debbugs.gnu.org; Wed, 15 Mar 2017 10:03:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1co9Wt-0004jW-3E for submit@debbugs.gnu.org; Wed, 15 Mar 2017 10:03:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1co9Wn-0007yt-2I for submit@debbugs.gnu.org; Wed, 15 Mar 2017 10:03:49 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:58841) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1co9Wm-0007yn-Ve for submit@debbugs.gnu.org; Wed, 15 Mar 2017 10:03:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1co9Wi-0002HV-RW for bug-guile@gnu.org; Wed, 15 Mar 2017 10:03:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1co9Wf-0007xE-P9 for bug-guile@gnu.org; Wed, 15 Mar 2017 10:03:44 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1co9Wf-0007x8-MG for bug-guile@gnu.org; Wed, 15 Mar 2017 10:03:41 -0400 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]:46618 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1co9We-0006Ur-SG for bug-guile@gnu.org; Wed, 15 Mar 2017 10:03:41 -0400 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 25 =?UTF-8?Q?Vent=C3=B4se?= an 225 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8687 Archived-At: Hi! In 2.1.8/2.2.0, walking up the stack to find the origin of an unbound variable error yields inaccurate location info. Consider this: --8<---------------cut here---------------start------------->8--- (list 'a (symbol->string 'b) (symbol->string 'c) ;=E2=86=90 unbound variable error reported here (FOO 'bar) ;=E2=80=A6 instead of here 3 4) --8<---------------cut here---------------end--------------->8--- We get: --8<---------------cut here---------------start------------->8--- $ guild compile -t value t.scm Backtrace: 18 (apply-smob/1 #) In ice-9/boot-9.scm: 710:2 17 (call-with-prompt _ _ #) In ice-9/eval.scm: 619:8 16 (_ #(#(#))) In /gnu/store/4xir0dlzxl7h5v7va9rz8x3mvarlv2fd-profile/bin/guild: 72:17 15 (main _) In srfi/srfi-1.scm: 640:9 14 (for-each # ("t.scm")) In scripts/compile.scm: 251:26 13 (_ _) In system/base/target.scm: 57:6 12 (with-target _ _) In system/base/compile.scm: 152:6 11 (compile-file "t.scm" #:output-file _ #:from _ #:to _ #:env _ = #:opts _ #:canonicalization _) 43:4 10 (call-once _) In ice-9/boot-9.scm: 846:4 9 (with-throw-handler _ _ _) In system/base/compile.scm: 59:11 8 (_) 155:11 7 (_ #) 224:14 6 (read-and-compile _ #:from _ #:to _ #:env _ #:opts _) 255:6 5 (compile _ #:from _ #:to _ #:env _ #:opts _) 183:32 4 (compile-fold _ #string) (const b)) (call (toplevel symbol->string) (con= st c)) (call (toplevel FO=E2=80=A6> =E2=80=A6) In ice-9/boot-9.scm: 2309:4 3 (save-module-excursion #) In language/bytecode/spec.scm: 35:19 2 (_) In t.scm: 3:6 1 (_) ;=E2=86=90 incorrect line number! (expected line 4) In ice-9/boot-9.scm: 757:25 0 (dispatch-exception _ _ _) ice-9/boot-9.scm:757:25: In procedure dispatch-exception: ice-9/boot-9.scm:757:25: In procedure module-lookup: Unbound variable: FOO --8<---------------cut here---------------end--------------->8--- It Would Be Nice if we could get the right location info here, though I understand this is a corner case. Thoughts? Ludo=E2=80=99.