Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

livekd - Could not resolve symbols for ntoskrnl.exe: MmPfnDatabase

windbg의 Local Kernel Debug 모드는,

Windbg - Local Kernel Debug 모드
; https://www.sysnet.pe.kr/2/0/934

(재부팅이 필요한) "bcdedit -debug on" 명령어가 실행된 환경이어야 해서 다소 번거로운데, 이런 불편함을 LiveKD가 해결해 줍니다.

Windbg를 이용한 로컬 커널 디버깅툴 LiveKD
; https://killdos.tistory.com/9

LiveKD는 전에 Hyper-V의 VM에 대한 메모리 덤프를 뜨는 방법 글에서도 소개한 적이 있는데, 다시 한번 실습을 위해 kd.exe가 있는 windbg의 경로를 맞춰준 후,

C:\SysInternals> set PATH=C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x64;%PATH%

// set PATH=C:\Program Files (x86)\Windows Kits\10\Debuggers\x64;%PATH%

실행했더니 뜻하지 않은 오류가 발생합니다.

C:\SysInternals> livekd

LiveKd v5.62 - Execute kd/windbg on a live system
Sysinternals - www.sysinternals.com
Copyright (C) 2000-2016 Mark Russinovich and Ken Johnson

Symbols are not configured. Would you like LiveKd to set the _NT_SYMBOL_PATH
directory to reference the Microsoft symbol server so that symbols can be
obtained automatically? (y/n) y

Enter the folder to which symbols download (default is c:\symbols): c:\symbols

Could not resolve symbols for ntoskrnl.exe:
MmPfnDatabase

Ensure that your symbol path is correctly configured, either via the -y option
or the _NT_SYMBOL_PATH environmental variable.  Symbols are required in order
to initiate a debugging session.

The -vsym command line option will display additional details that may be used
to track down symbol resolution or symbol load issues.

The specified module could not be found.

Exiting LiveKd.

오류 메시지에 따라 "-vsym" 옵션을 주면 ntkrnlmp.pdb를 찾지 못하는 상태를 보여주는데,

C:\SysInternals> livekd -vsym

LiveKd v5.63 - Execute kd/windbg on a live system
Sysinternals - www.sysinternals.com
Copyright (C) 2000-2020 Mark Russinovich and Ken Johnson

SYMSRV:  BYINDEX: 0x1
         c:\symbols
         ntkrnlmp.pdb
         1C9875F76C8F0FBF3EB9A9D7C1C274061

SYMSRV:  UNC: c:\symbols\ntkrnlmp.pdb\1C9875F76C8F0FBF3EB9A9D7C1C274061\ntkrnlmp.pdb - path not found

SYMSRV:  UNC: c:\symbols\ntkrnlmp.pdb\1C9875F76C8F0FBF3EB9A9D7C1C274061\ntkrnlmp.pd_ - path not found

SYMSRV:  UNC: c:\symbols\ntkrnlmp.pdb\1C9875F76C8F0FBF3EB9A9D7C1C274061\file.ptr - path not found

SYMSRV:  RESULT: 0x80070003

DBGHELP: *http://msdl.microsoft.com/download/symbols\ntkrnlmp.pdb - file not found

DBGHELP: *http://msdl.microsoft.com/download/symbols\exe\ntkrnlmp.pdb - file not found

DBGHELP: *http://msdl.microsoft.com/download/symbols\symbols\exe\ntkrnlmp.pdb - file not found

DBGHELP: ntkrnlmp.pdb - file not found

DBGHELP: ntoskrnl - export symbols

...[생략]...

좀 이해가 안 됩니다. 중간의 "c:\symbols"로부터 캐시된 pdb 파일을 찾는 것에는 정상적으로 1C9875F76C8F0FBF3EB9A9D7C1C274061와 같은 signature+age 경로가 있는데 원격지(msdl.microsoft.com)로부터 다운로드할 때는 signature+age를 붙이지 않고 있습니다. (참고: PDB 기호 파일의 경로 구성 방식)

어쨌든, livekd가 그걸 하지 못하고 있으니 오류가 발생한 pdb에 대해서는 symchk.exe를 이용해 명시적으로 다운로드를 해야 합니다.

