Bug 5904 - System.ObjectDisposedException in System.Net.WebConnection.BeginRead
Summary: System.ObjectDisposedException in System.Net.WebConnection.BeginRead
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: High normal
Target Milestone: Untriaged
Assignee: Martin Baulig
: 12355 ()
Depends on:
Reported: 2012-06-28 05:36 UTC by René Ruppert
Modified: 2013-06-26 06:33 UTC (History)
11 users (show)

Is this bug a regression?: ---
Last known good build:

Fiddler trace (113.49 KB, text/plain)
2012-11-27 05:42 UTC, René Ruppert
System.dll test candidate (1.08 MB, application/octet-stream)
2013-05-25 16:47 UTC, Sebastien Pouliot

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Comment 47 Stuart Lodge 2013-06-21 12:16:15 UTC
We're seeing a very similar looking bug at present.

We're on stable and our stack trace looks like:

"at System.Net.WebConnection.BeginRead (System.Net.HttpWebRequest request, System.Byte[] buffer, Int32 offset, Int32 size, System.AsyncCallback cb, System.Object state) [0x0001d] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/WebConnection.cs:885 \n  at System.Net.WebConnectionStream.BeginRead (System.Byte[] buffer, Int32 offset, Int32 size, System.AsyncCallback cb, System.Object state) [0x001ab] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/WebConnectionStream.cs:392 \n  at System.Net.WebConnectionStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00007] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/WebConnectionStream.cs:332 \n  at System.IO.StreamReader.ReadBuffer () [0x00012] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.IO/StreamReader.cs:376 \n  at System.IO.StreamReader.Read (System.Char[] buffer, Int32 index, Int32 count) [0x00077] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.IO/StreamReader.cs:453 \n  at System.IO.StreamReader.ReadToEnd () [0x00040] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.IO/StreamReader.cs:557 \n  at:"

Our problem is intermittent. 

Is it likely we're hitting a similar bug? Is there any more info about this issue?
Comment 48 Stuart Lodge 2013-06-21 13:36:08 UTC
We've looked more at our problem here.

It seems to be related to chunked data coming back from our webserver.

If we return 20 records (approx 3500 bytes) then this is just one Http chunk and we receive the response fine.

If we return 30 records (approx 5000 bytes) then this is split into two chunks and we then see an ObjectDisposedException while trying to read all the stream within our client.

We've tried also on a wpf client and that same code works fine for 100s of records with or without the chunking.


For now we have a workaround for our problem - we just need to request much smaller chunks of data - but it would be nice to know if this the same Xam.iOS issue as this bug report - or whether this is a new bug. Also, if you've got any other suggestions please let us know.


Comment 49 Miguel de Icaza [MSFT] 2013-06-21 13:57:51 UTC
This bug should be fixed already.

Martin, which revision will contain this fix?
Comment 50 Martin Baulig 2013-06-26 06:33:55 UTC
*** Bug 12355 has been marked as a duplicate of this bug. ***