Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

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




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

[연관 글]






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

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

비밀번호

댓글 작성자
 




1  2  3  4  5  6  7  8  9  10  11  [12]  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13534정성태1/21/20246180닷넷: 2207. C# - SQL Server DB를 bacpac으로 Export/Import파일 다운로드1
13533정성태1/18/20246409닷넷: 2206. C# - TCP KeepAlive의 서버 측 구현파일 다운로드1
13532정성태1/17/20246193닷넷: 2205. C# - SuperSimpleTcp 사용 시 주의할 점파일 다운로드1
13531정성태1/16/20246431닷넷: 2204. C# - TCP KeepAlive에 새로 추가된 Retry 옵션파일 다운로드1
13530정성태1/15/20245591닷넷: 2203. C# - Python과의 AES 암호화 연동파일 다운로드1
13529정성태1/15/20245596닷넷: 2202. C# - PublishAot의 glibc에 대한 정적 링킹하는 방법
13528정성태1/14/20245880Linux: 68. busybox 컨테이너에서 실행 가능한 C++, Go 프로그램 빌드
13527정성태1/14/20245850오류 유형: 892. Visual Studio - Failed to launch debug adapter. Additional information may be available in the output window.
13526정성태1/14/20245988닷넷: 2201. C# - Facebook 연동 / 사용자 탈퇴 처리 방법
13525정성태1/13/20245542오류 유형: 891. Visual Studio - Web Application을 실행하지 못하는 IISExpress
13524정성태1/12/20245749오류 유형: 890. 한국투자증권 KIS Developers OpenAPI - GW라우팅 중 오류가 발생했습니다.
13523정성태1/12/20245310오류 유형: 889. Visual Studio - error : A project with that name is already opened in the solution.
13522정성태1/11/20245959닷넷: 2200. C# - HttpClient.PostAsJsonAsync 호출 시 "Transfer-Encoding: chunked" 대신 "Content-Length" 헤더 처리
13521정성태1/11/20246191닷넷: 2199. C# - 한국투자증권 KIS Developers OpenAPI의 WebSocket Ping, Pong 처리
13520정성태1/10/20245954오류 유형: 888. C# - Unable to resolve service for type 'Microsoft.Extensions.ObjectPool.ObjectPool`....' [1]
13519정성태1/10/20245431닷넷: 2198. C# - Reflection을 이용한 ClientWebSocket의 Ping 호출파일 다운로드1
13518정성태1/9/20245815닷넷: 2197. C# - ClientWebSocket의 Ping, Pong 처리
13517정성태1/8/20245613스크립트: 63. Python - 공개 패키지를 이용한 위성 이미지 생성 (pystac_client, odc.stac)
13516정성태1/7/20245518닷넷: 2196. IIS - AppPool의 "Disable Overlapped Recycle" 옵션의 부작용
13515정성태1/6/20246187닷넷: 2195. async 메서드 내에서 C# 7의 discard 구문 활용 사례 [1]
13514정성태1/5/20245823개발 환경 구성: 702. IIS - AppPool의 "Disable Overlapped Recycle" 옵션
13513정성태1/5/20245734닷넷: 2194. C# - WebActivatorEx / System.Web의 PreApplicationStartMethod 특성
13512정성태1/4/20245727개발 환경 구성: 701. IIS - w3wp.exe 프로세스의 ASP.NET 런타임을 항상 Warmup 모드로 유지하는 preload Enabled 설정
13511정성태1/4/20245713닷넷: 2193. C# - ASP.NET Web Application + OpenAPI(Swashbuckle) 스펙 제공
13510정성태1/3/20245325닷넷: 2192. C# - 특정 실행 파일이 있는지 확인하는 방법 (Linux)
13509정성태1/3/20246320오류 유형: 887. .NET Core 2 이하의 프로젝트에서 System.Runtime.CompilerServices.Unsafe doesn't support netcoreapp2.0.
1  2  3  4  5  6  7  8  9  10  11  [12]  13  14  15  ...