WinDbg调试System.IO.IOException

时间:2010-09-02 21:52:31

标签: .net multithreading windbg

我有自定义exe崩溃的完整转储文件。当我查看线程时,我看到System.IO.IOException并且打印异常给出了以下错误。我怀疑存在某种线程竞争,因为我们使用的是没有安装任何病毒扫描程序或索引服务的vanilla Windows2008(x64)服务器。有没有想过使用WinDbg调试线程的想法?

Exception object: 0000000000ffd230
Exception type: System.IO.IOException
Message: The process cannot access the file 'C:\Logs\20100901.log' because it is being used by another process.
InnerException: <none>
StackTrace (generated):
    SP               IP               Function
    00000000002DD460 000007FEF8E62F18 System.IO.__Error.WinIOError(Int32, System.String)
    00000000002DD4C0 000007FEF8497B25 System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean)
    00000000002DD650 000007FEF84970AB System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions, System.String, Boolean)
    00000000002DD6E0 000007FEF84987F3 System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions)
    00000000002DD770 000007FEF84D198C System.IO.StreamReader..ctor(System.String, System.Text.Encoding, Boolean, Int32)
    00000000002DD7F0 000007FEF844F8D2 System.IO.StreamReader..ctor(System.String, System.Text.Encoding, Boolean)
    00000000002DD830 000007FF00196971 Astea.Diagnostics.AsteaLogFileListener.GetFileEncoding(System.String)
    00000000002DD8A0 000007FF00196581 Astea.Diagnostics.AsteaLogFileListener.GetStream()

2 个答案:

答案 0 :(得分:1)

在调试器内的System.IO.FileStream..ctor上有一个bp,并使用!clrstack获取调用堆栈。有了这些信息,我想你可以弄清楚哪些其他代码正在创建一个具有独占访问权限的文件,这导致了这个问题。

要确保同一进程持有访问我将使用的文件procmon 识别这个。

HTH

答案 1 :(得分:0)

如果可能,请通过http://support.microsoft.com打开支持案例,并与Microsoft支持团队共享转储。

我怀疑你没有捕获到正确的转储,或者你没有找到错误的异常。但谁知道没有正确的转储?

相关问题