본문 바로가기

Programing/디버깅

windbg - 덤프파일

윈도우의 덤프파일은 2가지로 나뉜다.

전체 덤프: 전체 메모리와 미니덤프의 내용

미니덤프: 레지스터들, 스택, 메모리의 일부 내용

 

심볼 지정하기

보통 자기 시스템에 설치한 심볼 디렉토리하고 ms의 것을 지정해준다.

심볼이 없다면 Download Windows Symbols에서 알맞은 심벌 데이터를 다운로드 받는다.

SRV*c:\WINDOWS\symbols*http://msdl.microsoft.com/download/symbols

 

[File]-[Symbol File Path]를 선택하여 다이얼로그에서 지정해준다.

지정해주고 Reload를 해주면 필요한 심볼을 찾는다.

> .reload /f

 

미니덤프화일 분석

 

Windows XP의 경우 보통 "C:\WINDOWS\Minidump" 폴더로 지정되어 있다.

이 경로는  [시스템 등록 정보]- [고급] - "시작 및 복구"의 [설정] -에 덤프 디렉토리를 참고한다.

 

 

파일을 선택해보자..

 

 

덤프 파일을 열면 기본적으로 심볼하고 모듈 리스트를 보여준다.

 

 

유저모드 덤프 디버깅

.ecxr 명령/k 명령

처음 로딩하면

The stored exception information can be accessed via .ecxr.

와 같은 메시지가 있다.

도움말에는 아래와 같이 설명이 적혀있다.

The .ecxr command displays the context record that is associated with the current exception.

현재 예외와 관련된 컨텍스트 레코드를 표시한다는 것이다.

컨텍스트 레코드는 보통 CPU 레지스터 셋(Register Set)을 의미한다.

 

이후 k명령으로 콜 스택을 살펴본다.

The k* commands display the stack frame of the given thread, together with related information..

참고로 이 스택에서 윗부분이 마지막에 호출된 부분이다.

 

lmvm [모듈명] 명령

lm 명령: 로드된 모든 명령을 확인할 때 사용하는 명령어

> lmvm sqlservr

 

심볼 맞추기

  1. > .symfix [경로]
  2. > .symfix+ [경로]
  3. > .reload

 콜 스택 보기(k)

 

커널모드 덤프

!analyze -v 명령

windbg로 왜 블루스크린을 맛보았는지 알 수 있다.

!analyze -v

 

아래는 분석 명령을 내린 후의 출력된 사항이다.

0: kd> !analyze -v
*******************************************************************************
*                                                                             *
*                        Bugcheck Analysis                                    *
*                                                                             *
*******************************************************************************
UNEXPECTED_KERNEL_MODE_TRAP_M (1000007f)
This means a trap occurred in kernel mode, and it's a trap of a kind
that the kernel isn't allowed to have/catch (bound trap) or that
is always instant death (double fault).  The first number in the
bugcheck params is the number of the trap (8 = double fault, etc)
Consult an Intel x86 family manual to learn more about what these
traps are. Here is a *portion* of those codes:
If kv shows a taskGate
        use .tss on the part before the colon, then kv.
Else if kv shows a trapframe
        use .trap on that value
Else
        .trap on the appropriate frame will show where the trap was taken
        (on x86, this will be the ebp that goes with the procedure KiTrap)
Endif
kb will then show the corrected stack.
Arguments:
Arg1: 00000008, EXCEPTION_DOUBLE_FAULT
Arg2: 80042000
Arg3: 00000000
Arg4: 00000000
Debugging Details:
------------------

