comportamento windbg muito estranho com WaitForSingleObject ()
-
06-07-2019 - |
Pergunta
Abaixo está o meu programa e eu estou tentando obter a pilha de chamadas quando o processo é bloqueado em WaitForSingleObject () chamar usando windbg. O estranho é quando o processo está bloqueando, windbg só imprime a pilha muito estranho.
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;
}
Note que, se eu remover o comentário da linha while(1)
então o windbg pode reconhecer o processo está bloqueando na função _tmain
.
Graças. Bin
Solução
Looks como esse é um processo Wow64 32 bit rodando em 64 bits do sistema operacional. Certifique-se de anexar o 64 bit Windbg ao processo, e não o de 32 bits Windbg.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow