unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* guile 2.1.7 skips while condition
@ 2017-03-09 14:31 Arne Babenhauserheide
  2017-03-10 11:14 ` Andy Wingo
  0 siblings, 1 reply; 8+ messages in thread
From: Arne Babenhauserheide @ 2017-03-09 14:31 UTC (permalink / raw)
  To: guile-devel

Hi,

I have a file in which guile 2.1.7 runs a loop like the following

    (while (not (eof-object? nextchar))
           (write (eof-object? nextchar))
           (set! nextchar (read-char)) ...)

But ends with #<eof>. Guile 2.0 does not show the #<eof>.

However I did not manage to reproduce it in a small example, therefore I
pastebinned the whole file:

script: https://paste.pound-python.org/show/0IlalBrxVH7KHjW83ayu/
input: https://paste.pound-python.org/show/ZxQsazFfwVrvz9f4SU4f/

The file has some added debug output (hence the #f#f#f ... in the output below)

call: guile script input

This results in the error:

$ wget -O script https://paste.pound-python.org/raw/0IlalBrxVH7KHjW83ayu/
$ wget -O input https://paste.pound-python.org/raw/ZxQsazFfwVrvz9f4SU4f/
$ guile script input
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /tmp/script
;;; compiled /home/arne/.cache/guile/ccache/2.2-LE-8-3.9/tmp/script.go
#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#tBacktrace:
9 (apply-smob/1 #<catch-closure 715020>)
In ice-9/boot-9.scm:
713:2  8 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
608:8  7 (_ #(#(#<directory (guile-user) 7c96c0>)))
In ice-9/boot-9.scm:
2346:4  6 (save-module-excursion _)
3850:12  5 (_)
In /tmp/script:
831:17  4 (_)
816:20  3 (wisp2lisp _)
389:24  2 (linestoindented _)
364:57  1 (splitindent #<input: string 8b0150>)
In unknown file:
0 (string #<eof>)

ERROR: In procedure string:
ERROR: In procedure string: Wrong type (expecting character): #<eof>


while Guile 2.0 works:

$ guile-2.0 script input
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /tmp/script
;;; compiled /home/arne/.cache/guile/ccache/2.0-LE-8-2.0/tmp/script.go
#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f; Test linebreaks in strings and brackets

"flubbub

flabbab"

(hrug (nadda
       madda gadda "shoktom
 mee"  " sep  
ka"
 hadda)
      (gom))

(flu)

(sum [foo
      bar] barz {1 + [* 2 2]})

(mara {
       li
       +
       lo - (mabba)
       })

Best wishes,
Arne



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: guile 2.1.7 skips while condition
  2017-03-09 14:31 guile 2.1.7 skips while condition Arne Babenhauserheide
@ 2017-03-10 11:14 ` Andy Wingo
  2017-03-11 16:38   ` Arne Babenhauserheide
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Wingo @ 2017-03-10 11:14 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: guile-devel

On Thu 09 Mar 2017 15:31, Arne Babenhauserheide <arne_bab@web.de> writes:

> However I did not manage to reproduce it in a small example, therefore I
> pastebinned the whole file:
>
> script: https://paste.pound-python.org/show/0IlalBrxVH7KHjW83ayu/
> input: https://paste.pound-python.org/show/ZxQsazFfwVrvz9f4SU4f/

Sounds like you found a nice bug.  This is a big script though; have you
tried incrementally removing parts of it to winnow it down?  That is
definitely the first step to fixing the bug :)

Andy



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: guile 2.1.7 skips while condition
  2017-03-10 11:14 ` Andy Wingo
@ 2017-03-11 16:38   ` Arne Babenhauserheide
  2017-03-13 17:09     ` Arne Babenhauserheide
  0 siblings, 1 reply; 8+ messages in thread
From: Arne Babenhauserheide @ 2017-03-11 16:38 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 908 bytes --]


Andy Wingo <wingo@pobox.com> writes:

