bugKawa - Bugs: bug #27011, ArrayIndexOutOfBoundsException...

 
 

bug #27011: ArrayIndexOutOfBoundsException after 20 local variables

Submitter:  Helmut Eller <ellerh>
Submitted:  Sat 11 Jul 2009 07:13:51 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 17 Jul 2009 09:16:37 AM UTC, comment #4: 

I decided to not check in the test-case.  It only fails when compiling (-C).  On a fixed compiler the test-case doesn't run, because x0 is out of scope in:
  (let (... (x1 x0) ...) ...)
When I fix the test-case, I don't get the error, even in a non-fixed compiler.  Strange ...

Per Bothner <bothner>
Group administrator
Wed 15 Jul 2009 01:37:23 PM UTC, comment #3: 

I checked in a preliminary fix for the bigger test-case.

Per Bothner <bothner>
Group administrator
Sun 12 Jul 2009 06:04:50 AM UTC, comment #2: 

The problem seems to occur again in Kawa 1.9.3 (revision 6292M) with 40 local variables:

(define (freaking-big-let)
  (let ((x0   "0")
        (x1   x0 )
        (x2   x1 )
        (x3   x2 )
        (x4   x3 )
        (x5   x4 )
        (x6   x5 )
        (x7   x6 )
        (x8   x7 )
        (x9   x8 )
        (x10  x9 )
        (x11  x10)
        (x12  x11)
        (x13  x12)
        (x14  x13)
        (x15  x14)
        (x16  x15)
        (x17  x16)
        (x18  x17)
        (x19  x18)
        (x20  x19)
        (x21  x20)
        (x22  x21)
        (x23  x22)
        (x24  x23)
        (x25  x24)
        (x26  x25)
        (x27  x26)
        (x28  x27)
        (x29  x28)
        (x30  x29)
        (x31  x30)
        (x32  x31)
        (x33  x32)
        (x34  x33)
        (x35  x34)
        (x36  x35)
        (x37  x36)
        (x38  x37)
        (x39  x38)
        (x40  x39)
        (x41  x40)
        (x42  x41))
    (set! x0   x1   )
    (set! x1   x2   )
    (set! x2   x3   )
    (set! x3   x4   )
    (set! x4   x5   )
    (set! x5   x6   )
    (set! x6   x7   )
    (set! x7   x8   )
    (set! x8   x9   )
    (set! x9   x10  )
    (set! x10  x11  )
    (set! x11  x12  )
    (set! x12  x13  )
    (set! x13  x14  )
    (set! x14  x15  )
    (set! x15  x16  )
    (set! x16  x17  )
    (set! x17  x18  )
    (set! x18  x19  )
    (set! x19  x20  )
    (set! x20  x21  )
    (set! x21  x22  )
    (set! x22  x23  )
    (set! x23  x24  )
    (set! x24  x25  )
    (set! x25  x26  )
    (set! x26  x27  )
    (set! x27  x28  )
    (set! x28  x29  )
    (set! x29  x30  )
    (set! x30  x31  )
    (set! x31  x32  )
    (set! x32  x33  )
    (set! x33  x34  )
    (set! x34  x35  )
    (set! x35  x36  )
    (set! x36  x37  )
    (set! x37  x38  )
    (set! x38  x39  )
    (set! x39  x40  )
    (set! x40  x41  )
    x0))

big-let.scm:3: internal error while compiling big-let.scm
java.lang.ArrayIndexOutOfBoundsException: 42
        at gnu.bytecode.CodeAttr.noteVarType(CodeAttr.java:363)
        at gnu.bytecode.CodeAttr.emitStore(CodeAttr.java:1350)
        at gnu.expr.Declaration.compileStore(Declaration.java:318)
        at gnu.expr.LetExp.store_rest(LetExp.java:137)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.compile(LetExp.java:188)
        at gnu.expr.Expression.compileNotePosition(Expression.java:159)
        at gnu.expr.Expression.compileWithPosition(Expression.java:145)
        at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1608)
        at gnu.expr.LambdaExp.compileAsMethod(LambdaExp.java:1584)
        at gnu.expr.LambdaExp.compileSetField(LambdaExp.java:650)
        at gnu.expr.SetExp.compile(SetExp.java:172)
        at gnu.expr.Expression.compileNotePosition(Expression.java:159)
        at gnu.expr.Expression.compileWithPosition(Expression.java:145)
        at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1608)
        at gnu.expr.Compilation.generateBytecode(Compilation.java:2016)
        at gnu.expr.Compilation.process(Compilation.java:1892)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:308)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:293)
        at kawa.repl.compileFiles(repl.java:803)
        at kawa.repl.processArgs(repl.java:457)
        at kawa.repl.main(repl.java:866)


