[Openmcl-devel] bug(?) loading iolib under certain optimization settings

Jared C. Davis jared at cs.utexas.edu
Fri Jan 17 09:21:27 PST 2014


Hi,

I seem to have hit a bug with either CCL or IOLIB.  I'm not sure which.

I hit this while trying to get (ql:quickload "iolib") to work within an ACL2
image (on CCL).  Oddly, the command worked fine when run from ordinary CCL,
just not from within ACL2.  I eventually figured out that the problem seems
to stem from the optimization settings that ACL2 sets up.  Here's a simple
script to provoke it (run this in a new directory):

    #!/bin/sh

    rm -rf inst quicklisp.lisp
    curl -O http://beta.quicklisp.org/quicklisp.lisp

    ccl <<EOF
    (load "quicklisp.lisp")
    (quicklisp-quickstart:install :path "./inst")
    EOF

    ccl <<EOF
    (proclaim '(optimize (speed 3) (safety 0)))
    (load "inst/setup.lisp")
    (ql:quickload "iolib")
    EOF

    exit 0

When I run this, I end up seeing the following error:

    [...]
    ;Compiling "[...]/inst/dists/quicklisp/software/iolib-0.7.3/src/sockets/common.lisp"...
    > Error: bad regspec: NIL
    > While executing: CCL::%HARD-REGSPEC-VALUE, in process listener(1).

By commenting things out, it seems that the error is caused while compiling(?)
the following function in common.lisp:

    (defun map-ipv4-vector-to-ipv6 (addr)
      (declare (type ipv4-array addr))
      (let ((ipv6addr (make-array 8
 :element-type 'ub16
 :initial-element 0)))
;; setting the IPv4 marker
(setf (aref ipv6addr 5) #xFFFF)
;; setting the first two bytes
(setf (aref ipv6addr 6) (+ (ash (aref addr 0) 8)
  (aref addr 1)))
;; setting the last two bytes
(setf (aref ipv6addr 7) (+ (ash (aref addr 2) 8)
  (aref addr 3)))
(values ipv6addr)))

If I simply comment out the :element-type 'ub16, the problem goes away and I
appear to be able to load the file successfully.

Anyway, at this point I think I'd better hand this over to people who know
about CCL and/or Quicklisp and/or IOLIB.  I'm running CCL from a recent SVN
trunk on x86-64 linux.  If you have any trouble recreating this, please let me
know and I can provide more information about my setup.

Cheers,
Jared


-- 
Jared C. Davis <jared at cs.utexas.edu>
11410 Windermere Meadows
Austin, TX 78759
http://www.cs.utexas.edu/users/jared/



More information about the Openmcl-devel mailing list