开发者

Very strange windbg behavior with WaitForSingleObject()

开发者 https://www.devze.com 2022-12-09 10:25 出处:网络
Below is my program and I am trying to get the call stack when the process is blocked in WaitForSingleObject() call using windbg. The strange thing is when the process is blocking, windbg only prints

Below is my program and I am trying to get the call stack when the process is blocked in WaitForSingleObject() call using windbg. The strange thing is when the process is blocking, windbg only prints out very strange stack.

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 开发者_Python百科_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 that if I uncomment the while(1) line then the windbg can recognize the process is blocking in the _tmain function.

Thanks. Bin


Looks like that is a Wow64 32 bit process running on 64 bit OS. Make sure you attach the 64 bit Windbg to the process, not the 32 bit Windbg.

0

精彩评论

暂无评论...
验证码 换一张
取 消