问题标签 [windbg]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
430 浏览

c++ - cdb/windbg 是否与 autoexp.dat 等效?

我想使用“dt”或“??”更改某些类型的显示方式 以类似于使用 autoexp.dat 执行此操作的方式。有没有办法做到这一点?

例如,我有一个类似这样的结构:

我有几百个这样的数组,我知道所有这些都指向一个结构 Bar。有没有办法告诉 cdb,无论如何,在这个表达式中,'p' 是指向 Bar 的指针?这是你可以用 autoexp 做的事情。(这里的具体例子是我有一个可以有任何类型的键的存储表,但我知道它们的键是字符串。实现将它们存储为 void 指针)。

提前致谢!

0 投票
3 回答
5141 浏览

windbg - 没有符号的 WinDBG 转储分析

我们有一个事件,我打电话给 Microsoft 支持,他们能够使用 WinDBG 分析我的一个小型转储并确定发生的确切问题。我 WinDBG 分析了相同的转储,但无法通过堆栈跟踪。我假设我无法找到金块,因为我很无知,但微软不会告诉我他们自己做了什么来挖掘它。有没有机会在这里得到一些帮助?

这种情况涉及对供应商提供的 Web 服务的 .NET 1.1 调用。连续几周每晚 1 小时,我们无法针对该服务进行身份验证,但连接没有失败。在每次中断期间,我们都会挂起数十个线程,直到服务重新上线。

如果我 DebugDiag 和 Report,我可以看到线程 49 已挂起,并针对该线程运行 !clrstack。

0:049> !clrstack
succeeded
Loaded Son of Strike data table version 5 from "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorsvr.dll"
Thread 49
ESP EIP
1382ec64 7c82860c [FRAME: NDirectMethodFrameStandalone] [DEFAULT] I4 System.Net.UnsafeNclNativeMethods/OSSOCK.recv(I,I,I4,ValueClass System.Net.Sockets.SocketFlags)
1382ec78 10fb1fef [DEFAULT] [hasThis] I4 System.Net.Sockets.Socket.Receive(SZArray UI1,I4,I4,ValueClass System.Net.Sockets.SocketFlags)
1382ecb8 10fb1e65 [DEFAULT] [hasThis] I4 System.Net.Sockets.NetworkStream.Read(SZArray UI1,I4,I4)
1382ece4 10fb1dd1 [DEFAULT] [hasThis] I4 System.Net.TlsStream.ForceRead(SZArray UI1,I4,I4)
1382ed00 10fb1cc4 [DEFAULT] [hasThis] SZArray UI1 System.Net.TlsStream.ReadFullRecord(SZArray UI1,I4)
1382ed20 10a6f7df [DEFAULT] [hasThis] Class System.Exception System.Net.TlsStream.Handshake(Class System.Net.ProtocolToken)
1382ed44 10a6f59b [DEFAULT] [hasThis] Void System.Net.TlsStream..ctor(String,Class System.Net.Sockets.Socket,Boolean,Class System.Security.Cryptography.X509Certificates.X509CertificateCollection)
1382ed5c 10a6f4d0 [DEFAULT] [hasThis] ValueClass System.Net.WebExceptionStatus System.Net.Connection.ConstructTlsChannel(String,Class System.Net.HttpWebRequest,ByRef Class System.Net.Sockets.NetworkStream,Class System.Net.Sockets.Socket)
1382ed78 10a6f47b [DEFAULT] [hasThis] ValueClass System.Net.WebExceptionStatus System.Net.Connection.ConstructTransport(Class System.Net.Sockets.Socket,ByRef Class System.Net.Sockets.NetworkStream,Class System.Net.HttpWebRequest)
1382edac 10a693d7 [DEFAULT] [hasThis] Void System.Net.Connection.StartConnectionCallback(Object,Boolean)
1382f028 791b7f92 [FRAME: ContextTransitionFrame]

(!clrstack -p 对我不起作用。它返回与不要求参数完全相同的信息。我认为这是因为我没有代码的私有符号。但是!do 对我也不起作用! dumpobj 确实如此。我通过“.loadby sos mscorsvr”加载了 sos,而不是 mscorwks,因为我在服务器上运行。我的 sos 加载可能在某种程度上是错误的吗?)