C:\SysInternals> symchk -v C:\Windows\System32\ntoskrnl.exe /s srv*c:\Symbols*http://msdl.microsoft.com/download/symbols
[SYMCHK] Searching for symbols to C:\Windows\System32\ntoskrnl.exe in path srv*c:\Symbols*http://msdl.microsoft.com/download/symbols
DBGHELP: Symbol Search Path: srv*c:\Symbols*http://msdl.microsoft.com/download/symbols
[SYMCHK] Using search path "srv*c:\Symbols*http://msdl.microsoft.com/download/symbols"
DBGHELP: No header for C:\Windows\System32\ntoskrnl.exe.  Searching for image on disk
DBGHELP: C:\Windows\System32\ntoskrnl.exe - OK
SYMSRV:  BYINDEX: 0x1
         c:\Symbols*http://msdl.microsoft.com/download/symbols
         ntkrnlmp.pdb
         1C9875F76C8F0FBF3EB9A9D7C1C274061
SYMSRV:  UNC: c:\Symbols\ntkrnlmp.pdb\1C9875F76C8F0FBF3EB9A9D7C1C274061\ntkrnlmp.pdb - path not found
SYMSRV:  UNC: c:\Symbols\ntkrnlmp.pdb\1C9875F76C8F0FBF3EB9A9D7C1C274061\ntkrnlmp.pd_ - path not found
SYMSRV:  UNC: c:\Symbols\ntkrnlmp.pdb\1C9875F76C8F0FBF3EB9A9D7C1C274061\file.ptr - path not found
SYMSRV:  HTTPGET: /download/symbols/index2.txt
SYMSRV:  HttpQueryInfo: 80190190 - HTTP_STATUS_BAD_REQUEST
SYMSRV:  HTTPGET: /download/symbols/ntkrnlmp.pdb/1C9875F76C8F0FBF3EB9A9D7C1C274061/ntkrnlmp.pdb
SYMSRV:  HttpQueryInfo: 801900c8 - HTTP_STATUS_OK
SYMSRV:  ntkrnlmp.pdb from http://msdl.microsoft.com/download/symbols: 8596480 bytes -    copied
SYMSRV:  PATH: c:\Symbols\ntkrnlmp.pdb\1C9875F76C8F0FBF3EB9A9D7C1C274061\ntkrnlmp.pdb
SYMSRV:  RESULT: 0x00000000
DBGHELP: ntoskrnl - public symbols
        c:\Symbols\ntkrnlmp.pdb\1C9875F76C8F0FBF3EB9A9D7C1C274061\ntkrnlmp.pdb
[SYMCHK] MODULE64 Info ----------------------
[SYMCHK] Struct size: 1680 bytes
[SYMCHK] Base: 0x140000000
[SYMCHK] Image size: 17063936 bytes
[SYMCHK] Date: 0x07503e39
[SYMCHK] Checksum: 0x00a7ae11
[SYMCHK] NumSyms: 0
[SYMCHK] SymType: SymPDB
[SYMCHK] ModName: ntoskrnl
[SYMCHK] ImageName: C:\Windows\System32\ntoskrnl.exe
[SYMCHK] LoadedImage: C:\Windows\System32\ntoskrnl.exe
[SYMCHK] PDB: "c:\Symbols\ntkrnlmp.pdb\1C9875F76C8F0FBF3EB9A9D7C1C274061\ntkrnlmp.pdb"
[SYMCHK] CV: RSDS
[SYMCHK] CV DWORD: 0x53445352
[SYMCHK] CV Data:  ntkrnlmp.pdb
[SYMCHK] PDB Sig:  0
[SYMCHK] PDB7 Sig: {1C9875F7-6C8F-0FBF-3EB9-A9D7C1C27406}
[SYMCHK] Age: 1
[SYMCHK] PDB Matched:  TRUE
[SYMCHK] DBG Matched:  TRUE
[SYMCHK] Line nubmers: FALSE
[SYMCHK] Global syms:  FALSE
[SYMCHK] Type Info:    TRUE
[SYMCHK] ------------------------------------
SymbolCheckVersion  0x00000002
Result              0x00130001
DbgFilename
DbgTimeDateStamp    0x07503e39
DbgSizeOfImage      0x01046000
DbgChecksum         0x00a7ae11
PdbFilename         c:\Symbols\ntkrnlmp.pdb\1C9875F76C8F0FBF3EB9A9D7C1C274061\ntkrnlmp.pdb
PdbSignature        {00000000-0000-0000-0000-000000000000}
PdbDbiAge           0x00000000
[SYMCHK] [ 0x00000000 - 0x00130001 ] Checked "C:\Windows\System32\ntoskrnl.exe"

SYMCHK: FAILED files = 0
SYMCHK: PASSED + IGNORED files = 1