> On Thu 09 Mar 2017 15:31, Arne Babenhauserheide <arne_bab@web.de> writes:
>
>> However I did not manage to reproduce it in a small example, therefore I
>> pastebinned the whole file:
>>
>> script: https://paste.pound-python.org/show/0IlalBrxVH7KHjW83ayu/
>> input: https://paste.pound-python.org/show/ZxQsazFfwVrvz9f4SU4f/
>
> Sounds like you found a nice bug.  This is a big script though; have you
> tried incrementally removing parts of it to winnow it down?  That is
> definitely the first step to fixing the bug :)

I tried building a minimal working example, but not removing stuff bit
by bit (due to time constraints on free creative time). I would hope
that it shouldn’t be too complex, but cannot promise I’d get it done
within the next few weeks.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: guile 2.1.7 skips while condition
  2017-03-11 16:38   ` Arne Babenhauserheide
@ 2017-03-13 17:09     ` Arne Babenhauserheide
  2017-03-13 19:49       ` Andy Wingo
                         ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Arne Babenhauserheide @ 2017-03-13 17:09 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: Andy Wingo, guile-devel


Arne Babenhauserheide writes:

> Andy Wingo <wingo@pobox.com> writes:
>
>> On Thu 09 Mar 2017 15:31, Arne Babenhauserheide <arne_bab@web.de> writes:
>>
>>> However I did not manage to reproduce it in a small example, therefore I
>>> pastebinned the whole file:
>>>
>>> script: https://paste.pound-python.org/show/0IlalBrxVH7KHjW83ayu/
>>> input: https://paste.pound-python.org/show/ZxQsazFfwVrvz9f4SU4f/
>>
>> Sounds like you found a nice bug.  This is a big script though; have you
>> tried incrementally removing parts of it to winnow it down?  That is
>> definitely the first step to fixing the bug :)
>
> I tried building a minimal working example, but not removing stuff bit
> by bit (due to time constraints on free creative time). I would hope
> that it shouldn’t be too complex, but cannot promise I’d get it done
> within the next few weeks.

Here’s a shortened version:

$ wget -O script https://paste.pound-python.org/raw/xbrz8bRPSwPxFvR54kAc/
$ wget -O input https://paste.pound-python.org/raw/UvlhjC3woe0EKq1JiIhO/

$ guile-2.0 script input
#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f

$ guile-2.2 script input
#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#f#tBacktrace:
9 (apply-smob/1 #<catch-closure 715020>)
In ice-9/boot-9.scm:
713:2  8 (call-with-prompt _ _ #<procedure default-prompt-handle&>)
In ice-9/eval.scm:
608:8  7 (_ #(#(#<directory (guile-user) 7c96c0>)))
In ice-9/boot-9.scm:
2346:4  6 (save-module-excursion _)
3850:12  5 (_)
In /tmp/script:
348:17  4 (_)
340:20  3 (wisp2lisp _)
320:24  2 (linestoindented _)
295:57  1 (splitindent #<input: string 8b0150>)
In unknown file:
0 (string #<eof>)

ERROR: In procedure string:
ERROR: In procedure string: Wrong type (expecting character): #<eof>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: guile 2.1.7 skips while condition
  2017-03-13 17:09     ` Arne Babenhauserheide
