Opened 5 years ago

Closed 5 years ago

#1259 closed defect (fixed)

udp socket regression

Reported by: rme Owned by: rme
Priority: normal Milestone:
Component: other Version: trunk
Keywords: Cc: joshua.kordani@…

Description

Works in 1.9, fails in trunk.

(defparameter *message* (make-array 20 :element-type '(unsigned-byte 8)
				       :initial-contents '(47 103 95 102 114 101 101 65 108 108 0 0 44 105 0 0 0 0 0 0)))

(defparameter *udp-server* (make-socket :type :datagram
					:local-port 42301))

(defparameter *udp-client* (make-socket :type :datagram
					:remote-port 42301))

(send-to *udp-client* *message* (length *message*))

See https://lists.clozure.com/pipermail/openmcl-devel/2015-January/010865.html

Change History (5)

comment:1 Changed 5 years ago by jkordani

Welcome to Clozure Common Lisp Version 1.11-dev-r16341M-trunk (DarwinX8664)!

ccl socket commands work.

usocket commands fail with

The value 2130706433 is not of the expected type SEQUENCE.
   [Condition of type TYPE-ERROR]

Restarts:
 0: [LOAD-SOURCE] Load "/var/tmp/tmp.9.46bL09" instead of "/var/tmp/tmp.9.dx64fsl"
 1: [RECOMPILE] Compile "/var/tmp/tmp.9.46bL09" into "/var/tmp/tmp.9.dx64fsl" then load "/var/tmp/tmp.9.dx64fsl" again
 2: [RETRY-LOAD] Retry loading "/var/tmp/tmp.9.dx64fsl"
 3: [SKIP-LOAD] Skip loading "/var/tmp/tmp.9.dx64fsl"
 4: [LOAD-OTHER] Load other file instead of "/var/tmp/tmp.9.dx64fsl"
 5: [ABORT] Abort compilation.
 --more--

Backtrace:
  0: (CCL::SEQUENCE-TYPE 2130706433)
  1: (LENGTH 2130706433)
  2: (RESOLVE-ADDRESS :HOST 2130706433 :PORT 43874 :SOCKET-TYPE :DATAGRAM :CONNECT :ACTIVE :ADDRESS-FAMILY :INTERNET :NUMERIC-HOST-P NIL :NUMERIC-SERVICE-P NIL :SINGLEP T :ERRORP T)
  3: (#<CCL::STANDARD-KERNEL-METHOD SEND-TO (CCL::UDP-SOCKET T T)> #<CCL::UDP-SOCKET #x302000D5083D> #(47 103 95 102 114 101 ...) 20 :REMOTE-HOST 2130706433 :REMOTE-PORT 43874 :REMOTE-ADDRESS NIL :OFFSET 0..
  4: (CCL::%%CHECK-KEYWORDS #(3 #(:OFFSET :REMOTE-ADDRESS :REMOTE-PORT :REMOTE-HOST) #<METHOD-FUNCTION SEND-TO (CCL::UDP-SOCKET T T)>) 76473424)
  5: (NIL #<Unknown Arguments>)
  6: (#<STANDARD-METHOD USOCKET:SOCKET-SEND (USOCKET:DATAGRAM-USOCKET T T)> #<USOCKET:DATAGRAM-USOCKET #x302000D507ED> #(47 103 95 102 114 101 ...) 20 :HOST "127.0.0.1" :PORT 43874 :OFFSET 0)
  7: (CCL::%%CHECK-KEYWORDS #(3 #(:OFFSET :PORT :HOST) #<METHOD-FUNCTION USOCKET:SOCKET-SEND (USOCKET:DATAGRAM-USOCKET T T)>) 76473465)
  8: (NIL #<Unknown Arguments>)
Last edited 5 years ago by rme (previous) (diff)

comment:2 Changed 5 years ago by jkordani

  • Cc joshua.kordani@… added

comment:3 Changed 5 years ago by rme

(In [16342]) In ccl:send-to, use the socket-address-family accessor to determine the address-family to pass to resolve-address. Otherwise, it's possible for resolve-address to return the wrong kind of socket-address object, e.g., an :internet6 address instead of :internet.

See ticket:1259.

comment:4 Changed 5 years ago by rme

The usocket problem happens because usocket passes ccl:send-to value of type (unsigned-byte 32) for the :remote-host keyword argument. This is documented to be legal, but our updates to the socket code to support ipv6 failed to support this, so this is our bug, I believe.

comment:5 Changed 5 years ago by rme

  • Resolution set to fixed
  • Status changed from new to closed

(In [16345]) Attempt to restore support for using an (unsigned-byte 32) as an IPv4 address.

I'm not convinced this is a great way to do it; but it will probably stay in forever anyway.

Closes ticket:1259.

Note: See TracTickets for help on using tickets.