Très étrange comportement de windbg avec WaitForSingleObject ()
-
06-07-2019 - |
Question
Voici mon programme et j'essaie d'obtenir la pile d'appels lorsque le processus est bloqué dans l'appel WaitForSingleObject () à l'aide de windbg. Ce qui est étrange, c’est que lorsque le processus est bloquant, windbg n’imprime que des piles très étranges.
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;
}
Notez que si je ne commente pas la ligne while (1)
, alors windbg peut reconnaître que le processus est bloquant dans la fonction _tmain
.
Merci. Bin
La solution
On dirait qu'il s'agit d'un processus Wow64 32 bits s'exécutant sur un système d'exploitation 64 bits. Assurez-vous d’attacher le Windbg 64 bits au processus, pas le Windbg 32 bits.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow