2010-07-22 5 views
13

나는 임의의 크래시 버그를 디버깅하고 있지만 실제로 실제로 들어가기는 매우 어렵다. 내가 크래시 덤프를 열 때, 단 하나의 오류 찾을 수 있기 때문에 : 사실WinDbg에서 "중단 명령 예외"란 무엇입니까?

0:000> .exr -1 
ExceptionAddress: 00000000 
    ExceptionCode: 80000003 (Break instruction exception) 
    ExceptionFlags: 00000000 
NumberParameters: 0 

내가 코드에 하드 코드 중단 점을 설정하지 않은, 그래서 난 구글이 예외에 대한 검색을, 어떤 사람들은이 예외가 발생할 수 있습니다 말했다 힙 손상으로. 그럼 내 질문은 하드 코드 중단 점, 디버깅 중에 수동 중단 점, 힙 손상을 제외하고이 예외가 발생하는 다른 이유가 있습니까?

또 다른 질문은 힙 손상을 확인하기 위해 응용 프로그램 검증 도구를 사용하려고합니다. 응용 프로그램 검증자가 힙 손상을 일으키는 동안 응용 프로그램 검증자가 중단 명령어 예외를 트리거합니다. 하지만 현재, 나는 브레이크 검증 예외를 제기 할 애플 리케이션 검증기없이 실행합니까?

추가 정보 : 현재 스레드의 호출 스택.

*0:000> k 
ChildEBP RetAddr 
0012f96c 7c827d19 ntdll!KiFastSystemCallRet 
0012f970 77e6202c ntdll!NtWaitForMultipleObjects+0xc 
0012fa18 7739bbd1 kernel32!WaitForMultipleObjectsEx+0x11a 
0012fa74 3b288523 user32!RealMsgWaitForMultipleObjectsEx+0x141 
0012fab8 3b32b9bd msenv!EnvironmentMsgLoop+0x1ea 
0012fae4 3b32b94d msenv!CMsoCMHandler::FPushMessageLoop+0x86 
0012fb0c 3b32b8e9 msenv!SCM::FPushMessageLoop+0xb7 
0012fb28 3b32b8b8 msenv!SCM_MsoCompMgr::FPushMessageLoop+0x28 
0012fb48 3b32be4e msenv!CMsoComponent::PushMsgLoop+0x28 
0012fbe0 3b327561 msenv!VStudioMainLogged+0x482 
0012fc0c 3000a4a6 msenv!VStudioMain+0xc1 
0012fc38 30007301 devenv!util_CallVsMain+0xff 
0012ff14 3000760c devenv!CDevEnvAppId::Run+0x91f 
0012ff30 30007680 devenv!WinMain+0x74 
0012ffc0 77e6f23b devenv!License::GetPID+0x258 
0012fff0 00000000 kernel32!BaseProcessStart+0x23* 

우리의 응용 프로그램은 Visual Studio 패키지입니다. 다음은

은의 결과입니다! 관리 스택에서 -v

0:000> !analyze -v 
******************************************************************************* 
*                    * 
*      Exception Analysis         * 
*                    * 
******************************************************************************* 

*** WARNING: Unable to verify checksum for mscorlib.ni.dll 
************************************************************************* 
***                 *** 
***                 *** 
*** Your debugger is not using the correct symbols     *** 
***                 *** 
*** In order for this command to work properly, your symbol path *** 
*** must point to .pdb files that have full type information.  *** 
***                 *** 
*** Certain .pdb files (such as the public OS symbols) do not  *** 
*** contain the required information. Contact the group that  *** 
*** provided you with these symbols if you need this command to *** 
*** work.               *** 
***                 *** 
*** Type referenced: kernel32!pNlsUserInfo       *** 
***                 *** 
************************************************************************* 
************************************************************************* 
***                 *** 
***                 *** 
*** Your debugger is not using the correct symbols     *** 
***                 *** 
*** In order for this command to work properly, your symbol path *** 
*** must point to .pdb files that have full type information.  *** 
***                 *** 
*** Certain .pdb files (such as the public OS symbols) do not  *** 
*** contain the required information. Contact the group that  *** 
*** provided you with these symbols if you need this command to *** 
*** work.               *** 
***                 *** 
*** Type referenced: kernel32!pNlsUserInfo       *** 
***                 *** 
************************************************************************* 

