WinDbg 调试 System.IO.IOException

发布于 2024-09-17 12:40:39 字数 1604 浏览 6 评论 0原文

我有一个来自自定义 exe 崩溃的完整转储文件。当我查看线程时,我看到 System.IO.IOException 并打印异常给我以下错误。我怀疑有某种线程竞争导致了这种情况,因为我们使用的是普通 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()

I have a full dump file from a custom exe crash. When i review the threads, i see System.IO.IOException and print exception gives me the below error. 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. Any ideas to debug the thread racing with 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()

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

锦欢 2024-09-24 12:40:39

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

为了确定同一进程正在访问该文件,我将使用 procmon< /a>
来识别这一点。

华泰

Have a bp on System.IO.FileStream..ctor inside the debugger and get the call stack using !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.

HTH

叹梦 2024-09-24 12:40:39

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

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

If possible, open a support case via http://support.microsoft.com and share the dumps with Microsoft support team.

I suspect that you did not capture a correct dump, or you went to the wrong exception. But who knows without the correct dump?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文