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

Gary Byers gb at clozure.com
Sun Mar 1 19:40:33 PST 2009


Thanks.  I have a feeling that the only way to tell how many IP
interfaces you have is to say "I've reserved space for information
about N" and have Windows either tell you "No, you need M, try again"
or "That's not enough, try again".  Whatever the response is - I don't
remember - we should try again rather than just returning NIL.

On Sun, 1 Mar 2009, Anton Vodonosov wrote:

> 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
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list