[Mono-bugs] [Bug 354090] Socket.Select throws exception for read-only ILists

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jan 17 09:59:40 EST 2008


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

User dick at novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=354090#c2


Dick Porter <dick at novell.com> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
           Severity|Normal                                          |Minor




--- Comment #2 from Dick Porter <dick at novell.com>  2008-01-17 07:59:40 MST ---
The given test case still breaks for me on mono.

However, it only works on the MS runtime by luck - if the entire array passed
to Select is either a) all writable; or b) all not writable it works.  If part
of the array passed is writable and part not it gets the same problem as us:

Unhandled Exception: System.NotSupportedException: Collection was of a fixed
size.
   at System.Array.System.Collections.IList.RemoveAt(Int32 index)
   at System.Net.Sockets.Socket.SelectFileDescriptor(IList socketList, IntPtr[]
fileDescriptorSet)
   at System.Net.Sockets.Socket.Select(IList checkRead, IList checkWrite, IList
checkError, Int32 microSeconds)
   at SelectTest.Main()

(Adjusted test case to be attached)

It seems that the MS runtime tries to notch out unselected sockets one-by-one
from the passed-in ILists, rather than the mono technique of clearing the list
and adding the selected sockets back in.  I note that IList.Clear() works on
IsFixedSize lists, setting the entries to null.

As this corner case works on the MS runtime this is still a bug in mono, but
I'm going to reduce the severity to Minor.


-- 
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