FAULTING_IP: 
+0 
00000000 ??    ??? 

EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff) 
ExceptionAddress: 00000000 
    ExceptionCode: 80000003 (Break instruction exception) 
    ExceptionFlags: 00000000 
NumberParameters: 0 

FAULTING_THREAD: 00001f1c 

DEFAULT_BUCKET_ID: STATUS_BREAKPOINT 

PROCESS_NAME: devenv.exe 

ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION} Breakpoint A breakpoint has been reached. 

EXCEPTION_CODE: (HRESULT) 0x80000003 (2147483651) - One or more arguments are invalid 

NTGLOBALFLAG: 0 

APPLICATION_VERIFIER_FLAGS: 0 

MANAGED_STACK: 
SP  IP  Function 
    0012E584 09C8A903 Microsoft_VisualStudio_Design!Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32, Int32[])+0x3b 
    0012E590 09C8C604 Microsoft_VisualStudio_Design!Microsoft.VisualStudio.Design.VSDesignSurfaceManager.Microsoft.VisualStudio.Shell.Interop.IVsSelectionEvents.OnElementValueChanged(UInt32, System.Object, System.Object)+0x144 

StackTraceString: <none> 
HResult: 80004005 

EXCEPTION_OBJECT: !pe 3115d464 
Exception object: 3115d464 
Exception type: System.Runtime.InteropServices.COMException 
Message: Error HRESULT E_FAIL has been returned from a call to a COM component. 
InnerException: <none> 
StackTrace (generated): 
    SP  IP  Function 
    0012E584 09C8A903 Microsoft_VisualStudio_Design!Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32, Int32[])+0x3b 
    0012E590 09C8C604 Microsoft_VisualStudio_Design!Microsoft.VisualStudio.Design.VSDesignSurfaceManager.Microsoft.VisualStudio.Shell.Interop.IVsSelectionEvents.OnElementValueChanged(UInt32, System.Object, System.Object)+0x144 

StackTraceString: <none> 
HResult: 80004005 

MANAGED_OBJECT: !dumpobj 3201988 
Name: System.String 
MethodTable: 79330a00 
EEClass: 790ed64c 
Size: 158(0x9e) bytes 
(C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll) 
String: Error HRESULT E_FAIL has been returned from a call to a COM component. 
Fields: 
     MT Field Offset     Type VT  Attr Value Name 
79332c4c 4000096  4   System.Int32 1 instance  71 m_arrayLength 
79332c4c 4000097  8   System.Int32 1 instance  70 m_stringLength 
793316e0 4000098  c   System.Char 1 instance  45 m_firstChar 
79330a00 4000099  10  System.String 0 shared static Empty 
    >> Domain:Value 00219c28:03031198 << 
79331630 400009a  14  System.Char[] 0 shared static WhitespaceChars 
    >> Domain:Value 00219c28:03031798 << 

EXCEPTION_MESSAGE: Error HRESULT E_FAIL has been returned from a call to a COM component. 

MANAGED_OBJECT_NAME: System.Runtime.InteropServices.COMException 

LAST_CONTROL_TRANSFER: from 7c827d19 to 7c82860c 

PRIMARY_PROBLEM_CLASS: STATUS_BREAKPOINT 

BUGCHECK_STR: APPLICATION_FAULT_STATUS_BREAKPOINT 

STACK_TEXT: 
09c8a903 Microsoft_VisualStudio_Design!Microsoft.VisualStudio.NativeMethods.ThrowOnFailure 
09c8c604 Microsoft_VisualStudio_Design!Microsoft.VisualStudio.Design.VSDesignSurfaceManager.Microsoft.VisualStudio.Shell.Interop.IVsSelectionEvents.OnElementValueChanged 


STACK_COMMAND: dds 12e584 ; kb 

FOLLOWUP_IP: 
+9c8a903 
09c8a903 8bc6   mov  eax,esi 

