public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* java.lang.VerifyError exception
@ 2014-12-30  1:19 Seth Alves
  2015-01-03 22:23 ` Per Bothner
  2015-02-02 12:14 ` Per Bothner
  0 siblings, 2 replies; 6+ messages in thread
From: Seth Alves @ 2014-12-30  1:19 UTC (permalink / raw)
  To: kawa

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

Here is a boiled-down snippet of nonsense code (it started as part of 
the snow zlib package).

     -seth

$ ./test-kawa.scm
Exception in thread "main" java.lang.VerifyError: Bad local variable type
Exception Details:
   Location:
     fuh$frame.lambda1loop()Ljava/lang/Object; @13: aload_2
   Reason:
     Type top (current frame, locals[2]) is not assignable to reference type
   Current Frame:
     bci: @13
     flags: { }
     locals: { 'fuh$frame', 'fuh$frame0' }
     stack: { }
   Bytecode:
     0000000: bb00 0459 b700 0859 2ab5 000c 4c2c 1008
     0000010: b800 124d 2b05 bd00 1459 03b2 001a 5359
     0000020: 04b2 001e 53b8 0024 b600 28b0

     at fuh.gunzipGenport(test-kawa.scm:11)
     at fuh.apply0(test-kawa.scm:11)
     at gnu.expr.ModuleMethod.apply0(ModuleMethod.java:186)
     at gnu.expr.ModuleMethod.apply(ModuleMethod.java:160)
     at gnu.mapping.CallContext.runUntilDone(CallContext.java:234)
     at test$Mnkawa.run(test-kawa.scm:34)
     at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:317)
     at gnu.expr.CompiledModule.evalModule(CompiledModule.java:42)
     at gnu.expr.CompiledModule.evalModule(CompiledModule.java:61)
     at kawa.Shell.runFile(Shell.java:538)
     at kawa.Shell.runFileOrClass(Shell.java:447)
     at kawa.repl.main(repl.java:881)


