[Mono-bugs] [Bug 645675] New: Socket.Complete throws InvalidOperationException on Queue.Dequeue

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 12 05:19:53 EDT 2010



           Summary: Socket.Complete throws InvalidOperationException on
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: x86-64
        OS/Version: SLES 11
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: piotr.wysocki at secpl.cs.put.poznan.pl
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.4
(KHTML, like Gecko) Chrome/5.0.375.70 Safari/533.4

Sometimes in my app I get:

System.InvalidOperationException: Operation is not valid due to the current
state of the object
  at System.Collections.Queue.Dequeue () [0x00000] in <filename unknown>:0
  at System.Net.Sockets.Socket+SocketAsyncResult.Complete () [0x00000] in
filename unknown>:0 
  at System.Net.Sockets.Socket+SocketAsyncResult.CompleteDisposed
(System.Object unused) [0x00000] in <filename unknown>:0

I think the solution should be to replace 
234  if (queue != null) {
234  if (queue != null && queue.Count > 0) {

However I am not sure if this is thread-safe enough, maybe the check for Count
should be inside lock (queue) a couple of lines below.

Reproducible: Sometimes

Steps to Reproduce:
I am not sure how to reproduce the problem, it just happens in my app during
some client-server communication.
I may try to reproduce the problem if necessary, just ask.

I believe this bug might have been happening to my app before mono 2.8 in the
threadpool, but the exception was being ignored by the runtime.

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

More information about the mono-bugs mailing list