0

在高负载环境中测试运行 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
4

2 回答 2

0

我可能前段时间在2012 年 3 月 1日提交给 Mono的git pull中修复了这个问题。不幸的是,这意味着它不在单声道 2.10.8.1 中(由于单声道 3 仍处于测试阶段,因此许多发行版目前都在使用该版本)。

于 2013-04-06T01:47:23.040 回答
0

这对我来说似乎是一个错误System.Net.WebConnectionStream.ReadAll。不知何故,我怀疑这readBufferOffset已经变成了负面的,虽然它不是很明显......(当然,这可能自 2.8.2 以来已经修复......)参数验证代码Buffer.BlockCopy非常简单......

于 2011-03-14T16:45:00.290 回答