GNU bug report logs - #12182
guile 2.0.6: "Value out of range: 0" when compiling a procedure

Previous Next

Package: guile;

Reported by: Feufochmar <guill.delacourt <at> gmail.com>

Date: Sat, 11 Aug 2012 22:22:01 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ian Price <ianprice90 <at> googlemail.com>
To: Feufochmar <guill.delacourt <at> gmail.com>
Cc: 12182 <at> debbugs.gnu.org
Subject: bug#12182: guile 2.0.6: "Value out of range: 0" when compiling a procedure
Date: Sun, 12 Aug 2012 12:29:32 +0100
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"




This bug report was last modified 12 years and 240 days ago.

Previous Next


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