java.lang.VerifyError with PROGN
somewhat-functional-programmer
somewhat-functional-programmer at protonmail.com
Sun Dec 15 18:12:33 UTC 2019
Thank you for sending in this form -- I apologize - I am certain that this was introduced by my patch earlier this year to fix a couple of stack inconsistency bugs[0] -- a result of my modification to the p2-ash function.
An minimal form that reproduces this bug:
(let ((fn
(compile
nil
'(lambda ()
(ash 1343225879 (- 1))))))
(funcall fn))
In this particular case, (ash 1343225879 (- 1)) should compile to a constant, but doesn't, and the particular Java verification error stems from trying to load and store the -1 constant using aload/astore* instead of iload*. I have a local fix for this, and am also generating test cases with different types specified to exercise all possible code paths in p2-ash (such as):
(the fixnum (ash (the fixnum x) 2))
Sorry for the trouble! And again, thanks for sending this in, especially something so small and reproducible.
I hope to be able to contribute more to ABCL this year if it makes sense, but at the very least can help fix this problem I introduced, I should be able to send out a patch tonight or at least very soon,
-Mark
[0] https://mailman.common-lisp.net/pipermail/armedbear-devel/2019-May/003977.html
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, December 14, 2019 9:43 AM, Eric Marsden <eric.marsden at free.fr> wrote:
> Hi,
>
> Compiling the loading the code below (a simplified extract of SBCL's
> codebase, found attempting to crossbuild SBCL with ABCL) results in a
> VerifyError, possibly related to the implementation of PROGN. Using
> 1.6.1-dev-svn-15217.
>
> java.lang.VerifyError: (class: org/armedbear/lisp/foo_1, method: execute signature: (Lorg/armedbear/lisp/LispObject;)Lorg/armedbear/lisp/LispObject;) Expecting to find object/array on stack
> at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
> at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
> at java.base/java.lang.Class.getConstructor0(Class.java:3342)
> at java.base/java.lang.Class.newInstance(Class.java:556)
> at org.armedbear.lisp.FaslClassLoader.loadFunction(FaslClassLoader.java:130)
> at org.armedbear.lisp.FaslClassLoader$pf_get_fasl_function.execute(FaslClassLoader.java:165)
> at org.armedbear.lisp.LispThread.execute(LispThread.java:832)
> at org.armedbear.lisp.Lisp.evalCall(Lisp.java:582)
> at org.armedbear.lisp.Lisp.eval(Lisp.java:540)
> at org.armedbear.lisp.Lisp.evalCall(Lisp.java:577)
> at org.armedbear.lisp.Lisp.eval(Lisp.java:540)
> at org.armedbear.lisp.Lisp.progn(Lisp.java:709)
> at org.armedbear.lisp.SpecialOperators$sf_progn.execute(SpecialOperators.java:273)
> at org.armedbear.lisp.Lisp.eval(Lisp.java:530)
> at org.armedbear.lisp.Load.faslLoadStream(Load.java:667)
> at org.armedbear.lisp.Load$init_fasl.execute(Load.java:457)
>
>
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> (in-package :cl-user)
>
> (progn
> (defvarsxhash-crosscheck nil)
> (defun sxhash (x)
> (let ((answer (if (string= x "NIL") (ash 1343225879 (- 1)))))
> (push (cons x answer)sxhash-crosscheck)
> answer)))
>
> -- Eric Marsden https://risk-engineering.org/
More information about the armedbear-devel
mailing list