Microsoft MVP성태의 닷넷 이야기
오류 유형: 722. windbg/sos - savemodule - Fail to read memory [링크 복사], [링크+제목 복사],
조회: 17672
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

windbg/sos - savemodule - Fail to read memory

윈도우가 기본 제공하는 메모리 덤프 기능은 닷넷 응용 프로그램을 디버깅하는 데는 좀 아쉬운 부분이 있습니다. 실제로 그런 경우 sos.dll이 로드되면서 몇몇 명령어가 동작하지 않을 것이라는 메시지를 보게 됩니다.

0:000>  .cordll -ve -u -l
CLRDLL: Unable to get version info for 'e:\symbols\clr.dll\5B175F449a0000\mscordacwks.dll', Win32 error 0n87
CLRDLL: Loaded DLL e:\symbols\mscordacwks_AMD64_AMD64_4.0.30319.36450.dll\5B175F449a0000\mscordacwks_AMD64_AMD64_4.0.30319.36450.dll
----------------------------------------------------------------------------
The user dump currently examined is a minidump. Consequently, only a subset
of sos.dll functionality will be available. If needed, attaching to the live
process or debugging a full dump will allow access to sos.dll's full feature
set.
To create a full user dump use the command: .dump /ma <filename>
----------------------------------------------------------------------------
Automatically loaded SOS Extension
CLR DLL status: Loaded DLL e:\symbols\mscordacwks_AMD64_AMD64_4.0.30319.36450.dll\5B175F449a0000\mscordacwks_AMD64_AMD64_4.0.30319.36450.dll

단적인 예로, 대부분의 경우 윈도우가 제공하는 hdmp로부터는 savemodule 명령어가 실패하게 됩니다.

0:000> lm m Test*
Browse full module list
start             end                 module name
00000071`04510000 00000071`0454c000   Test_DLL   (deferred)             

0:000> !savemodule 00000071`04510000 F:\temp\Test.dll
3 sections in file
section 0 - VA=2000, VASize=35080, FileAddr=200, FileSize=35200
section 1 - VA=38000, VASize=430, FileAddr=35400, FileSize=600
section 2 - VA=3a000, VASize=c, FileAddr=35a00, FileSize=200
Fail to read memory

이외에도 PDB 파일이 없는 경우의 호출에 대해서는 함수 이름을 풀이하지 못하고 Unknown으로 보여주게 됩니다.

0:000> !clrstack
OS Thread Id: 0x16d8 (20)
        Child SP               IP Call Site
// ...[생략]...
00000072a0005440 00007eccc2c21cc3 Test_DLL.dll!Unknown
00000072a0005480 00007eccc2c21a28 Test_DLL.dll!Unknown
00000072a0005510 00007eccc288f00b Test_DLL.dll!Unknown
00000072a00055c0 00007eccc28a26fa Test_DLL.dll!Unknown
// ...[생략]...
00000072a000ee98 00007ecd2048a533 [GCFrame: 00000072a000ee98] 
00000072a000f068 00007ecd2048a533 [DebuggerU2MCatchHandlerFrame: 00000072a000f068] 

따라서, 위와 같은 제약이 있어 분석이 제대로 안 될 때는, 할 수 없이 procdump를 이용해 다시 덤프를 받아야 합니다.




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







[최초 등록일: ]
[최종 수정일: 9/26/2022]

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)
13864정성태1/15/20257979Linux: 114. eBPF를 위해 필요한 SELinux 보안 정책
13863정성태1/14/20255935Linux: 113. Linux - 프로세스를 위한 전용 SELinux 보안 문맥 지정
13862정성태1/13/20256940Linux: 112. Linux - 데몬을 위한 SELinux 보안 정책 설정
13861정성태1/11/20257350Windows: 276. 명령행에서 원격 서비스를 동기/비동기로 시작/중지
13860정성태1/10/20256496디버깅 기술: 216. WinDbg - 2가지 유형의 식 평가 방법(MASM, C++)
13859정성태1/9/20258018디버깅 기술: 215. Windbg - syscall 이후 실행되는 KiSystemCall64 함수 및 SSDT 디버깅
13858정성태1/8/20258371개발 환경 구성: 738. PowerShell - 원격 호출 시 "powershell.exe"가 아닌 "pwsh.exe" 환경으로 명령어를 실행하는 방법
13857정성태1/7/20258396C/C++: 187. Golang - 콘솔 응용 프로그램을 Linux 데몬 서비스를 지원하도록 변경파일 다운로드1
13856정성태1/6/20256319디버깅 기술: 214. Windbg - syscall 단계까지의 Win32 API 호출 (예: Sleep)
13855정성태12/28/20248863오류 유형: 941. Golang - os.StartProcess() 사용 시 오류 정리
13854정성태12/27/20248666C/C++: 186. Golang - 콘솔 응용 프로그램을 NT 서비스를 지원하도록 변경파일 다운로드1
13853정성태12/26/20246871디버깅 기술: 213. Windbg - swapgs 명령어와 (Ring 0 커널 모드의) FS, GS Segment 레지스터
13852정성태12/25/20249360디버깅 기술: 212. Windbg - (Ring 3 사용자 모드의) FS, GS Segment 레지스터파일 다운로드1
13851정성태12/23/20247224디버깅 기술: 211. Windbg - 커널 모드 디버깅 상태에서 사용자 프로그램을 디버깅하는 방법
13850정성태12/23/20249305오류 유형: 940. "Application Information" 서비스를 중지한 경우, "This file does not have an app associated with it for performing this action."
13849정성태12/20/20249234디버깅 기술: 210. Windbg - 논리(가상) 주소를 Segmentation을 거쳐 선형 주소로 변경
13848정성태12/18/20248286디버깅 기술: 209. Windbg로 알아보는 Prototype PTE파일 다운로드2
13847정성태12/18/20247861오류 유형: 939. golang - 빌드 시 "unknown directive: toolchain" 오류 빌드 시 이런 오류가 발생한다면?
13846정성태12/17/20249610디버깅 기술: 208. Windbg로 알아보는 Trans/Soft PTE와 2가지 Page Fault 유형파일 다운로드1
13845정성태12/16/20246836디버깅 기술: 207. Windbg로 알아보는 PTE (_MMPTE)
13844정성태12/14/202410132디버깅 기술: 206. Windbg로 알아보는 PFN (_MMPFN)파일 다운로드1
13843정성태12/13/20247414오류 유형: 938. Docker container 내에서 빌드 시 error MSB3021: Unable to copy file "..." to "...". Access to the path '...' is denied.
13842정성태12/12/20247778디버깅 기술: 205. Windbg - KPCR, KPRCB
13841정성태12/11/20248483오류 유형: 937. error MSB4044: The "ValidateValidArchitecture" task was not given a value for the required parameter "RemoteTarget"
13840정성태12/11/20247565오류 유형: 936. msbuild - Your project file doesn't list 'win' as a "RuntimeIdentifier"
13839정성태12/11/20249159오류 유형: 936. msbuild - error CS1617: Invalid option '12.0' for /langversion. Use '/langversion:?' to list supported values.
1  2  3  4  5  6  [7]  8  9  10  11  12  13  14  15  ...