COM 故障排除应用程序死锁
我正在尝试对间歇性死锁的 COM+ 应用程序进行故障排除。上次锁定时,我能够获取 dllhost 进程的用户模式转储并使用 WinDbg 对其进行分析。检查完所有线程和锁后,一切都归结为该线程拥有的关键部分:
ChildEBP RetAddr Args to Child
0deefd00 7c822114 77e6bb08 000004d4 00000000 ntdll!KiFastSystemCallRet
0deefd04 77e6bb08 000004d4 00000000 0deefd48 ntdll!ZwWaitForSingleObject+0xc
0deefd74 77e6ba72 000004d4 00002710 00000000 kernel32!WaitForSingleObjectEx+0xac
0deefd88 75bb22b9 000004d4 00002710 00000000 kernel32!WaitForSingleObject+0x12
0deeffb8 77e660b9 000a5cc0 00000000 00000000 comsvcs!PingThread+0xf6
0deeffec 00000000 75bb21f1 000a5cc0 00000000 kernel32!BaseThreadStart+0x34
它正在等待的对象是一个事件:
0:016> !handle 4d4 f
Handle 000004d4
Type Event
Attributes 0
GrantedAccess 0x1f0003:
Delete,ReadControl,WriteDac,WriteOwner,Synch
QueryState,ModifyState
HandleCount 2
PointerCount 4
Name <none>
No object specific information available
据我所知,该事件永远不会收到信号,导致线程挂起并保持在此过程中启动其他几个线程。有没有人对弄清楚发生了什么事情的后续步骤有任何建议?
现在,看到该方法被称为 PingThread,它是否有可能尝试 ping 已经死锁的进程中的另一个线程?
更新
这实际上是 Oracle 10.2.0.1 客户端中的一个错误。尽管如此,我仍然对如何在没有在 Oracle 错误数据库中找到错误的情况下解决这个问题的想法感兴趣。
I'm trying to troubleshoot a COM+ application that deadlocks intermittently. The last time it locked up, I was able to take a usermode dump of the dllhost process and analyze it using WinDbg. After inspecting all the threads and locks, it all boils down to a critical section owned by this thread:
ChildEBP RetAddr Args to Child
0deefd00 7c822114 77e6bb08 000004d4 00000000 ntdll!KiFastSystemCallRet
0deefd04 77e6bb08 000004d4 00000000 0deefd48 ntdll!ZwWaitForSingleObject+0xc
0deefd74 77e6ba72 000004d4 00002710 00000000 kernel32!WaitForSingleObjectEx+0xac
0deefd88 75bb22b9 000004d4 00002710 00000000 kernel32!WaitForSingleObject+0x12
0deeffb8 77e660b9 000a5cc0 00000000 00000000 comsvcs!PingThread+0xf6
0deeffec 00000000 75bb21f1 000a5cc0 00000000 kernel32!BaseThreadStart+0x34
The object it's waiting on is an event:
0:016> !handle 4d4 f
Handle 000004d4
Type Event
Attributes 0
GrantedAccess 0x1f0003:
Delete,ReadControl,WriteDac,WriteOwner,Synch
QueryState,ModifyState
HandleCount 2
PointerCount 4
Name <none>
No object specific information available
As far as I can tell, the event never gets signaled, causing the thread to hang and hold up several other threads in the process. Does anyone have any suggestions for next steps in figuring out what's going on?
Now, seeing as the method is called PingThread, is it possible that it's trying to ping another thread in the process that's already deadlocked?
UPDATE
This actually turned out to be a bug in the Oracle 10.2.0.1 client. Although, I'm still interested in ideas on how I could have figured this out without finding the bug in Oracle's bug database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SIEExtPub 可以帮助您找出 COM 中的锁
这里有关于此的 文章
如果您在使用此扩展程序时遇到任何问题,请回复
SIEExtPub can help you figure out locks in COM
And here is article about this
If you have any trouble in using this extension please post back
您可以使用
!locks
来尝试自动分析死锁,然后转储线程的调用堆栈~* kb
并检查哪些线程正在等待关键部分或事件对象。这里有一个示例用法: http://www.dumpanalysis.org/blog/index.php/2007/07/28/crash-dump-analysis-patterns-part-9c/
另外这个家伙的网站有很多例子使用 WinDbg 处理其他类型的死锁,包括托管代码: http://www.dumpanalysis.org/ 只需执行在页面上搜索“死锁”,希望这会有所帮助。
You could use
!locks
which will try to auto analyse deadlocks and then dump the call stacks of the threads~* kb
and check which threads are waiting on the critical section or event objects.There is an example usage here: http://www.dumpanalysis.org/blog/index.php/2007/07/28/crash-dump-analysis-patterns-part-9c/
plus the guy's site has lots of examples of using WinDbg for other types of deadlocks including managed code: http://www.dumpanalysis.org/ just do a search on the page for 'deadlock', hope this helps.