无论如何,微软很友好地告诉我他们发现的部分内容。他们告诉我他们提取的堆栈跟踪,而我也提取了同一个。(这很酷。)不过,他们从堆栈跟踪中提取了以下信息。如何?

- So the above thread is waiting on a socket. The socket details are mentioned below
SOCKADDR @ 01285dc0
sin_family = 2 (IP)
sin_port = 443
sin_addr = 206.16.40.219

然后他们告诉我悬挂物体的名称,这样我就可以把它扔掉,我可以。

0:049> !dumpobj 0x09278dbc
Name: System.String
MethodTable 0x79b946b0
EEClass 0x79b949fc
Size 140(0x8c) bytes
mdToken: 0200000f (c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll)
String: https://www.vendorname.com/services/v2006/Authentication

他们是如何从堆栈跟踪中识别出那些没有私有符号的对象的?作为管理员,我不能只在调试模式下编译此代码,也不能将调试代码部署到生产环境中,除非万不得已。微软拥有与我完全相同的信息,他们找到了答案,所以我认为如果我能克服无知的困境,就可以找到答案。

(根据一个答案,我补充说我的 WinDBG 符号搜索路径说: SRV*D:\Tools\Debuggers\Symbols*http://msdl.microsoft.com/download/symbols

谢谢你。

0 投票
4 回答
6455 浏览

debugging - 是否有任何具有更好 GUI 的 WinDBG 替代品?

我偶尔使用WinDBG来分析生产环境中的问题,无法安装VS。毫无疑问,它是一个非常强大的工具,但使用它有点烦人。尽管产品更新频繁,但它的图形用户界面可以追溯到 Win95 天左右,因此它的可用性也是如此。必须与 GUI 竞争以按照我想要的方式布局窗口,并且必须记住所有这些文本命令,这对于现代桌面应用程序来说是相当低的标准。

AFAIK,WinDBG 几乎建立在 CDB 之上,CDB 是一个命令行调试器。既然如此,构建一个现代的 GUI 包装器来取代现有的恐龙应该不难。有没有人这样做过?我是唯一一个对 WinDBG 有这种复杂感觉的人吗?

(顺便说一句,我知道我可以创建一个转储并将其带回我拥有 VS 的位置,但有时我必须调试 64 位进程,而且我没有 64 位开发机器。可悲,但确实如此)

0 投票
1 回答
820 浏览

windbg - 当 bp 命中时,windbg/cdb 挂起

当我使用它进行调试并附加到我机器上的特定应用程序时,我遇到了一个问题,即 cdb 或 windbg 经常挂起,但并非一直挂起。

我发现这篇文章:http ://www.nynaeve.net/?p= 164 谈到了符号加载竞争条件是问题,但我可以强制加载符号,实际上有一个断点在应用程序工作,并且仍然让它挂在别处。

当我使用另一个调试器附加到它时,这是来自 cdb 本身的堆栈:

!analyze 报告 APPLICATION_HANG_BusyHang 是问题桶,而“ReadNonConLine”是有问题的函数。

就堆栈而言:

ReadNonConLine 将 0014ebb0 处的字符串“g”作为参数传递,这可能是我在悬挂断点处的命令的一部分(类似于 bp foo“dt a; g”)

ReadFile 将句柄作为其第一个参数。但是,我对值 -2 感到惊讶,这看起来并不有效。

任何帮助表示赞赏。

谢谢!亚伦

0 投票
2 回答
13291 浏览

debugging - WinDbg not showing useful information

First let me say I am a total WinDbg noob, so this might be an easy question...

I have an application ("MyApp" - name changed to protect the innocent!) that I am trying to debug because it is throwing an exception. This only happens on user machines - I have not been able to reproduce it on my development machine. So I set up DebugDiag on the users machine and captured a Full Dump. Then I loaded the dump in WinDbg and did an analyze -v and a kp to try to figure out what was going on... but neither of these seem to give me the information that I'm looking for - the function (and hopefully the line number) of the line that is causing the problem... I think I have the symbol file loaded by specifying the path to 'MyApp.pdb' in the Symbol File Path:

First, here's the output from kp:

the line I'm specifically trying to decode is the 'MyApp!DllMain+0x65329' as this is the last line that seems to be executing, and the error is occurring within the malloc call, which is apparently where the exception is being thrown from. What am I doing wrong that makes it only display the module and offset instead of source file and line number?

I'm also not sure why the line above the malloc call is back in MyApp again - maybe someone can explain that too.

Just in case, here's the output from 'analyze -v':

0 投票
4 回答
3774 浏览

windbg - Windbg:SOS.dll:!gcroot:DOMAIN(xxx):HANDLE(Pinned):它真的意味着对象被固定了吗?

SOS.dll Windbg 扩展的文档似乎很少。发出 !gcroot <address> 后,我得到了包含以下内容的内容:

“HANDLE(Pinned)”真的意味着有一个 GCHandleType.Pinned 类型的 GCHandle 正在植根这个对象吗?

0 投票
1 回答
718 浏览

windows - 句柄分配在哪里?

我想知道是否可以使用 WinDbg 来了解导致分配句柄的调用堆栈。

例如:

在构建此示例并在 WinDbg 中启动它之后,是否可以在行上方的示例中获取分配句柄的调用堆栈:

我正在用!handle命令四处寻找,但到目前为止没有任何进展。

这与处理泄漏分析有关。我知道,!htrace -enable但这!htrace -diff是一个不同的使用场景(除非有某种组合方式或其他使用向量,请提供信息)。

0 投票
4 回答
1651 浏览

.net - 如何在调试期间找到实现给定接口的所有类型实例

我正在寻找一种方法来定位实现给定接口的类型堆上的所有当前实例(即在 WinDbg 调试期间)。由于接口不是可以创建接口实例的类型,因此在检查堆时它们显然不会出现。即!dumpheap在这里没有什么帮助。

但是,!dumpmt -md在给定的 MT 上列出了IFacesin的数量IFaceMap。据我所知,这个数字似乎表明该类型是否实现了一个或多个接口。当-md在类型上使用标志方法时也会列出。

不幸的是!dumpmd,据我所知,它并没有将给定的方法与接口联系起来,因此它不能用于建立实现的接口。

我假设这些信息在内存中的某处可用,但我不确定在哪里查找。任何输入都受到高度赞赏。

0 投票
1 回答
598 浏览

assembly - 理解windbg中的汇编代码

我在windbg中调试了一些代码,但我无法理解一些汇编代码

有人能解释一下这个语句是什么意思吗?我知道这是调用语句,但它是如何跳转到 028d1170 地址的

0 投票
3 回答
5553 浏览

c# - 使用 WinDbg 从故障转储检查原始内存中的方法参数

我们的一位客户报告了崩溃。在出现未处理的异常后,她看到了标准错误消息:

“应用程序产生了无法处理的异常...单击确定终止应用程序。单击取消调试应用程序。”

我使用 DebugDiag 生成此过程的转储。我现在正在看垃圾场。

!threads 在我的托管线程中向我显示了一个异常。有几个嵌套异常。这个在底部:

该代码以表单的形式向用户显示了一个 Crystal Report。在显示报告时,应用程序尝试做某事并得到 System.AccessViolationException。

查看 NativeWindow.Callback 源代码,我看到了这一点:

我想知道导致异常的消息、wParam 和 lParam 参数。(我还想确认我正在查看正确的异常对象。)这可能是对 UI 线程的调用,也可能是正常的 Windows 事件,在这种情况下我想知道是哪一个。

我得到了线程环境块:

并转储堆栈内存:

所以如果签名是这样的: SP IP 0013E9A4 7B1C8512 NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)+0x72

  1. 堆栈上的参数到底在哪里?
  2. 我如何检查它们以获取它们的值?

我仍然觉得我没有找到根本原因。我们有一个 ThreadException 处理程序。为什么不叫?是什么原因造成的System.AccessViolationException

请注意已!analyze -v报告STATUS_BREAKPOINT,因为用户在错误对话框“应用程序已生成异常...”处停止。