[Openmcl-devel] bug with usocket and/or trunk ccl - "error #22"

Chun Tian (binghe) binghe.lisp at gmail.com
Wed May 20 11:25:04 PDT 2015


Hi,

I was working on this issue since 10 hours ago when I firstly saw the mail. I’ve already committed an initial fix [1] to usocket Git master, in which I handled two compatibility issues between usocket and ccl-1.11, and now there’s no error reported when creating and sending sockets. But it seems that CCL::SEND-TO cannot actually send out the data to a “connected” UDP socket, as a result the test code is blocked at (usocket:socket-receive …).

Usocket’s backend code for CCL is basically just a wrapper (even more true for ccl-1.11), my next step is to remove all usocket wrappers and only use CCL’s native API to reproduce the same issue. I’ll submit trac tickets to CCL if I found something.

Regards,

Chun

[1] https://github.com/usocket/usocket/commit/172ef76def455b776edbe2c5f8d0e9dadcc8d650

Il giorno 20/mag/2015, alle ore 19:49, R. Matthew Emerson <rme at clozure.com> ha scritto:

> I can try to look at it.  What version of usocket are you using?  Is there a place I can get it easily so I can try to run your test case and duplicate the problem?
> 
> 
>> On May 19, 2015, at 6:10 PM, Mark H. David <mhd at yv.org> wrote:
>> 
>> This works on an earlier CCL:
>> Welcome to Clozure Common Lisp Version 1.10-r16196  (LinuxX8664)!
>> 
>> (let* ((host "localhost")
>>      (port 1111)
>>      (server-sock
>>        (usocket:socket-connect nil nil :protocol ':datagram :local-host host :local-port port))
>>      (client-sock
>>        (usocket:socket-connect host port :protocol ':datagram))
>>      (octet-vector
>>        (make-array 2 :element-type '(unsigned-byte 8) :initial-contents `(,(char-code #\O) ,(char-code #\K))))
>>      (recv-octet-vector
>>        (make-array 2 :element-type '(unsigned-byte 8))))
>> (usocket:socket-send client-sock octet-vector 2)
>> (usocket:socket-receive server-sock recv-octet-vector 2)
>> (prog1 (and (equalp octet-vector recv-octet-vector)
>>             recv-octet-vector)
>>   (usocket:socket-close server-sock)
>>   (usocket:socket-close client-sock)))
>> 
>> =>
>> 
>> #(79 75)
>> 
>> 
>> 
>> On trunk CCL, updated/built on 5/19/15:
>> Welcome to Clozure Common Lisp Version 1.11-dev-r16393M-trunk  (DarwinX8664)!
>> 
>> It gets an error:
>> 
>>> Debug: The condition Invalid argument (error #22) during attempt to connect to [unparsed, AF 2] occurred.
>>> While executing: (:INTERNAL SWANK::INVOKE-DEFAULT-DEBUGGER), in process repl-thread(12).
>>> Type :POP to abort, :R for a list of available restarts.
>>> Type :? for other options.
>> 1 > :b
>> 
>> (24034210) : 0 (FUNCALL #'#<(:INTERNAL SWANK::INVOKE-DEFAULT-DEBUGGER)>) 53
>> (24034230) : 1 (FUNCALL #'#<SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK> NIL #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::INVOKE-DEFAULT-DEBUGGER) #x302002623FFF>) 181
>> (240342B8) : 2 (CALL-WITH-DEBUGGER-HOOK NIL #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::INVOKE-DEFAULT-DEBUGGER) #x302002623FFF>) 181
>> (240342E8) : 3 (INVOKE-DEFAULT-DEBUGGER #<USOCKET:UNKNOWN-ERROR #x30200250C31D>) 189
>> (24034308) : 4 (SWANK-DEBUGGER-HOOK #<USOCKET:UNKNOWN-ERROR #x30200250C31D> #<Compiled-function SWANK:SWANK-DEBUGGER-HOOK #x3020008ADAEF>) 565
>> (24034338) : 5 (BREAK-LOOP-HANDLE-ERROR #<USOCKET:UNKNOWN-ERROR #x30200250C31D> 75524225) 637
>> (240343E0) : 6 (%ERROR #<USOCKET:UNKNOWN-ERROR #x30200250C31D> (:SOCKET NIL :REAL-ERROR #<SOCKET-CREATION-ERROR #x30200250D79D>) 75524225) 333
>> (24034408) : 7 (RAISE-ERROR-FROM-ID :UNKNOWN NIL #<SOCKET-CREATION-ERROR #x30200250D79D>) 213
>> (24034438) : 8 (HANDLE-CONDITION #<SOCKET-CREATION-ERROR #x30200250D79D> NIL) 709
>> (24034470) : 9 (FUNCALL #'#<(:INTERNAL USOCKET:SOCKET-CONNECT)> #<SOCKET-CREATION-ERROR #x30200250D79D>) 61
>> (24034490) : 10 (SIGNAL #<SOCKET-CREATION-ERROR #x30200250D79D>) 981
>> (240344E8) : 11 (%ERROR #<SOCKET-CREATION-ERROR #x30200250D79D> NIL 75524258) 117
>> (24034510) : 12 (SOCKET-ERROR NIL "connect" 22 NIL :CONNECT-ADDRESS #<SOCKET-ADDRESS [unparsed, AF 2]>) 1053
>> (24034580) : 13 (INET-CONNECT 20 16777343 22276 NIL) 637
>> (240345C8) : 14 (SOCKET-CONNECT "localhost" 1111 :PROTOCOL :DATAGRAM :ELEMENT-TYPE NIL :TIMEOUT NIL :DEADLINE NIL :NODELAY NIL :LOCAL-HOST NIL :LOCAL-PORT NIL) 1149
>> (24034690) : 15 (FUNCALL #'#<Anonymous Function #x30200250E67F>) 149
>> (240346A8) : 16 (CHEAP-EVAL (LET* (# # # # # ...) (USOCKET:SOCKET-SEND CLIENT-SOCK OCTET-VECTOR 2) (USOCKET:SOCKET-RECEIVE SERVER-SOCK RECV-OCTET-VECTOR 2) (PROG1 # # #))) 101
>> 
>> 
>> 
>> What's up with that?
>> 
>> Thanks,
>> 
>> Mark
>> 
>> 
> 
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20150520/8581dd97/attachment.bin>


More information about the Openmcl-devel mailing list