单声道2.8.2 System.buffer.blockcopy错误

时间:2011-03-14 16:36:36

标签: apache mono apache2 mod-mono

在高负载环境中测试运行apache2和mono 2.8.2的ubuntu服务器时,大约每十分钟一次,它会输出以下错误(最后两行错误行重复约一百次)。

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

这会在我的代码中某处出现问题,还是mod_mono本身存在问题?它似乎是在服务器上放置更高的负载之后出现的,并且我的任何源代码文件都没有参考行号。

另外需要注意的是,升级到单声道2.10.1之后,在小测试中我反而每次请求都会出现此错误(但我无法测试任何大规模负载):

[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

2 个答案:

答案 0 :(得分:0)

这看起来像System.Net.WebConnectionStream.ReadAll中的一个错误。不知怎的,我怀疑readBufferOffset已变为否定,虽然不明显如何......(当然,自2.8.2以来这可能已经修复了......)Buffer.BlockCopy的参数验证代码很漂亮直截了当...

答案 1 :(得分:0)

我可能已经在git pull修正了这个问题,该问题已于2012年3月1日致力于Mono。不幸的是,这意味着它不是单声道2.10.8.1(由于单声道3仍处于测试阶段,许多发行版目前处于单声道)。