[armedbear-devel] BUG: Stack inconsistency (java.lang.VerifyError)

eric.marsden at free.fr eric.marsden at free.fr
Mon Sep 5 17:15:21 UTC 2011


Hi,

Attempting to use ABCL to build a current development checkout of SBCL on Linux/i686, I encountered the following error. 
ABCL builds SBCL on Linux/AMD64 correctly, with the same openjdk version. 


------------------ file foo.lisp ------------------------------------------

(in-package :cl-user)

(defun symbolicate (&rest things)
    (let* ((length (reduce #'+ things
                           :key (lambda (x) (length (string x)))))
           (name (make-array length :element-type 'character)))
      (let ((index 0))
        (dolist (thing things (values (intern name)))
          (let* ((x (string thing))
                 (len (length x)))
            (replace name x :start1 index)
            (incf index len))))))

(macrolet ((def (name &optional variant)
             `(defun ,(if variant (symbolicate name "/" variant) name)
                  (function mutex)
                (declare (function function))
                (flet ((%call-with-system-mutex ()
                         (dx-let (got-it)
                           (unwind-protect
                                (when (setf got-it (get-mutex mutex))
                                  (funcall function))
                             (when got-it
                               (release-mutex mutex))))))
                  (declare (inline %call-with-system-mutex))
                  ,(ecase variant
                     (:without-gcing
                       `(without-gcing (%call-with-system-mutex)))
                     (:allow-with-interrupts
                       `(without-interrupts
                          (allow-with-interrupts (%call-with-system-mutex))))
                     ((nil)
                      `(without-interrupts (%call-with-system-mutex))))))))
  (def call-with-system-mutex)
  (def call-with-system-mutex :without-gcing)
  (def call-with-system-mutex :allow-with-interrupts))

----------------------

Armed Bear Common Lisp 0.13.0-dev
Java 1.6.0_23 Sun Microsystems Inc.
OpenJDK Server VM
Low-level initialization completed in 0.344 seconds.
Startup completed in 1.453 seconds.
Type ":help" for a list of available commands.
CL-USER(1): (compile-file "/tmp/foo")
; Compiling /tmp/foo.lisp ...
; (IN-PACKAGE :CL-USER)
; (DEF CALL-WITH-SYSTEM-MUTEX)
; in (MACROLET (#) ...)

; Caught STYLE-WARNING:
;   Undefined variable: GOT-IT

Stack inconsistency at index 63: found 3, expected 1.
java.lang.VerifyError: (class: org/armedbear/lisp/foo_1, method: execute signature: (Lorg/armedbear/lisp/LispObject;Lorg/armedbear/lisp/LispObject;)Lorg/armedbear/lisp/LispObject;) Inconsistent stack height 1 != 3
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2406)
	at java.lang.Class.getConstructor0(Class.java:2716)
	at java.lang.Class.getConstructor(Class.java:1674)
	at org.armedbear.lisp.Lisp.loadCompiledFunction(Lisp.java:1147)
	at org.armedbear.lisp.Lisp.loadCompiledFunction(Lisp.java:1074)
	at org.armedbear.lisp.CompiledFunction$1.execute(CompiledFunction.java:186)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:720)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:638)
	at org.armedbear.lisp.compile_file_4.execute(compile-file.lisp:63)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:720)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:638)
	at org.armedbear.lisp.compile_file_8.execute(compile-file.lisp:103)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:680)


Eric




More information about the armedbear-devel mailing list