[-- Attachment #2: test-kawa.scm --]
[-- Type: text/x-scheme, Size: 701 bytes --]

#! /bin/sh
#| -*- scheme -*-
exec /usr/local/bin/kawa $0 "$@"
|#

(define-library (fuh)
  (export gunzip-genport)
  (import (scheme base))
  (begin

    (define (gunzip-genport)

      (define bk 0) 

      (define (inflate-codes bl)
        (set! bk (+ bk 8)))

      (define (inflate-dynamic)
        (inflate-codes 7))

      (let loop ()
        (inflate-dynamic)
        (let laap ((res (vector 'return #f)))
          (let ((state (vector-ref res 0))
                (r (vector-ref res 1)))
            (case state
              ((return)
               (if r (loop) #f))
              ((flush)
               (lambda () (laap #f))))))))))

(import (scheme base)
        (fuh))
(gunzip-genport)

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

* Re: java.lang.VerifyError exception
  2014-12-30  1:19 java.lang.VerifyError exception Seth Alves
@ 2015-01-03 22:23 ` Per Bothner
  2015-02-02 12:14 ` Per Bothner
  1 sibling, 0 replies; 6+ messages in thread
From: Per Bothner @ 2015-01-03 22:23 UTC (permalink / raw)
  To: kawa

This is bug in the previous "fix" for checkInlineable.
I don't yet have a satisfactory fix - still working on it.

On 12/29/2014 05:19 PM, Seth Alves wrote:
> Here is a boiled-down snippet of nonsense code (it started as part of the snow zlib package).
>
>      -seth
>
> $ ./test-kawa.scm
> Exception in thread "main" java.lang.VerifyError: Bad local variable type
> Exception Details:
>    Location:
>      fuh$frame.lambda1loop()Ljava/lang/Object; @13: aload_2
>    Reason:
>      Type top (current frame, locals[2]) is not assignable to reference type
>    Current Frame:
>      bci: @13
>      flags: { }
>      locals: { 'fuh$frame', 'fuh$frame0' }
>      stack: { }
>    Bytecode:
>      0000000: bb00 0459 b700 0859 2ab5 000c 4c2c 1008
>      0000010: b800 124d 2b05 bd00 1459 03b2 001a 5359
>      0000020: 04b2 001e 53b8 0024 b600 28b0
>
>      at fuh.gunzipGenport(test-kawa.scm:11)
>      at fuh.apply0(test-kawa.scm:11)
>      at gnu.expr.ModuleMethod.apply0(ModuleMethod.java:186)
>      at gnu.expr.ModuleMethod.apply(ModuleMethod.java:160)
>      at gnu.mapping.CallContext.runUntilDone(CallContext.java:234)
>      at test$Mnkawa.run(test-kawa.scm:34)
>      at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:317)
>      at gnu.expr.CompiledModule.evalModule(CompiledModule.java:42)
>      at gnu.expr.CompiledModule.evalModule(CompiledModule.java:61)
>      at kawa.Shell.runFile(Shell.java:538)
>      at kawa.Shell.runFileOrClass(Shell.java:447)
>      at kawa.repl.main(repl.java:881)
>

-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

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

* Re: java.lang.VerifyError exception
  2014-12-30  1:19 java.lang.VerifyError exception Seth Alves
  2015-01-03 22:23 ` Per Bothner
@ 2015-02-02 12:14 ` Per Bothner
  2015-02-08  3:18   ` Seth Alves
  1 sibling, 1 reply; 6+ messages in thread
From: Per Bothner @ 2015-02-02 12:14 UTC (permalink / raw)
  To: Seth Alves, kawa

After many false starts, I have a fix that seems to work.
Sorry for the delay - this was the sort of painful problem that
encourages procrastination ...  

On 12/30/2014 02:19 AM, Seth Alves wrote:
> Here is a boiled-down snippet of nonsense code (it started as part of the snow zlib package).
>
>      -seth
>
> $ ./test-kawa.scm
> Exception in thread "main" java.lang.VerifyError: Bad local variable type
> Exception Details:
>    Location:
>      fuh$frame.lambda1loop()Ljava/lang/Object; @13: aload_2
>    Reason:
>      Type top (current frame, locals[2]) is not assignable to reference type
>    Current Frame:
>      bci: @13
>      flags: { }
>      locals: { 'fuh$frame', 'fuh$frame0' }
>      stack: { }
>    Bytecode:
>      0000000: bb00 0459 b700 0859 2ab5 000c 4c2c 1008
>      0000010: b800 124d 2b05 bd00 1459 03b2 001a 5359
>      0000020: 04b2 001e 53b8 0024 b600 28b0
>
>      at fuh.gunzipGenport(test-kawa.scm:11)
>      at fuh.apply0(test-kawa.scm:11)
>      at gnu.expr.ModuleMethod.apply0(ModuleMethod.java:186)
>      at gnu.expr.ModuleMethod.apply(ModuleMethod.java:160)
>      at gnu.mapping.CallContext.runUntilDone(CallContext.java:234)
>      at test$Mnkawa.run(test-kawa.scm:34)
>      at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:317)
>      at gnu.expr.CompiledModule.evalModule(CompiledModule.java:42)
>      at gnu.expr.CompiledModule.evalModule(CompiledModule.java:61)
>      at kawa.Shell.runFile(Shell.java:538)
>      at kawa.Shell.runFileOrClass(Shell.java:447)
>      at kawa.repl.main(repl.java:881)
>

-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

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

* Re: java.lang.VerifyError exception
  2015-02-02 12:14 ` Per Bothner
@ 2015-02-08  3:18   ` Seth Alves
  2015-02-09 23:31     ` Per Bothner
  0 siblings, 1 reply; 6+ messages in thread
From: Seth Alves @ 2015-02-08  3:18 UTC (permalink / raw)
  To: kawa, Per Bothner

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


Here's a similar one that seems to sidestep this fix.

     -seth

On 02/02/2015 04:13 AM, Per Bothner wrote:
> After many false starts, I have a fix that seems to work.
> Sorry for the delay - this was the sort of painful problem that
> encourages procrastination ...
> On 12/30/2014 02:19 AM, Seth Alves wrote:
>> Here is a boiled-down snippet of nonsense code (it started as part of 
>> the snow zlib package).
>>
>>      -seth
>>
>> $ ./test-kawa.scm
>> Exception in thread "main" java.lang.VerifyError: Bad local variable 
>> type
>> Exception Details:
>>    Location:
>>      fuh$frame.lambda1loop()Ljava/lang/Object; @13: aload_2
>>    Reason:
>>      Type top (current frame, locals[2]) is not assignable to 
>> reference type
>>    Current Frame:
>>      bci: @13
>>      flags: { }
>>      locals: { 'fuh$frame', 'fuh$frame0' }
>>      stack: { }
>>    Bytecode:
>>      0000000: bb00 0459 b700 0859 2ab5 000c 4c2c 1008
>>      0000010: b800 124d 2b05 bd00 1459 03b2 001a 5359
>>      0000020: 04b2 001e 53b8 0024 b600 28b0
>>
>>      at fuh.gunzipGenport(test-kawa.scm:11)
>>      at fuh.apply0(test-kawa.scm:11)
>>      at gnu.expr.ModuleMethod.apply0(ModuleMethod.java:186)
>>      at gnu.expr.ModuleMethod.apply(ModuleMethod.java:160)
>>      at gnu.mapping.CallContext.runUntilDone(CallContext.java:234)
>>      at test$Mnkawa.run(test-kawa.scm:34)
>>      at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:317)
>>      at gnu.expr.CompiledModule.evalModule(CompiledModule.java:42)
>>      at gnu.expr.CompiledModule.evalModule(CompiledModule.java:61)
>>      at kawa.Shell.runFile(Shell.java:538)
>>      at kawa.Shell.runFileOrClass(Shell.java:447)
>>      at kawa.repl.main(repl.java:881)
>>
>


[-- Attachment #2: test-kawa.scm --]
[-- Type: text/x-scheme, Size: 722 bytes --]

#! /bin/sh
#| -*- scheme -*-
exec /usr/local/bin/kawa $0 "$@"
|#

(import (scheme base)
        (scheme write))

(define (bluh)
  (define (foo c) #f)
  (define (bar f) #f)
  (define (baz n) 2)

  (define (snoo)
    (bar (lambda (i) #f))
    (foo #f))

  (define (blee)
    (let loop ((ret 0))
      (foo (lambda () (loop 0)))))

  (define (pup)
    (let ((l (make-vector 288)))
      (bar (lambda (i) (vector-set! l i 5)))
      (blee)))

  (define (blerg)
    (let* ((res (snoo)))
      (blee)))

  (let* ((t (baz 2)))
    (let loop ((res
                (case t
                  ((0) 5)
                  ((1) (pup))
                  ((2) (blerg))
                  (else
                   #f))))
      #f)))

(bluh)

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

* Re: java.lang.VerifyError exception
  2015-02-08  3:18   ` Seth Alves
@ 2015-02-09 23:31     ` Per Bothner
  2015-02-10  2:19       ` Seth Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Per Bothner @ 2015-02-09 23:31 UTC (permalink / raw)
  To: kawa



On 02/07/2015 07:18 PM, Seth Alves wrote:
> Here's a similar one that seems to sidestep this fix.

This one turned out to be different - or at least the fix
was in a different area of the compiler.

The problem was accessing a function's static link.  This was
done in a way to access an intermediate static link after the
latter had gone out of scope.  The fix was to tweak how we
access the static link for inlined functions.

I checked in your testcase as testsuite/inline2.scm.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

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

* Re: java.lang.VerifyError exception
  2015-02-09 23:31     ` Per Bothner
@ 2015-02-10  2:19       ` Seth Alves
  0 siblings, 0 replies; 6+ messages in thread
From: Seth Alves @ 2015-02-10  2:19 UTC (permalink / raw)
  To: kawa


Thanks!  I'm able to run snow's zlib library, now.

     -seth

On 02/09/2015 03:30 PM, Per Bothner wrote:
>
>
> On 02/07/2015 07:18 PM, Seth Alves wrote:
>> Here's a similar one that seems to sidestep this fix.
>
> This one turned out to be different - or at least the fix
> was in a different area of the compiler.
>
> The problem was accessing a function's static link.  This was
> done in a way to access an intermediate static link after the
> latter had gone out of scope.  The fix was to tweak how we
> access the static link for inlined functions.
>
> I checked in your testcase as testsuite/inline2.scm.

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

end of thread, other threads:[~2015-02-10  2:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-30  1:19 java.lang.VerifyError exception Seth Alves
2015-01-03 22:23 ` Per Bothner
2015-02-02 12:14 ` Per Bothner
2015-02-08  3:18   ` Seth Alves
2015-02-09 23:31     ` Per Bothner
2015-02-10  2:19       ` Seth Alves

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).