When testing a ubuntu server running apache2 and mono 2.8.2 in a high load environment, about every ten minutes, it would output the following error (with the last two error lines repeated about a hundred times afterwards).
Handling exception type ArgumentOutOfRangeException
Message is Non-negative number required.
Parameter name: srcOffset
IsTerminating is set to True
System.ArgumentOutOfRangeException: Non-negative number required.
Parameter name: srcOffset
at System.Buffer.BlockCopy (System.Array src, Int32 srcOffset, System.Array dst, Int32 dstOffset, Int32 count) [0x000b7] in /home/elliott/mono-2.8.2/mcs/class/corlib/System/Buffer.cs:103
at System.Net.WebConnectionStream.ReadAll () [0x00183] in /home/elliott/mono-2.8.2/mcs/class/System/System.Net/WebConnectionStream.cs:259
at System.Net.WebConnectionStream.CheckResponseInBuffer () [0x0002f] in /home/elliott/mono-2.8.2/mcs/class/System/System.Net/WebConnectionStream.cs:120
at (wrapper remoting-invoke-with-check) System.Net.WebConnectionStream:CheckResponseInBuffer ()
at System.Net.WebConnection.ReadDone (IAsyncResult result) [0x001a3] in /home/elliott/mono-2.8.2/mcs/class/System/System.Net/WebConnection.cs:476
at System.Net.Sockets.Socket+SocketAsyncResult.CB (System.Object unused) [0x00000] in /home/elliott/mono-2.8.2/mcs/class/System/System.Net.Sockets/Socket.cs:214
[Tue Mar 08 13:49:58 2011] [error] (70014)End of file found: read_data failed
[Tue Mar 08 13:49:58 2011] [error] Command stream corrupted, last command was 1
[Tue Mar 08 13:49:58 2011] [error] (70014)End of file found: read_data failed
[Tue Mar 08 13:49:58 2011] [error] Command stream corrupted, last command was 1
Would this be an issue with something in my code somewhere, or is it a problem in mod_mono itself? It seemed to appear after putting a higher load on the server, and there were no reference line numbers to any of my source code files.
Also to note, after upgrading to mono 2.10.1, in small tests I instead get this error with every request (but I haven't been able to test any large scale load):
[Mon Mar 14 12:59:30 2011] [error] (70014)End of file found: read_data failed
[Mon Mar 14 12:59:30 2011] [error] Command stream corrupted, last command was -1
That looks like a bug in System.Net.WebConnectionStream.ReadAll
to me. Somehow I suspect that readBufferOffset
has become negative, although it's not obvious how... (of course, this may have been fixed since 2.8.2...) The argument validation code for Buffer.BlockCopy
is pretty straightforward...