我有一个在 Windows Server 2003 上运行的 C++ 多线程应用程序,它每隔几天就会崩溃。通过 windbg 运行崩溃,我得到以下结果:
FAULTING_IP:
+2502faf01a7df58
00000000 ?? ???
EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 00000000
ExceptionCode: 80000003 (Break instruction exception)
ExceptionFlags: 00000000
NumberParameters: 0
FAULTING_THREAD: 00001520
DEFAULT_BUCKET_ID: STATUS_BREAKPOINT
PROCESS_NAME: FixFastMDP.exe
ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION} Breakpoint A breakpoint has been reached.
EXCEPTION_CODE: (HRESULT) 0x80000003 (2147483651) - One or more arguments are invalid
MOD_LIST: <ANALYSIS/>
NTGLOBALFLAG: 0
APPLICATION_VERIFIER_FLAGS: 0
PRIMARY_PROBLEM_CLASS: STATUS_BREAKPOINT
BUGCHECK_STR: APPLICATION_FAULT_STATUS_BREAKPOINT
LAST_CONTROL_TRANSFER: from 7c827d0b to 7c8285ec
STACK_TEXT:
0293ee78 7c827d0b 77e61d1e 00000484 00000000 ntdll!KiFastSystemCallRet
0293ee7c 77e61d1e 00000484 00000000 0293eec0 ntdll!NtWaitForSingleObject+0xc
0293eeec 77e61c8d 00000484 00001388 00000000 kernel32!WaitForSingleObjectEx+0xac
0293ef00 00403bce 00000484 00001388 108744c3 kernel32!WaitForSingleObject+0x12
0293feec 7c83a827 0159ba50 7c889080 0016b278 FixFastMDP!decoderItThread+0x7e
[c:\gszdvmt\trading\serverside\globex\fixfastmdp\mdpmulticast.cpp @ 732]
0293ff44 7c83aa0b 00403b50 0159ba50 00000000 ntdll!RtlpWorkerCallout+0x71
0293ff64 7c83aa82 00000000 0159ba50 0016b278 ntdll!RtlpExecuteWorkerRequest+0x4f
0293ff78 7c839f60 7c83a9ca 00000000 0159ba50 ntdll!RtlpApcCallout+0x11
0293ffb8 77e64829 00000000 00000000 00000000 ntdll!RtlpWorkerThread+0x61
0293ffec 00000000 7c839efb 00000000 00000000 kernel32!BaseThreadStart+0x34
STACK_COMMAND: ~0s; .ecxr ; kb
FOLLOWUP_IP:
FixFastMDP!decoderItThread+7e [c:\gszdvmt\trading\serverside\globex\fixfastmdp\mdpmulticast.cpp @ 732]
00403bce 3d02010000 cmp eax,102h
FAULTING_SOURCE_CODE:
728: ////
729: // call the decoderit() func with the message
730: DWORD waitError = WaitForSingleObject( FFDecoderMutex, MUTEX_TIMEOUT );
731: {
> 732: if( waitError == WAIT_TIMEOUT )
733: {
734: logMsg( "[decoderItThread] Mutex Error: WAIT_TIMEOUT" );
735: }
736: else if( waitError == WAIT_ABANDONED )
737: {
SYMBOL_STACK_INDEX: 4
SYMBOL_NAME: fixfastmdp!decoderItThread+7e
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: FixFastMDP
IMAGE_NAME: FixFastMDP.exe
DEBUG_FLR_IMAGE_TIMESTAMP: 4d41d25b
FAILURE_BUCKET_ID: STATUS_BREAKPOINT_80000003_FixFastMDP.exe!decoderItThread
BUCKET_ID: APPLICATION_FAULT_STATUS_BREAKPOINT_fixfastmdp!decoderItThread+7e
WATSON_STAGEONE_URL: http://watson.microsoft.com/StageOne/FixFastMDP_exe/0_0_0_0/4d41d25b/unknown/0_0_0_0/bbbbbbb4/80000003/00000000.htm?Retriage=1
我对此所做的所有研究几乎都是空洞的,即我似乎无法解释 windbg 相对于应用程序本身所说的内容。
FWIW,上面的源代码嵌入在 try/catch block 中,因此应用程序因未被捕获的异常而崩溃这一事实对我来说表明是非常低级别的异常类型。
此外,此应用程序/进程附加了 4 个线程,通常更多。但是 winbdg 只报告一个线程,这对应用程序来说没有意义。
总结一下
有人遇到过 WaitForSingleObject 调用的类似问题吗?
关于为什么 windbg 在应该有更多线程的情况下报告单个线程,有什么要注意的吗?
提前感谢您提供任何信息/帮助
最佳答案
STATUS_BREAKPOINT 表示 CPU 命中了一条 int 3
指令;这不会通过操作系统发生,除非您正在运行已检查的构建(即,当您的断言失败时会发生这种情况)。你在运行检查构建吗?
2)any heads up regarding why windbg is reproting a single thread when there ought to be alot more?
WinDbg 只是告诉您抛出异常的线程,运行 ~*k
以显示所有这些异常。
关于c++ - WaitForSingleObject 中的 Windows C++ 应用程序错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4852952/