[Openmcl-devel] make-random-state error caused by ccl::ip-interfaces error on Windows

Anton Vodonosov avodonosov at gmail.com
Sun Mar 1 13:16:03 PST 2009


Hello,

I am using the following version: 1.3-RC1-r11719M  (WindowsX8632)

I have the following error:

  ? (MAKE-RANDOM-STATE T)
  > Error: Can't determine primary IP interface
  > While executing: CCL::PRIMARY-IP-INTERFACE-ADDRESS, in process listener(1).
  > Type :POP to abort, :R for a list of available restarts.
  > Type :? for other options.

It is caused by the fact that due to an error in function
ccl::%get-ip-interfaces it can't handle more than 4 interfaces.
I have 5 interfaces (mostly virtual) and the function returns NIL:

  ? > (ccl::%get-ip-interfaces)
  NIL

The error details.

See the file level-1/l1-sockets.lisp, line 1419 (comments are mine)

#+windows-target
(defun %get-ip-interfaces ()
  (let* ((handle (#_socket #$AF_INET #$SOCK_DGRAM #$IPPROTO_IP)))
    (unwind-protect
    (rlet ((realoutlen #>DWORD 0))

                         ;; ***********
                         ;; Here a space is reserved for 4
                         ;; INTERFACE_INFO's

      (do* ((reservedlen (* 4 (record-length #>INTERFACE_INFO))
                         (* 2 reservedlen)))
           ()
        (%stack-block ((buf reservedlen))

                         ;; ************
                         ;; Here WSAIoctl returns SOCKET_ERROR (-1),
                         ;; WSAGetLastError() == WSAEFAULT (10014)
                         ;; which means "the buffer is insufficient
                         ;; to receive the results".

          (unless (eql 0 (#_WSAIoctl
                          handle
                          #$SIO_GET_INTERFACE_LIST
                          (%null-ptr)
                          0
                          buf
                          reservedlen
                          realoutlen
                          (%null-ptr)
                          (%null-ptr)))
            ;; *********
            ;; result is NIL
            (return))
            ...

I've changed
   (do* ((reservedlen (* 4 (record-length #>INTERFACE_INFO))
to
   (do* ((reservedlen (* 8 (record-length #>INTERFACE_INFO))
and function become working.

Sorry for not providing a real patch, I am already digging too deep for me.
(I only wanted to try the release candidate, tried to run hunchentoot).

BTW, I am very glad that CCL will support Windows. Thank you and
congratulations.

Best regards,
- Anton



More information about the Openmcl-devel mailing list