[Mono-bugs] [Bug 377589] New: Socket.EndReceive unexpectedly fails with WSAEWOULDBLOCK

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Apr 7 08:14:13 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=377589


           Summary: Socket.EndReceive unexpectedly fails with WSAEWOULDBLOCK
           Product: Mono: Runtime
           Version: 1.9.0
          Platform: x86
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: io-layer
        AssignedTo: dick at novell.com
        ReportedBy: benoit at zeroc.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=206455)
 --> (https://bugzilla.novell.com/attachment.cgi?id=206455)
contains TcpClient.cs TcpServer.cs

Description of Problem:

Calling Socket.EndReceive from the callback passed to Socket.BeginReceive
unexpectedly fails with a socket exception
("System.Net.Sockets.SocketException: Operation on non-blocking socket would
block") on Mac OS X and under some special circumstances. 

This issue shows up with some of our tests for our product Ice (available with
sources from http://www.zeroc.com/download_beta.html, it only shows up with Ice
3.3b where we now use async IO). This failure never shows up on Linux so it
looks like a Mac OS X specific issue.

I would except the socket EndReceive operation to not fail with this exception
when it's called from the callback passed to BeginReceive. I've narrow down the
failure to a small test case that you can use to reproduce the failure on Mac
OS X.

Steps to reproduce the problem:
1. Compile TcpClient.cs and TcpServer.cs
2. run TcpServer.exe
3. run TcpClient.exe


Actual Results:

macbookpro:~/Devel/git/ice/cs$ mono --debug TcpClient.exe 
Establishing first connection...
Press Enter to exit
Established first connection.
Establishing second connection...
Established second connection.
Unexpected exception:
System.Net.Sockets.SocketException: Operation on non-blocking socket would
block
  at System.Net.Sockets.Socket+SocketAsyncResult.CheckIfThrowDelayedException
() [0x00029] in
/private/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System/System.Net.Sockets/Socket.cs:129 
  at System.Net.Sockets.Socket.EndReceive (IAsyncResult asyncResult,
System.Net.Sockets.SocketError& errorCode) [0x00074] in
/private/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System/System.Net.Sockets/Socket.cs:2232 
  at System.Net.Sockets.Socket.EndReceive (IAsyncResult result) [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System/System.Net.Sockets/Socket.cs:2208 
  at TcpClient.AppMain.OnReceive (IAsyncResult ar) [0x00000] 


Expected Results:

macbookpro:~/Devel/git/ice/cs$ mono TcpClient.exe 
Establishing first connection...
Press Enter to exit
Established first connection.
Establishing second connection...
Established second connection.
Received 1 bytes

How often does this happen? 

All the time with the given test case

Additional Information:

macbookpro:~/Devel/git/ice/cs$ mono -V
Mono JIT compiler version 1.9 (tarball)
Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
        TLS:           normal
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       normal
        Notification:  Thread + polling
        Architecture:  x86
        Disabled:      none

This also failed with previous 1.2.6 version


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list