[Mono-bugs] [Bug 61608][Nor] New - RecvFrom_internal throws exception on connected socket

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 15 Jul 2004 11:49:08 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by dev@6wardlaw.freeserve.co.uk.

http://bugzilla.ximian.com/show_bug.cgi?id=61608

--- shadow/61608	2004-07-15 11:49:08.000000000 -0400
+++ shadow/61608.tmp.11648	2004-07-15 11:49:08.000000000 -0400
@@ -0,0 +1,66 @@
+Bug#: 61608
+Product: Mono: Runtime
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: Fedora Core 1.0
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dev@6wardlaw.freeserve.co.uk               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: RecvFrom_internal throws exception on connected socket
+
+Description of Problem:
+
+When 'RecvFrom_internal' is called on a connected connection-oriented 
+socket, a 'System.SystemException' is thrown by the run-time.
+
+The exception is actually thrown in the 'create_object_from_sockaddr' 
+function where a check is made on the socket address length.
+
+Because the stack returns a socket address length of 0 ( correctly as 
+this is a connecte socket ) this check fails and the exception is thrown.
+
+Steps to reproduce the problem:
+1. Create a stream socket and connect it to a remote endpoint.
+2. Call ReceiveFrom on the local socket
+3. Send some data from the remote endpoint over the connection.
+
+Actual Results:
+
+Exception: System.SystemException
+Message: A system exception has occurred.
+in (unmanaged) (wrapper managed-to-native) 
+System.Net.Sockets.Socket:RecvFrom_internal (intptr,byte
+[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&)
+in <0x00004> (wrapper managed-to-native) 
+System.Net.Sockets.Socket:RecvFrom_internal (intptr,byte
+[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&)
+in <0x00050> System.Net.Sockets.Socket:ReceiveFrom_nochecks (byte
+[],int,int,System.Net.Sockets.SocketFlags,System.Net.EndPoint&)
+in <0x00102> System.Net.Sockets.Socket:ReceiveFrom (byte
+[],int,int,System.Net.Sockets.SocketFlags,System.Net.EndPoint&)
+in <0x00123> Codestuff.Core.Network.NetworkConnection:OnDataAvailable 
+(System.Net.Sockets.Socket,Codestuff.Core.Network.SocketEvent,object)
+
+Expected Results:
+
+No exception
+
+
+How often does this happen? 
+
+Always
+
+
+Additional Information:
+
+Suggest a fix to the runtime code which is attached. Note that this 
+should also be applied in conjunction with a fix to the Socket managed 
+class to prevent a NullReferenceException being thrown ( see attached )