@ 2017-03-13 19:49       ` Andy Wingo
  2017-03-13 20:35       ` Andy Wingo
  2017-03-13 21:20       ` Andy Wingo
  2 siblings, 0 replies; 8+ messages in thread
From: Andy Wingo @ 2017-03-13 19:49 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: guile-devel

On Mon 13 Mar 2017 18:09, Arne Babenhauserheide <arne_bab@web.de> writes:

> Here’s a shortened version:

Thanks.  Here's a shorter version :)

(call-with-input-string "A"
  (lambda (inport)
    (let ((nextchar (read-char inport)))
      (while (not (eof-object? nextchar))
        (pk nextchar)
        (set! nextchar (read-char inport))
        (continue)))))

Working on a fix.

Andy



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: guile 2.1.7 skips while condition
  2017-03-13 17:09     ` Arne Babenhauserheide
  2017-03-13 19:49       ` Andy Wingo
@ 2017-03-13 20:35       ` Andy Wingo
  2017-03-13 21:20       ` Andy Wingo
  2 siblings, 0 replies; 8+ messages in thread
From: Andy Wingo @ 2017-03-13 20:35 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: guile-devel

On Mon 13 Mar 2017 18:09, Arne Babenhauserheide <arne_bab@web.de> writes:

> Arne Babenhauserheide writes:
>
>> Andy Wingo <wingo@pobox.com> writes:
>>
>>> On Thu 09 Mar 2017 15:31, Arne Babenhauserheide <arne_bab@web.de> writes:
>>>
>>>> However I did not manage to reproduce it in a small example, therefore I
>>>> pastebinned the whole file:
>>>>
>>>> script: https://paste.pound-python.org/show/0IlalBrxVH7KHjW83ayu/
>>>> input: https://paste.pound-python.org/show/ZxQsazFfwVrvz9f4SU4f/
>>>
>>> Sounds like you found a nice bug.  This is a big script though; have you
>>> tried incrementally removing parts of it to winnow it down?  That is
>>> definitely the first step to fixing the bug :)
>>
>> I tried building a minimal working example, but not removing stuff bit
>> by bit (due to time constraints on free creative time). I would hope
>> that it shouldn’t be too complex, but cannot promise I’d get it done
>> within the next few weeks.
>
> Here’s a shortened version:

Or even smaller:

(define (t)
  (let ((n #t))
    (let lp ()
      (when n
        (call-with-prompt 'foo
          (lambda ()
            (set! n #f)
            (abort-to-prompt 'foo))
          (lambda (k)
            (lp)))))))

Guile is thinking that the n is always true because it doesn't
understand that aborting back to the prompt means that possible all
mutable objects are mutated.

Andy



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: guile 2.1.7 skips while condition
  2017-03-13 17:09     ` Arne Babenhauserheide
  2017-03-13 19:49       ` Andy Wingo
  2017-03-13 20:35       ` Andy Wingo
@ 2017-03-13 21:20       ` Andy Wingo
  2017-03-14 16:51         ` Arne Babenhauserheide
  2 siblings, 1 reply; 8+ messages in thread
From: Andy Wingo @ 2017-03-13 21:20 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: guile-devel

On Mon 13 Mar 2017 18:09, Arne Babenhauserheide <arne_bab@web.de> writes:

> ERROR: In procedure string:
> ERROR: In procedure string: Wrong type (expecting character): #<eof>

Fixed, I think.  Thanks for the report.

Andy



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: guile 2.1.7 skips while condition
  2017-03-13 21:20       ` Andy Wingo
@ 2017-03-14 16:51         ` Arne Babenhauserheide
  0 siblings, 0 replies; 8+ messages in thread
From: Arne Babenhauserheide @ 2017-03-14 16:51 UTC (permalink / raw)
  To: Andy Wingo; +Cc: Arne Babenhauserheide, guile-devel


Andy Wingo writes:

> On Mon 13 Mar 2017 18:09, Arne Babenhauserheide <arne_bab@web.de> writes:
>
>> ERROR: In procedure string:
>> ERROR: In procedure string: Wrong type (expecting character): #<eof>
>
> Fixed, I think.  Thanks for the report.

That’s awesome! Thank you!

Best wishes,
Arne

PS: I did not test the fix, yet.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-03-14 16:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-09 14:31 guile 2.1.7 skips while condition Arne Babenhauserheide
2017-03-10 11:14 ` Andy Wingo
2017-03-11 16:38   ` Arne Babenhauserheide
2017-03-13 17:09     ` Arne Babenhauserheide
2017-03-13 19:49       ` Andy Wingo
2017-03-13 20:35       ` Andy Wingo
2017-03-13 21:20       ` Andy Wingo
2017-03-14 16:51         ` Arne Babenhauserheide

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).