1
下面是我的程序,我试图在WaitForSingleObject()调用中使用windbg阻塞进程时获取调用堆栈。奇怪的是,当进程阻塞时,windbg只打印出非常奇怪的堆栈。WaitForSingleObject()的非常奇怪的windbg行为
wow64cpu!TurboDispatchJumpAddressEnd+0x690 wow64cpu!TurboDispatchJumpAddressEnd+0x484 wow64!Wow64SystemServiceEx+0x1ce wow64!Wow64LdrpInitialize+0x429 ntdll!RtlResetRtlTranslations+0x1b08 ntdll!RtlResetRtlTranslations+0xc63 ntdll!LdrInitializeThunk+0xe
// process2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "windows.h"
HANDLE g_hWriteEvent;
int _tmain(int argc, _TCHAR* argv[])
{
g_hWriteEvent = OpenEvent(
EVENT_ALL_ACCESS,
FALSE,
TEXT("WriteEvent")
);
if (g_hWriteEvent == NULL) {
printf("OpenEvent error (%d)\n", GetLastError());
return 0;
}
// while (1);
WaitForSingleObject(g_hWriteEvent, INFINITE);
return 0;
}
需要注意的是,如果我取消了while(1)
线则在WinDbg可以识别进程正在阻塞在_tmain
功能。
谢谢。 Bin
看起来这是一个在64位操作系统上运行的Wow64 32位进程。确保你将64位Windbg连接到进程,而不是32位Windbg。 – 2009-10-28 02:41:21
谢谢,这真的是问题所在! 我发出32位切换命令后,现在回溯很好! !wow64exts.sw – 2009-10-28 02:55:46