[cmucl-help] array bug

Matt Kaufmann kaufmann at cs.utexas.edu
Fri Oct 16 14:00:43 UTC 2015


P.S. It looks like attachments are removed for emails sent to this
list.  So I'll paste in the small Lisp file that I mentioned in my
post sent a few minutes ago.

-------------------- file bug.lisp --------------------
; To see the bug:
; Start CMU Common Lisp on linux, fetched from
; https://common-lisp.net/project/cmucl/downloads/snapshots/2015/09/cmucl-2015-09-x86-linux.tar.bz2
#||
skipper:~/temp% uname -a
Linux skipper 3.13.0-65-generic #106-Ubuntu SMP Fri Oct 2 22:08:27 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
skipper:~/temp% /projects/acl2/lisps/cmucl/cmucl-2015-09-x86-linux/bin/lisp
CMU Common Lisp snapshot-2015-09 (20F Unicode), running on skipper
With core: /v/filer4b/v11q001/acl2/lisps/cmucl/cmucl-2015-09-x86-linux/lib/cmucl/lib/lisp-sse2.core
Dumped on: Sun, 2015-08-30 17:46:35-05:00 on lorien3
See <http://www.cmucl.org/> for support information.
Loaded subsystems:
    Unicode 1.29 with Unicode version 6.2.0
    Python 1.1, target Intel x86/sse2
    CLOS based on Gerd's PCL 2010/03/19 15:19:03
* 
||#

; Then do as follows.

; (declaim (optimize (safety 0))) ; safety 1 doesn't show the bug
; (load "bug.lsp")
; (compile-file "bug.lsp")
; (quit)
; ; Start cmucl again.  Then:
; (load "bug.sse2f")
; (update-problem-stack-depth 1 *the-live-$sat*)
; ; The return value is #(#(0)) but should be #(#(1)).

(in-package "CL-USER")

(defun update-problem-stack-depth (v $sat)
  (declare (type (integer 0 5) v))
  (progn
   (setf (aref (the (simple-array (integer 0 5) (1))
                    (svref $sat 0))
               0)
         (the (integer 0 5) v))
   $sat)) 

(defparameter *the-live-$sat*
  (coerce
   (list
    (make-array 1
                :element-type '(integer 0 5)
                :initial-element '0))
   'vector))
----------------------------------------

Regards,
Matt
> Date: Fri, 16 Oct 2015 08:38:58 -0500
> From: Matt Kaufmann <kaufmann at cs.utexas.edu>
> 
> Hi --
> 
> (Sorry, I didn't easily see how to get a CMUCL Trac account; hence
> this email.)
> 
> The attached small file exhibits a CMUCL bug involving arrays.  It
> occurs with the latest snapshot (2015-09) and also with at least one
> previous snapshot (2014-12).  The file has comments indicating how
> compiling with safety 0 can yield an incorrect result.
> 
> Regards,
> Matt Kaufmann
> _______________________________________________
> cmucl-help mailing list
> cmucl-help at cmucl.cons.org
> http://lists.zs64.net/mailman/listinfo/cmucl-help
> 


More information about the cmucl-help mailing list