故障转储中的套接字调查
我们有来自客户的故障转储(用户模式),该客户在我们的应用程序中遇到网络问题。在故障转储中,我可以看到所有为网络打开的句柄。
问题:如何调查与句柄关联的套接字?
Windbg !handle 命令不显示有关连接属性的信息。我是说 - 套接字状态 - 绑定/远程IP, - 绑定/远程端口
- 待处理的数据缓冲区(会很棒)等。
We have a crash dump (user mode) from the customer which is experiencing networking issues with our application. In crash dump I can see all handles that are open for networking.
Question: How can I investigate the socket associated with the handle?
Windbg !handle command shows no information about connection properties. I mean
- socket status
- bind/remote ip,
- bind/remote port
- pending data buffers (would be great) etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
套接字句柄是内核句柄(这就是为什么您可以向它们写入文件),仅使用用户模式转储,您无法从中获取任何信息。事实上,您询问的大多数信息(尤其是待处理的数据缓冲区)几乎肯定会在内核模式下进行管理。
如果您想保留此信息,则必须对您的应用程序进行检测,以将套接字创建参数保存在用户模式内存中。
Socket handles are kernel handles (that's why you can WriteFile to them), with just a user-mode dump, you cannot get any information out of them. In fact, most of the information you're asking about (esp. pending data buffers) are almost certainly going to be managed in kernel mode.
If you want to keep this information, you're going to have to instrument your app to hold the socket creation params in user-mode memory.
10 年后...
但是对于基于 C# 的套接字泄漏 -
将转储加载到 Windbg 中,运行
记忆。有一个命令,但我只是加载内存
窗口(在windbg预览中的视图选项卡上)并粘贴地址
该字符串的。您将在此处看到 IP 地址。
10 years later...
but for c# based socket leaks -
load the dump into windbg run an
memory. there is a command for it, but i just load up the memory
window (on the view tab in windbg preview) and paste in the address
of that string. you'll see the IP address here.