BUGCHECK_STR:  0x7f_8
CUSTOMER_CRASH_COUNT:  1
DEFAULT_BUCKET_ID:  DRIVER_FAULT
PROCESS_NAME:  igfxsrvc.exe
LAST_CONTROL_TRANSFER:  from 805752ae to 8057560d
STACK_TEXT: 
a405205c 805752ae a40520f8 e6c68008 a40520fc nt!MiUnmapViewOfSection+0x86
a4052074 8057526f e10164a4 a40520f8 e6c68008 nt!NtQueryInformationFile+0x362
a40520c0 80633947 e6d55430 00000001 a40520f8 nt!CcCopyRead+0x567
a4052100 8056fda4 e6d55430 a405212c e6d5542c nt!CompareNamesCaseSensitive+0x1e
a4052130 8057546b e6d55430 892d45c0 00000001 nt!CmpGetNextName+0x84
a405217c 80574724 e1037b60 001feb10 00000000 nt!NtFreeVirtualMemory+0x2ac
a405237c 8056f03b 001feb10 00000000 892d45c0 nt!CmSetValueKey+0x19
a40523f4 805721e7 00000000 a4052434 00000240 nt!NtQueryVolumeInformationFile+0x30
a4052448 80574cf7 00000000 8ac372d8 f74fcc00 nt!HvpGetCellMapped+0xc7
a4052544 a26fa92b a4052a34 82000000 a4052768 nt!NtQueryInformationFile+0xb7
WARNING: Stack unwind information not available. Following frames may be wrong.
a40526c4 804df99f a4052a34 82000000 a4052768 AhnRghNt+0x692b
a40526c8 a4052a34 82000000 a4052768 a40529b8 nt!ZwSetSystemPowerState+0xf
a40526d8 804e5bff badb0d00 a4052750 00000000 0xa4052a34
a40529b8 8060c02d 00000000 e68e32f0 00000000 nt!IofCompleteRequest+0x9
a4052c4c b8f22c69 00000000 e68e32f0 a4052c74 nt!CcPfPrefetchScenario+0x1e
a4052cc0 b8f2fa1d 8a115a20 e68e32f0 00000000 VIDEOPRT!VPGetRegistryParameters+0xed
a4052ce4 b8f492cc 8a115a20 b906a874 00000000 VIDEOPRT!VideoPortGetRegistryParameters+0x2d
a4052d14 b8f9beff 8a115a20 00000000 b94bc550 igxpmp32+0x142cc
a4052d44 b8fb4138 89f12558 b906a874 00000003 igxpmp32+0x66eff
a4052d6c b8fb0801 8a034578 b906a874 00000004 igxpmp32+0x7f138
a4052da0 b8fa62dd 89dfe708 00000001 a4052e40 igxpmp32+0x7b801
a4052f98 b8fa51b3 89dfd368 89dfb4a8 a40531a9 igxpmp32+0x712dd
a405306c b8fa4be0 89dfd368 01010100 89dfb4a8 igxpmp32+0x701b3
a4053094 b8fa2ee9 89dfd368 01010100 a4053298 igxpmp32+0x6fbe0
a40531e4 b8fc060c a4053200 89dfd368 01010100 igxpmp32+0x6dee9
a4053230 b8fac887 89dfc870 a40532a0 00232038 igxpmp32+0x8b60c
a40532f8 b8f9d35d 89dfcd30 a40533ac a4053320 igxpmp32+0x77887
a4053308 b8f9f95c 89e07008 a40533ac 89f12558 igxpmp32+0x6835d
a4053320 b8f576c7 8a115a20 a40533ac 00232038 igxpmp32+0x6a95c
a4053624 b8f3d479 8a115a20 00000007 89140218 igxpmp32+0x226c7
a40541c0 b8f3a084 8a115a20 a40541f0 00000000 igxpmp32+0x8479
a40541d4 b8f2f729 8a115a20 a40541f0 00000004 igxpmp32+0x5084
a4054298 804e33eb 8a115708 890e9618 00000050 VIDEOPRT!pVideoPortDispatch+0xabf
a4054298 00000050 8a115708 890e9618 00000050 nt!KiTrap0D+0x4a5
a4054348 e19ae818 00000007 00174f28 00000000 0x50
a40543f0 805756ea e6ce3670 e16b5490 80575729 0xe19ae818
a40543fc 80575729 a405452c e12b5328 00000000 nt!NtUnmapViewOfSection+0x4
a405445c 00000000 804de605 a405452c 805621e0 nt!NtUnmapViewOfSection+0x46

STACK_COMMAND:  kb
FOLLOWUP_IP:
AhnRghNt+692b
a26fa92b ??              ???
SYMBOL_STACK_INDEX:  a
SYMBOL_NAME:  AhnRghNt+692b
FOLLOWUP_NAME:  MachineOwner
MODULE_NAME: AhnRghNt
IMAGE_NAME:  AhnRghNt.sys
DEBUG_FLR_IMAGE_TIMESTAMP:  4e4e5cb0
FAILURE_BUCKET_ID:  0x7f_8_AhnRghNt+692b
BUCKET_ID:  0x7f_8_AhnRghNt+692b
Followup: MachineOwner
---------

 

위의 내용으로 보아서 그래픽카드와 V3 백신과의 조합으로 발생한 크래쉬로 보인다.

igfxsrvc 모듈은 Intel Corporation에서 배포한 것이었다.

인터넷에 보니 AhnRghNt.sys로 인해 블루 스크린이 보여서 패치를 하면된다고 하는데 분명 나는 그 버전보다 높은데 왜 그런거지.