【问题标题】:Mono 2.8.2 System.buffer.blockcopy errorMono 2.8.2 System.buffer.blockcopy 错误
【发布时间】:2011-03-14 16:36:36
【问题描述】:

在高负载环境下测试运行 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 本身的问题?它似乎是在服务器负载较高后出现的,并且我的任何源代码文件都没有参考行号。

还要注意,升级到 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

【问题讨论】:

    标签: apache mono apache2 mod-mono


    【解决方案1】:

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

    【讨论】:

    • 谢谢。我希望情况并非如此,但看起来它肯定是单声道本身的东西。不幸的是,对我来说,mod_mono 和 mono-fastcgi 中都出现了这些错误的变体,所以我需要弄清楚如何解决它们。
    • 在第 438 行的System.Net.WebConnection 中,pos(偏移量)默认设置为 -1,然后有几个代码路径(尽管它们可能不太可能,但我不知道)在哪里它不会改变任何位置。不过,此错误已在 2.10.1 中修复。
    • 其实我的错,2.10.1还是有问题
    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 2011-07-27
      • 2013-01-22
      • 1970-01-01
      • 2016-03-28
      • 1970-01-01
      • 1970-01-01
      • 2019-09-21
      • 2012-11-24
      • 1970-01-01
      相关资源
      最近更新 更多