简体   繁体   English

WinDbg调试System.IO.IOException

[英]WinDbg to debug System.IO.IOException

I have a full dump file from a custom exe crash. 我有一个自定义exe崩溃的完整转储文件。 When i review the threads, i see System.IO.IOException and print exception gives me the below error. 当我查看线程时,我看到System.IO.IOException,并且打印异常给了我以下错误。 I suspect there is some sort of thread racing leading to this since we are on a vanilla Windows2008 (x64) server that doesn't have any virus scanners or indexing services installed. 我怀疑是某种形式的线程竞赛导致了这一点,因为我们使用的是普通的Windows2008(x64)服务器,没有安装任何病毒扫描程序或索引服务。 Any ideas to debug the thread racing with WinDbg? 有什么用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()

Have a bp on System.IO.FileStream..ctor inside the debugger and get the call stack using !clrstack . 在调试器中的System.IO.FileStream..ctor上有一个bp,并使用!clrstack获取调用堆栈。 With this information i think you can figure out which other code is creating a file with exclusive access which is causing the issue. 我想借助这些信息,您可以找出哪个其他代码正在创建具有独占访问权限的文件,这会导致此问题。

To be certain the same process is holding to access to the file I would use procmon to identify this. 可以肯定的是,访问该文件的过程仍在同一过程中,我将使用procmon进行识别。

HTH 高温超导

If possible, open a support case via http://support.microsoft.com and share the dumps with Microsoft support team. 如果可能,请通过http://support.microsoft.com打开一个支持案例,并与Microsoft支持团队共享转储。

I suspect that you did not capture a correct dump, or you went to the wrong exception. 我怀疑您没有捕获正确的转储,或者您遇到了错误的异常。 But who knows without the correct dump? 但是谁知道没有正确的转储呢?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM