我有一個應用程序,只有在程序關閉後纔會拋出異常。這是非常不一致的。 (我們都知道多麼有趣的不一致的錯誤是...)程序終止後引發的異常(遇到的錯誤)
我的猜測是在清理過程中出現錯誤。但是,這些內存讀/寫錯誤似乎表明我的「不安全」代碼使用情況(指針?)有問題。
我感興趣的是調試這些情況的最佳方法是什麼?
如何調試已關閉的程序?
我正在尋找一個解決更大問題的出發點。
這些錯誤似乎展示自己在幾個方面(一些運行時,一些調試):
1: .NET-BroadcastEventWindow.2.0.0.0.378734a.0: Application.exe - Application Error
The instruction at "0x03b4eddb" referenced memory at "0x00000004". The memory could not be "written". 2: Application.vshost.exe - Application Error
The instruction at "0x0450eddb" referenced memory at "0x00000004". The memory could not be "written". 3: Application.vshost.exe - Application Error
The instruction at "0x7c911669" referenced memory at "0x00000000". The memory could not be "read". 4: Application.vshost.exe - Application Error
The instruction at "0x7c910ed4" referenced memory at "0xfffffff8". The memory could not be "read".
是的,它是多線程的。我意識到開發人員傾向於避免大量的線程數量的應用程序,但我的應用程序可以同時運行多個動畫圖形,因此顯着的線程數量。 – PersistenceOfVision 2008-10-08 14:12:09
多線程本身並不是一個罪過,但它更有可能不是一個錯誤的線程(或兩個)在您的進程終止後很長一段時間內充電到遠處。關閉應用程序後檢查運行的進程。 – 2008-10-08 14:20:18