我們在生產環境中遇到了奇怪的錯誤,我們無法調試也無法注入日誌記錄代碼。我試圖找出這個,但下面的堆棧跟蹤混淆了我。在什麼情況下System.Collections.ArrayList.Add拋出IndexOutOfRangeException?
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Collections.ArrayList.Add(Object value)
at ...
According to the MSDNAdd
方法時才拋出NotSupportedException
。
我不知道這裏發生了什麼。你做?
你可以發佈一些完整的stacktrace嗎? – shahkalpesh 2010-09-25 14:25:05
只是猜測:ArrayList用於多線程操作? – 2010-09-25 14:28:28
您可能能夠通過在發生異常時在調試器中檢查其他線程狀態來確認併發錯誤。檢查當時是否有其他人正在更換容器。 – 2010-09-25 15:47:59