GNU bug report logs - #48089
Guile 3.0.6 returns zero-indexed locations for ‘read-error’

Previous Next

Package: guile;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Wed, 28 Apr 2021 22:35:01 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48089 in the body.
You can then email your comments to 48089 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#48089; Package guile. (Wed, 28 Apr 2021 22:35:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Wed, 28 Apr 2021 22:35:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: bug-guile <at> gnu.org
Subject: Guile 3.0.6 returns zero-indexed locations for ‘read-error’
Date: Thu, 29 Apr 2021 00:33:54 +0200
Hi,

Guile 3.0.6 returns zero-indexed (instead of one-indexed) source code
locations for ‘read-error’.  Here’s a 3.0.6/3.0.5 comparison:

--8<---------------cut here---------------start------------->8---
$ /gnu/store/r2nr74rwhpqg16y1lyi6l0jn3lwx4yyz-guile-3.0.6/bin/guile  <(echo '(')
ice-9/read.scm:126:4: In procedure lp:
/dev/fd/63:1:0: unexpected end of input while searching for: )
$ guile  <(echo '(')
ERROR: In procedure primitive-load:
In procedure scm_i_lreadparen: /dev/fd/63:2:1: end of file
--8<---------------cut here---------------end--------------->8---

Ludo’.




Information forwarded to bug-guile <at> gnu.org:
bug#48089; Package guile. (Thu, 29 Apr 2021 09:34:02 GMT) Full text and rfc822 format available.

Message #8 received at 48089 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 48089 <at> debbugs.gnu.org
Cc: Andy Wingo <wingo <at> pobox.com>
Subject: Re: bug#48089: Guile 3.0.6 returns zero-indexed locations for
 ‘read-error’
Date: Thu, 29 Apr 2021 11:33:27 +0200
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> skribis:

> Guile 3.0.6 returns zero-indexed (instead of one-indexed) source code
> locations for ‘read-error’.  Here’s a 3.0.6/3.0.5 comparison:
>
> $ /gnu/store/r2nr74rwhpqg16y1lyi6l0jn3lwx4yyz-guile-3.0.6/bin/guile  <(echo '(')
> ice-9/read.scm:126:4: In procedure lp:
> /dev/fd/63:1:0: unexpected end of input while searching for: )
> $ guile  <(echo '(')
> ERROR: In procedure primitive-load:
> In procedure scm_i_lreadparen: /dev/fd/63:2:1: end of file

Here’s a test case waiting to succeed!  :-)

[Message part 2 (text/x-patch, inline)]
diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test
index fad531b39..231e69553 100644
--- a/test-suite/tests/reader.test
+++ b/test-suite/tests/reader.test
@@ -212,6 +212,18 @@
 
 
 (with-test-prefix "mismatching parentheses"
+  (pass-if-equal "read-error location"
+      '("foo.scm:3:1: unexpected end of input while searching for: ~A" #\))
+    (catch 'read-error
+      (lambda ()
+        ;; The missing closing paren error should be located on line 3,
+        ;; column 1 (one-indexed).
+        (call-with-input-string "\n    (hi there!\n"
+          (lambda (port)
+            (set-port-filename! port "foo.scm")
+            (read port))))
+      (lambda (key proc message args . _)
+        (cons message args))))
   (pass-if-exception "opening parenthesis"
     exception:eof
     (read-string "("))
[Message part 3 (text/plain, inline)]
Ludo’.

Reply sent to Andy Wingo <wingo <at> pobox.com>:
You have taken responsibility. (Thu, 29 Apr 2021 20:06:01 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Thu, 29 Apr 2021 20:06:01 GMT) Full text and rfc822 format available.

Message #13 received at 48089-done <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 48089-done <at> debbugs.gnu.org
Subject: Re: bug#48089: Guile 3.0.6 returns zero-indexed locations for
 ‘read-error’
Date: Thu, 29 Apr 2021 22:04:52 +0200
Done :)

On Thu 29 Apr 2021 11:33, Ludovic Courtès <ludo <at> gnu.org> writes:

> Ludovic Courtès <ludo <at> gnu.org> skribis:
>
>> Guile 3.0.6 returns zero-indexed (instead of one-indexed) source code
>> locations for ‘read-error’.  Here’s a 3.0.6/3.0.5 comparison:
>>
>> $ /gnu/store/r2nr74rwhpqg16y1lyi6l0jn3lwx4yyz-guile-3.0.6/bin/guile  <(echo '(')
>> ice-9/read.scm:126:4: In procedure lp:
>> /dev/fd/63:1:0: unexpected end of input while searching for: )
>> $ guile  <(echo '(')
>> ERROR: In procedure primitive-load:
>> In procedure scm_i_lreadparen: /dev/fd/63:2:1: end of file
>
> Here’s a test case waiting to succeed!  :-)
>
> diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test
> index fad531b39..231e69553 100644
> --- a/test-suite/tests/reader.test
> +++ b/test-suite/tests/reader.test
> @@ -212,6 +212,18 @@
>  
>  
>  (with-test-prefix "mismatching parentheses"
> +  (pass-if-equal "read-error location"
> +      '("foo.scm:3:1: unexpected end of input while searching for: ~A" #\))
> +    (catch 'read-error
> +      (lambda ()
> +        ;; The missing closing paren error should be located on line 3,
> +        ;; column 1 (one-indexed).
> +        (call-with-input-string "\n    (hi there!\n"
> +          (lambda (port)
> +            (set-port-filename! port "foo.scm")
> +            (read port))))
> +      (lambda (key proc message args . _)
> +        (cons message args))))
>    (pass-if-exception "opening parenthesis"
>      exception:eof
>      (read-string "("))
>
>
> Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 28 May 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 330 days ago.

Previous Next


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