이후, 다시 livekd를 실행하면 ^^ 잘 동작하는 것을 확인할 수 있습니다.

C:\SysInternals> livekd

LiveKd v5.63 - Execute kd/windbg on a live system
Sysinternals - www.sysinternals.com
Copyright (C) 2000-2020 Mark Russinovich and Ken Johnson

Launching C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\kd.exe:

Microsoft (R) Windows Debugger Version 10.0.19041.1 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.


Loading Dump File [C:\WINDOWS\livekd.dmp]
Kernel Complete Dump File: Full address space is available

Comment: 'LiveKD live system view'

************* Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       srv*c:\symbols
*http://msdl.microsoft.com/download/symbols
Symbol search path is: srv*c:\symbols
*http://msdl.microsoft.com/download/symbols
Executable search path is:
Windows 8 Kernel Version 9200 MP (4 procs) Free x64
Product: WinNt, suite: TerminalServer SingleUserTS
Built by: 19041.1.amd64fre.vb_release.191206-1406
Machine Name:
Kernel base = 0xfffff802`4f600000 PsLoadedModuleList = 0xfffff802`5022a2f0
Debug session time: Wed Aug 26 11:27:55.035 2020 (UTC + 9:00)
System Uptime: 2 days 11:42:44.572
Loading Kernel Symbols
...............................................................
................................................................
................................................................
.........................
Loading User Symbols
..................................
Loading unloaded module list
................................
For analysis of this file, run !analyze -v

0: kd> !process
PROCESS ffffa9028cbb0080
    SessionId: 1  Cid: 5380    Peb: 454c98000  ParentCid: 8930
    DirBase: 31098002  ObjectTable: ffff83898d947880  HandleCount: 133.
    Image: kd.exe
    VadRoot ffffa90299012660 Vads 91 Clone 0 Private 6618. Modified 19. Locked 6.
    DeviceMap ffff8389521421c0
    Token                             ffff838969e295f0
    ElapsedTime                       00:00:00.917
    UserTime                          00:00:00.000
    KernelTime                        00:00:00.000
    QuotaPoolUsage[PagedPool]         134928
    QuotaPoolUsage[NonPagedPool]      12928
    Working Set Sizes (now,min,max)  (9146, 50, 345) (36584KB, 200KB, 1380KB)
    PeakWorkingSetSize                9060
    VirtualSize                       2101383 Mb
    PeakVirtualSize                   2101383 Mb
    PageFaultCount                    18354
    MemoryPriority                    BACKGROUND
    BasePriority                      8
    CommitCharge                      6872

        THREAD ffffa9029f1f2080  Cid 5380.701c  Teb: 0000000454c99000 Win32Thread: ffffa902a4edb380 RUNNING on processor 1
        THREAD ffffa9028c887080  Cid 4824.4444  Teb: 0000000000000000 Win32Thread: 0000000000000000 TERMINATED
        THREAD ffffa9028dcc72c0  Cid 7f1c.9a1c  Teb: 0000000000000000 Win32Thread: 0000000000000000 TERMINATED
        THREAD ffffa902ad9a3080  Cid 4c24.5918  Teb: 0000000000000000 Win32Thread: 0000000000000000 TERMINATED
        THREAD ffffa9029fff5080  Cid 4c24.5c04  Teb: 0000000000000000 Win32Thread: 0000000000000000 TERMINATED
        THREAD ffffa902b5715080  Cid 4c24.7af8  Teb: 0000000000000000 Win32Thread: 0000000000000000 TERMINATED
        THREAD ffffa9029d6df080  Cid 4c24.39ac  Teb: 00000000004fb000 Win32Thread: 0000000000000000 WAIT: (WrQueue) UserMode Non-Alertable
            ffffa90292a3fe40  QueueObject

        THREAD ffffa9029218c080  Cid 4c24.90a4  Teb: 00000000005f4000 Win32Thread: 0000000000000000 WAIT: (WrQueue) UserMode Non-Alertable
            ffffa90292a3fe40  QueueObject

        THREAD ffffa90289949080  Cid 4c24.86d4  Teb: 0000000000493000 Win32Thread: 0000000000000000 WAIT: (WrQueue) UserMode Non-Alertable
            ffffa90292a3fe40  QueueObject

        THREAD ffffa9028c7ed080  Cid 4c24.8e4c  Teb: 00000000004bd000 Win32Thread: 0000000000000000 WAIT: (WrQueue) UserMode Non-Alertable
            ffffa90292a40b40  QueueObject