Helmut Eller <ellerh>
Sat 11 Jul 2009 06:04:27 PM UTC, comment #1: 

Thanks!  I checked in the fix and the test-case.

Per Bothner <bothner>
Group administrator
Sat 11 Jul 2009 07:13:51 AM UTC, original submission:  

Compiling code like this:
(define (big-let) ; no argument!
  (define x0  "a")
  (define x1  "a")
  (define x2  "a")
  (define x3  "a")
  (define x4  "a")
  (define x5  "a")
  (define x6  "a")
  (define x7  "a")
  (define x8  "a")
  (define x9  "a")
  (define x10 "a")
  (define x11 "a")
  (define x12 "a")
  (define x13 "a")
  (define x14 "a")
  (define x15 "a")
  (define x16 "a")
  (define x17 "a")
  (define x18 "a")
  (define x19 "a")
  (define x20 "a")
  (set! x0  x1 )
  (set! x1  x2 )
  (set! x2  x3 )
  (set! x3  x4 )
  (set! x4  x5 )
  (set! x5  x6 )
  (set! x6  x7 )
  (set! x7  x8 )
  (set! x8  x9 )
  (set! x9  x10)
  (set! x10 x11)
  (set! x11 x12)
  (set! x12 x13)
  (set! x13 x14)
  (set! x14 x15)
  (set! x15 x16)
  (set! x16 x17)
  (set! x17 x18)
  (set! x18 x19)
  (set! x19 x20)
  (set! x20 x0 )
  x0)

aborts with this exception:

big-let.scm:3: internal error while compiling big-let.scm
java.lang.ArrayIndexOutOfBoundsException: 20
        at gnu.bytecode.CodeAttr.noteVarType(CodeAttr.java:363)
        at gnu.bytecode.CodeAttr.emitStore(CodeAttr.java:1350)
        at gnu.expr.Declaration.compileStor(Declaration.java:318)
        at gnu.expr.LetExp.store_rest(LetExp.java:137)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.store_rest(LetExp.java:120)
        at gnu.expr.LetExp.compile(LetExp.java:188)
        at gnu.expr.Expression.compileNotePosition(Expression.java:159)
        at gnu.expr.Expression.compileWithPosition(Expression.java:145)
        at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1608)
        at gnu.expr.LambdaExp.compileAsMethod(LambdaExp.java:1584)
        at gnu.expr.LambdaExp.compileSetField(LambdaExp.java:650)
        at gnu.expr.SetExp.compile(SetExp.java:172)
        at gnu.expr.Expression.compileNotePosition(Expression.java:159)
        at gnu.expr.Expression.compileWithPosition(Expression.java:145)
        at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1608)
        at gnu.expr.Compilation.generateBytecode(Compilation.java:2016)
        at gnu.expr.Compilation.process(Compilation.java:1892)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:308)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:293)
        at kawa.repl.compileFiles(repl.java:803)
        at kawa.repl.processArgs(repl.java:457)
        at kawa.repl.main(repl.java:866)

Kawa version: 1.9.3 (revision 6289M)

Helmut Eller <ellerh>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bothner (Posted a comment)
  • -email is unavailable- added by ellerh (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-07-17 bothner Open/ClosedOpen Closed
    2009-07-15 bothner Open/ClosedClosed Open
    2009-07-11 bothner StatusNone Fixed
        Assigned toNone bothner
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code