GNU bug report logs -
#12182
guile 2.0.6: "Value out of range: 0" when compiling a procedure
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12182 in the body.
You can then email your comments to 12182 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guile <at> gnu.org
:
bug#12182
; Package
guile
.
(Sat, 11 Aug 2012 22:22:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Feufochmar <guill.delacourt <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-guile <at> gnu.org
.
(Sat, 11 Aug 2012 22:22:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello,
guile 2.0.6 fails to compile the following procedure with the error "Value out of range: 0".
~~~~~~~
;; get all points inside a distance of the half-line starting from (x0 . y0) and containing (x1 . y1)
;; the argument dist is the square of the distance we want to reach
(define (get-half-line-points x0 y0 x1 y1 dist)
(if (and (eq? x0 x1) (eq? y0 y1))
(list (cons x0 y0))
(letrec*
((steep? (> (abs (- y1 y0)) (abs (- x1 x0))))
(x-orig (if steep? y0 x0))
(y-orig (if steep? x0 y0))
(x-dest (if steep? y1 x1))
(y-dest (if steep? x1 y1))
(delta-x (abs (- x-dest x-orig)))
(delta-y (abs (- y-dest y-orig)))
(delta-err (/ delta-y delta-x))
(x-step (if (< x-orig x-dest) 1 -1))
(y-step (if (< y-orig y-dest) 1 -1))
(plot
(lambda (x y error points)
(if (< dist (+ (expt (- x x-orig) 2) (expt (- y y-orig) 2)))
(reverse points)
(let ((new-error (+ error delta-err)))
(plot
(+ x-step x)
(if (>= new-error 0.5) (+ y y-step) y)
(if (>= new-error 0.5) (- new-error 1) new-error)
(cons (if steep? (cons y x) (cons x y)) points)))))))
(plot x-orig y-orig 0 '()) )))
~~~~~~~
The backtrace I have with guild compile :
$ guild compile test.scm
Backtrace:
In language/tree-il/optimize.scm:
44: 19 [optimize! #<tree-il (lambda () #)> #<module (#{ g40}#) 2097ab0> ...]
In language/tree-il/cse.scm:
537: 18 [visit #<tree-il (lambda () (lambda-case #))> #<vlist ()> ...]
543: 17 [visit #<tree-il (lambda-case (# #))> #<vhash 22cf540 1 pairs> ...]
483: 16 [visit #<tree-il #> #<vhash 22cf540 1 pairs> #<vlist ()> ...]
537: 15 [visit #<tree-il (lambda (#) (lambda-case #))> #<vhash 22cf540 1 pairs> ...]
543: 14 [visit #<tree-il (lambda-case (# #))> #<vhash 22cf4a0 2 pairs> ...]
429: 13 [visit #<tree-il (let # # # ...)> #<vhash 22cf4a0 2 pairs> #<vlist ()> ...]
370: 12 [lp (#<tree-il (lambda () #)>) () #<vlist ()>]
537: 11 [visit #<tree-il (lambda () (lambda-case #))> #<vhash 22cf4a0 2 pairs> ...]
543: 10 [visit #<tree-il (lambda-case (# #))> #<vhash 22cf400 3 pairs> ...]
437: 9 [visit #<tree-il (letrec* # # ...)> #<vhash 22cf400 3 pairs> ...]
533: 8 [visit #<tree-il (apply # # ...)> #<vhash 23250e0 19 pairs> ...]
370: 7 [lp (#<tree-il #> #<tree-il #> #<tree-il #> #<tree-il #>) () #<vlist ()>]
533: 6 [visit #<tree-il (apply # #)> #<vhash 23250e0 19 pairs> ...]
370: 5 [lp (#<tree-il (if # # #)>) () #<vlist ()>]
403: 4 [return #<tree-il (if # # #)> #<vlist ()>]
333: 3 [find-dominating-lexical #<tree-il (if # # ...)> 0 ...]
315: 2 [unroll #<vhash 23250e0 19 pairs> 19 13]
In ice-9/vlist.scm:
303: 1 [vlist-ref #<vhash 23250e0 19 pairs> 19]
In ice-9/boot-9.scm:
106: 0 [#<procedure 204f280 at ice-9/boot-9.scm:97:6 (thrown-k . args)> out-of-range ...]
ice-9/boot-9.scm:106:20: In procedure #<procedure 204f280 at ice-9/boot-9.scm:97:6 (thrown-k . args)>:
ice-9/boot-9.scm:106:20: Value out of range: 0
Feufochmar
Information forwarded
to
bug-guile <at> gnu.org
:
bug#12182
; Package
guile
.
(Sun, 12 Aug 2012 11:39:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 12182 <at> debbugs.gnu.org (full text, mbox):
Feufochmar <guill.delacourt <at> gmail.com> writes:
>
> The backtrace I have with guild compile :
>
> $ guild compile test.scm
> Backtrace:
> In language/tree-il/optimize.scm:
> 44: 19 [optimize! #<tree-il (lambda () #)> #<module (#{ g40}#) 2097ab0> ...]
> In language/tree-il/cse.scm:
> 537: 18 [visit #<tree-il (lambda () (lambda-case #))> #<vlist ()> ...]
> 543: 17 [visit #<tree-il (lambda-case (# #))> #<vhash 22cf540 1 pairs> ...]
> 483: 16 [visit #<tree-il #> #<vhash 22cf540 1 pairs> #<vlist ()> ...]
> 537: 15 [visit #<tree-il (lambda (#) (lambda-case #))> #<vhash 22cf540 1 pairs> ...]
> 543: 14 [visit #<tree-il (lambda-case (# #))> #<vhash 22cf4a0 2 pairs> ...]
> 429: 13 [visit #<tree-il (let # # # ...)> #<vhash 22cf4a0 2 pairs> #<vlist ()> ...]
> 370: 12 [lp (#<tree-il (lambda () #)>) () #<vlist ()>]
> 537: 11 [visit #<tree-il (lambda () (lambda-case #))> #<vhash 22cf4a0 2 pairs> ...]
> 543: 10 [visit #<tree-il (lambda-case (# #))> #<vhash 22cf400 3 pairs> ...]
> 437: 9 [visit #<tree-il (letrec* # # ...)> #<vhash 22cf400 3 pairs> ...]
> 533: 8 [visit #<tree-il (apply # # ...)> #<vhash 23250e0 19 pairs> ...]
> 370: 7 [lp (#<tree-il #> #<tree-il #> #<tree-il #> #<tree-il #>) () #<vlist ()>]
> 533: 6 [visit #<tree-il (apply # #)> #<vhash 23250e0 19 pairs> ...]
> 370: 5 [lp (#<tree-il (if # # #)>) () #<vlist ()>]
> 403: 4 [return #<tree-il (if # # #)> #<vlist ()>]
> 333: 3 [find-dominating-lexical #<tree-il (if # # ...)> 0 ...]
> 315: 2 [unroll #<vhash 23250e0 19 pairs> 19 13]
> In ice-9/vlist.scm:
> 303: 1 [vlist-ref #<vhash 23250e0 19 pairs> 19]
> In ice-9/boot-9.scm:
> 106: 0 [#<procedure 204f280 at ice-9/boot-9.scm:97:6 (thrown-k . args)> out-of-range ...]
>
> ice-9/boot-9.scm:106:20: In procedure #<procedure 204f280 at ice-9/boot-9.scm:97:6 (thrown-k . args)>:
> ice-9/boot-9.scm:106:20: Value out of range: 0
I am not familiar with the cse module, but a quick perusal of the code
leads me to think that the unroll procedure in cse.scm expects the invariant
base + n <= (vlist-length db)
scheme@(guile−user) [1]> ,up
In language/tree−il/cse.scm:
315:10 1 (unroll #<vhash 96cca60 19 pairs> 19 13)
scheme@(guile−user) [1]> ,up
In language/tree−il/cse.scm:
333:28 2 (find−dominating−lexical #<tree−il (if (lexical steep? steep?−818) (le…> …)
scheme@(guile−user) [1]> ,locals
Local variables:
$13 = exp = #<tree−il (if (lexical steep? steep?−818) (lexical y0 y0−814) (lexical x…>
$14 = effects = 0
$15 = env = #<vhash 96cc7a0 11 pairs>
$16 = db = #<vhash 96cca60 19 pairs>
$17 = entry−matches? = #<procedure entry−matches? (v1 v2)>
$18 = unroll = #<procedure unroll (db base n)>
$19 = h = 72117960
$20 = env−len = 11
$21 = db−len = 19
$22 = n = 1
$23 = m = 16
$24 = v = (#(#<tree−il (if (apply (primitive <) (apply (primitive values) (i…> …) . #)
$25 = w = #(#<tree−il (if (apply (primitive <) (apply (primitive values) (if (lex…> …)
$26 = x = 72117960
$27 = len = 4
$28 = w = #<tree−il (if (apply (primitive <) (apply (primitive values) (if (lexical …>
$29 = w = y−step
$30 = w = y−step−827
$31 = w = 3
scheme@(guile−user) [1]> ,use (ice-9 vlist)
scheme@(guile−user) [1]> (vlist-ref $15 $22)
$34 = (#(#<tree−il (if (apply (primitive <) (apply (primitive values) (if (lexical steep? steep?−818) (lexical x0 x0−813) (lexical y0 y0−814))) (apply (primitive values) (if (lexical steep? steep?−818) (lexical x1 x1−815) (lexical y1 y1−816)))) (const 1) (const −1))> y−step y−step−827 3) . 72117960)
The only call to unroll, is (unroll db m (- db-len db-len*))
the missing db-len* is the fourth element of the vector in $34 or 3. So
the call works out at (unroll db 16 (- 19 3)) == (unroll db 16 16)
and obviously 16 + 16 > 19
Not sure if that's helped at all, but the bug intrigued me when he
brought it up on #guile yesterday
--
Ian Price -- shift-reset.com
"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"
Reply sent
to
ludo <at> gnu.org (Ludovic Courtès)
:
You have taken responsibility.
(Fri, 23 Nov 2012 23:22:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Feufochmar <guill.delacourt <at> gmail.com>
:
bug acknowledged by developer.
(Fri, 23 Nov 2012 23:22:03 GMT)
Full text and
rfc822 format available.
Message #13 received at 12182-done <at> debbugs.gnu.org (full text, mbox):
Hi,
Sorry for the late reply.
Feufochmar <guill.delacourt <at> gmail.com> skribis:
> $ guild compile test.scm
> Backtrace:
> In language/tree-il/optimize.scm:
> 44: 19 [optimize! #<tree-il (lambda () #)> #<module (#{ g40}#) 2097ab0> ...]
> In language/tree-il/cse.scm:
> 537: 18 [visit #<tree-il (lambda () (lambda-case #))> #<vlist ()> ...]
> 543: 17 [visit #<tree-il (lambda-case (# #))> #<vhash 22cf540 1 pairs> ...]
> 483: 16 [visit #<tree-il #> #<vhash 22cf540 1 pairs> #<vlist ()> ...]
> 537: 15 [visit #<tree-il (lambda (#) (lambda-case #))> #<vhash 22cf540 1 pairs> ...]
> 543: 14 [visit #<tree-il (lambda-case (# #))> #<vhash 22cf4a0 2 pairs> ...]
> 429: 13 [visit #<tree-il (let # # # ...)> #<vhash 22cf4a0 2 pairs> #<vlist ()> ...]
> 370: 12 [lp (#<tree-il (lambda () #)>) () #<vlist ()>]
> 537: 11 [visit #<tree-il (lambda () (lambda-case #))> #<vhash 22cf4a0 2 pairs> ...]
> 543: 10 [visit #<tree-il (lambda-case (# #))> #<vhash 22cf400 3 pairs> ...]
> 437: 9 [visit #<tree-il (letrec* # # ...)> #<vhash 22cf400 3 pairs> ...]
> 533: 8 [visit #<tree-il (apply # # ...)> #<vhash 23250e0 19 pairs> ...]
> 370: 7 [lp (#<tree-il #> #<tree-il #> #<tree-il #> #<tree-il #>) () #<vlist ()>]
> 533: 6 [visit #<tree-il (apply # #)> #<vhash 23250e0 19 pairs> ...]
> 370: 5 [lp (#<tree-il (if # # #)>) () #<vlist ()>]
> 403: 4 [return #<tree-il (if # # #)> #<vlist ()>]
> 333: 3 [find-dominating-lexical #<tree-il (if # # ...)> 0 ...]
> 315: 2 [unroll #<vhash 23250e0 19 pairs> 19 13]
> In ice-9/vlist.scm:
> 303: 1 [vlist-ref #<vhash 23250e0 19 pairs> 19]
> In ice-9/boot-9.scm:
> 106: 0 [#<procedure 204f280 at ice-9/boot-9.scm:97:6 (thrown-k . args)> out-of-range ...]
>
> ice-9/boot-9.scm:106:20: In procedure #<procedure 204f280 at ice-9/boot-9.scm:97:6 (thrown-k . args)>:
> ice-9/boot-9.scm:106:20: Value out of range: 0
This is the same issue as 12883, which is now fixed in the stable-2.0
branch (will be in 2.0.7):
http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=2c7b7e0f214be5ec5184949a94209668775f60bc
Thanks,
Ludo’.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 22 Dec 2012 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 239 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.