SYMBOL_STACK_INDEX: 0 

SYMBOL_NAME: Microsoft_VisualStudio_Design!Microsoft.VisualStudio.NativeMethods.ThrowOnFailure+9c8a903 

FOLLOWUP_NAME: MachineOwner 

MODULE_NAME: Microsoft_VisualStudio_Design 

IMAGE_NAME: Microsoft.VisualStudio.Design.dll 

DEBUG_FLR_IMAGE_TIMESTAMP: 0 

FAILURE_BUCKET_ID: STATUS_BREAKPOINT_80000003_Microsoft.VisualStudio.Design.dll!Microsoft.VisualStudio.NativeMethods.ThrowOnFailure 

BUCKET_ID: APPLICATION_FAULT_STATUS_BREAKPOINT_Microsoft_VisualStudio_Design!Microsoft.VisualStudio.NativeMethods.ThrowOnFailure+9c8a903 

Followup: MachineOwner 

...

을 분석하는 명시 적 오류가 발생, Microsoft.VisualStudio.NativeMethods.ThrowOnFailure .. 하지만 com 예외로 인해 중단 명령어 예외가 발생 했습니까?

! analyze는 관리되는 수준의 예외를 덤프하는 것처럼 보일 수 있습니다. com 예외는 아마도 관리되는 수준의 마지막 오류 일 수 있습니다.

Google에서 인터럽트 및 예외에 대해 검색 할 수도 있습니다. 일반적으로 다음 조건에서 중단 명령 예외가 트리거 될 수 있습니다. 1. __asm ​​int 3 (ASM), System.Diagnostics.Debugger와 같은 하드 코드 인터럽트 요청. Break (C#), DebugBreak() (WinAPI). 2. 응용 프로그램 검증 프로그램과 같이 OS가 메모리 런타임 검사를 활성화하면 힙 손상, 메모리 오버런 후 트리거 할 수 있습니다. 3. 컴파일러는 초기화되지 않은 메모리 블록과 기능 끝 (빈 영역, 다시 실행 후 ..)에 대해 채워야하는 내용을 포함하도록 구성 할 수 있습니다. 예를 들어, Microsoft VC 컴파일러는/GZ를 활성화하면 0xCC를 채울 수 있습니다. 0xCC는 실제로 __asm ​​int 3의 opcode입니다. 따라서 일부 오류로 인해 응용 프로그램이 이러한 블록으로 실행되면 중단 점이 트리거됩니다.

맞습니까?

그럴 경우 Application Verifier가 근본 원인을 찾는 최선의 선택이라고 생각합니다.

답변

12

나중에 참조 할 수 있도록 디버거에서 올바른 기호을 사용하고 있지 않습니다. Windows 심볼을 Windbg 심볼 경로에 추가해야하기 때문에 경고가 발생했습니다. 자동

설정 Microsoft 기호 서버 경로 :

0:000> .symfix 

가 선택적으로 어디, 예를 들어,에서 기호를 다운로드하는 추가 위치를 지정할 수 있습니다 여기에 그렇게하는 방법입니다:

0:000> .sympath+ c:\myproject 

확인 현재 심볼 검색 경로 :

SRV**http://msdl.microsoft.com/download/symbols 

새로 고침 기호 :

0:000> .sympath 

당신은 같은 것을 볼 수 그리고

0:000> .reload 

을, 당신이 될 것입니다 curr에 관한 정보를 볼 수있다. 엔트 예외이 명령을 사용하여

ExceptionCode: c0000005 (Access violation) 

행운 고정 버그 :

0:000> !analyze -v 

당신은 다음과 같은 행을 볼 수!

+0

이 간결한 답변에 감사드립니다. 내 하루를 만들어. –

+3

어떻게 기호를 수정하면 액세스 위반으로 INT3 중단 점을 변환 할 수 있습니까? –

2

크래시 덤프를 일으킨 예외를 찾는 데 사용하는 명령은 .ecxr입니다. ExceptionAddress가 0이므로 .exr -1에서 가져온 outpt가 올바르지 않습니다.

관련 문제