TYPE mismatch for thread object at ffffa902988d9db8




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]


donaricano-btn



[최초 등록일: ]
[최종 수정일: 8/28/2020

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 쓴 사람
 




... 16  17  [18]  19  20  21  22  23  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
12415정성태11/18/20201200.NET Framework: 971. UnmanagedCallersOnly 특성과 DNNE 사용파일 다운로드1
12414정성태11/18/20201304VC++: 138. x64 빌드에서 extern "C"가 아닌 경우 ___cdecl name mangling 적용 [4]파일 다운로드1
12413정성태11/17/20201440.NET Framework: 970. .NET 5 / .NET Core - UnmanagedCallersOnly 특성을 사용한 함수 내보내기파일 다운로드1
12412정성태11/16/20201721.NET Framework: 969. .NET Framework 및 .NET 5 - UnmanagedCallersOnly 특성 사용파일 다운로드1
12411정성태11/12/20201626오류 유형: 680. C# 9.0 - Error CS8889 The target runtime doesn't support extensible or runtime-environment default calling conventions.
12410정성태11/12/20201503디버깅 기술: 174. windbg - System.TypeLoadException 예외 분석 사례
12409정성태11/12/20201761.NET Framework: 968. C# 9.0의 Function pointer를 이용한 함수 주소 구하는 방법파일 다운로드1
12408정성태11/9/20204925도서: 시작하세요! C# 9.0 프로그래밍 [6]
12407정성태11/9/20201673.NET Framework: 967. "clr!JIT_DbgIsJustMyCode" 호출이 뭘까요?
12406정성태11/8/20202221.NET Framework: 966. C# 9.0 - (15) 최상위 문(Top-level statements) [2]파일 다운로드1
12405정성태11/8/20201717.NET Framework: 965. C# 9.0 - (14) 부분 메서드에 대한 새로운 기능(New features for partial methods)파일 다운로드1
12404정성태11/7/20201747.NET Framework: 964. C# 9.0 - (13) 모듈 이니셜라이저(Module initializers)파일 다운로드1
12403정성태11/7/20201788.NET Framework: 963. C# 9.0 - (12) foreach 루프에 대한 GetEnumerator 확장 메서드 지원(Extension GetEnumerator)파일 다운로드1
12402정성태11/7/20202147.NET Framework: 962. C# 9.0 - (11) 공변 반환 형식(Covariant return types) [1]파일 다운로드1
12401정성태11/5/20201390VS.NET IDE: 153. 닷넷 응용 프로그램에서의 "My Code" 범위와 "Enable Just My Code"의 역할
12400정성태11/5/20201257오류 유형: 679. Visual Studio - "Source Not Found" 창에 "Decompile source code" 링크가 없는 경우
12399정성태11/5/20201695.NET Framework: 961. C# 9.0 - (10) 대상으로 형식화된 조건식(Target-typed conditional expressions)파일 다운로드1
12398정성태11/4/20201427오류 유형: 678. Windows Server 2008 R2 환경에서 Powershell을 psexec로 원격 실행할 때 hang이 발생하는 문제
12397정성태11/4/20201446.NET Framework: 960. C# - 조건 연산자(?:)를 사용하는 경우 달라지는 메서드 선택 사례파일 다운로드1
12396정성태11/3/20201356VS.NET IDE: 152. Visual Studio - "Tools" / "External Tools..."에 등록된 외부 명령어에 대한 단축키 설정 방법
12395정성태11/3/20201256오류 유형: 677. SSMS로 DB 접근 시 The server principal "..." is not able to access the database "..." under the current security context.
12394정성태11/3/20201128오류 유형: 676. cacls - The Recycle Bin on ... is corrupted. Do you want to empty the Recycle Bin for this drive?
12393정성태11/3/20201382오류 유형: 675. Visual Studio - 닷넷 응용 프로그램 디버깅 시 Disassembly 창에서 BP 설정할 때 "Error while processing breakpoint." 오류
12392정성태11/2/20202290.NET Framework: 959. C# 9.0 - (9) 레코드(Records) [3]파일 다운로드1
12390정성태11/1/20201637디버깅 기술: 173. windbg - System.Configuration.ConfigurationErrorsException 예외 분석 방법
12389정성태11/1/20201759.NET Framework: 958. C# 9.0 - (8) 정적 익명 함수 (static anonymous functions)파일 다운로드1
... 16  17  [18]  19  20  21  22  23  24  25  26  27  28  29  30  ...