GNU bug report logs - #26107
Inaccurate location info for unbound-variable errors

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: ludo@HIDDEN (Ludovic Courtès); dated Wed, 15 Mar 2017 14:04:02 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 Mar 2017 14:03:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 15 10:03:57 2017
Received: from localhost ([127.0.0.1]:57278 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1co9Wu-0004jj-PS
	for submit <at> debbugs.gnu.org; Wed, 15 Mar 2017 10:03:57 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38564)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1co9Wt-0004jW-3E
 for submit <at> debbugs.gnu.org; Wed, 15 Mar 2017 10:03:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1co9Wn-0007yt-2I
 for submit <at> debbugs.gnu.org; Wed, 15 Mar 2017 10:03:49 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
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 <ludo@HIDDEN>) id 1co9Wm-0007yn-Ve
 for submit <at> debbugs.gnu.org; Wed, 15 Mar 2017 10:03:48 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57755)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1co9Wi-0002HV-RW
 for bug-guile@HIDDEN; Wed, 15 Mar 2017 10:03:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1co9Wf-0007xE-P9
 for bug-guile@HIDDEN; Wed, 15 Mar 2017 10:03:44 -0400
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56007)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1co9Wf-0007x8-MG
 for bug-guile@HIDDEN; Wed, 15 Mar 2017 10:03:41 -0400
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 <ludo@HIDDEN>) id 1co9We-0006Ur-SG
 for bug-guile@HIDDEN; Wed, 15 Mar 2017 10:03:41 -0400
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: bug-guile@HIDDEN
Subject: Inaccurate location info for unbound-variable errors
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?=
 =?utf-8?Q?=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
Date: Wed, 15 Mar 2017 15:03:37 +0100
Message-ID: <874lyuab7q.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

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 #<catch-closure 1312aa0>)
In ice-9/boot-9.scm:
    710:2 17 (call-with-prompt _ _ #<procedure default-prompt-handler (k pr=
oc)>)
In ice-9/eval.scm:
    619:8 16 (_ #(#(#<directory (guile-user) 13ba1e0>)))
In /gnu/store/4xir0dlzxl7h5v7va9rz8x3mvarlv2fd-profile/bin/guild:
    72:17 15 (main _)
In srfi/srfi-1.scm:
    640:9 14 (for-each #<procedure 128be40 at scripts/compile.scm:248:14 (f=
ile)> ("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 (_ #<closed: file 160a0e0>)
   224:14  6 (read-and-compile _ #:from _ #:to _ #:env _ #:opts _)
    255:6  5 (compile _ #:from _ #:to _ #:env _ #:opts _)
   183:32  4 (compile-fold _ #<tree-il (call (toplevel list) (const a) (cal=
l (toplevel symbol->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 #<procedure 1345d60 at language/bytecod=
e/spec.scm:33:9 ()>)
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.




Acknowledgement sent to ludo@HIDDEN (Ludovic Courtès):
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#26107; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.