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

Windbg - The version of SOS does not match the version of CLR you are debugging.

.NET을 호스팅하고 있는 Windows Server 2008 R2의 w3wp.exe에 대해 덤프를 뜨고 예의 ".loadby sos clr" 명령어로 SOS 확장 DLL을 로드했습니다.

그리곤 clrstack 명령어를 실행하는데 다음과 같이 오류가 발생했습니다.

0:000> !clrstack
The version of SOS does not match the version of CLR you are debugging.  Please
load the matching version of SOS for the version of CLR you are debugging.
CLR Version: 4.0.30319.296
SOS Version: 4.0.30319.18010
Failed to load data access DLL, 0x80004005
Verify that 1) you have a recent build of the debugger (6.2.14 or newer)
            2) the file mscordacwks.dll that matches your version of clr.dll is 
                in the version directory or on the symbol path
            3) or, if you are debugging a dump file, verify that the file 
                mscordacwks_<arch>_<arch>_<version>.dll is on your symbol path.
            4) you are debugging on supported cross platform architecture as 
                the dump file. For example, an ARM dump file must be debugged
                on an X86 or an ARM machine; an AMD64 dump file must be
                debugged on an AMD64 machine.

You can also run the debugger command .cordll to control the debugger's
load of mscordacwks.dll.  .cordll -ve -u -l will do a verbose reload.
If that succeeds, the SOS command should work on retry.

If you are debugging a minidump, you need to make sure that your executable
path is pointing to clr.dll as well.

덤프를 뜬 대상 컴퓨터에 설치된 CLR 버전이 windbg를 실행한 컴퓨터의 sos 버전보다 더 높았던 것입니다. 이 문제를 해결하려면 덤프를 생성했던 그 컴퓨터의 sos.dll 을 덤프를 분석하는 windbg가 실행되는 컴퓨터로 복사해 와야 합니다.

제 경우에는 .NET 4.0 64비트였기 때문에 대상 컴퓨터에서 "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll" 파일을 로컬의 c:\temp 폴더에 복사해 왔습니다.

자, 이제 잘못 로드된 sos.dll 을 windbg에서 언로드 시키고,

0:000> .unload
Unloading C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sos extension DLL

.chain 명령어로 확인해 보면 sos.dll 이 없어진 것을 볼 수 있습니다.

0:000> .chain
Extension DLL search Path:
    C:\...[생략]...
Extension DLL chain:
    dbghelp: image 6.2.9200.20512, API 6.2.6, built Fri Sep 07 14:45:49 2012
        [path: C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\dbghelp.dll]
    ext: image 6.2.9200.20522, API 1.0.0, built Fri Sep 21 17:17:05 2012
        [path: C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\winext\ext.dll]
    exts: image 6.2.9200.16384, API 1.0.0, built Thu Jul 26 11:15:20 2012
        [path: C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\WINXP\exts.dll]
    uext: image 6.2.9200.16384, API 1.0.0, built Thu Jul 26 11:15:09 2012
        [path: C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\winext\uext.dll]
    ntsdexts: image 6.2.9200.16384, API 1.0.0, built Thu Jul 26 11:16:01 2012
        [path: C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\WINXP\ntsdexts.dll]

이제 새롭게 복사해 온 sos.dll을 로드합니다.

0:000> .load c:\temp\sos.dll

0:000> .chain
Extension DLL search Path:
    C:\...[생략]...
Extension DLL chain:
    c:\temp\sos.dll: image 4.0.30319.296, API 1.0.0, built Thu Sep 06 15:07:11 2012
        [path: c:\temp\sos.dll]
    dbghelp: image 6.2.9200.20512, API 6.2.6, built Fri Sep 07 14:45:49 2012
        [path: C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\dbghelp.dll]
    ext: image 6.2.9200.20522, API 1.0.0, built Fri Sep 21 17:17:05 2012
        [path: C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\winext\ext.dll]
    exts: image 6.2.9200.16384, API 1.0.0, built Thu Jul 26 11:15:20 2012
        [path: C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\WINXP\exts.dll]
    uext: image 6.2.9200.16384, API 1.0.0, built Thu Jul 26 11:15:09 2012
        [path: C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\winext\uext.dll]
    ntsdexts: image 6.2.9200.16384, API 1.0.0, built Thu Jul 26 11:16:01 2012
        [path: C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\WINXP\ntsdexts.dll]

지금부터는 ^^ 마음껏 sos 확장 명령어를 사용하시면 됩니다.

0:000> !clrstack
...[생략]...

0:002> !threads
ThreadCount:      20
UnstartedThread:  0
BackgroundThread: 20
PendingThread:    0
DeadThread:       0
Hosted Runtime:   no
                                           PreEmptive                                                   Lock
       ID  OSID        ThreadOBJ     State GC       GC Alloc Context                  Domain           Count APT Exception
   7    1   61c 0000000002530e20      8220 Enabled  0000000000000000:0000000000000000 000000000143e080     0 Ukn
  18    2   edc 000000000253f910      b220 Enabled  0000000000000000:0000000000000000 000000000143e080     0 MTA (Finalizer)
  20    3  1880 0000000004eaf2d0   100a220 Enabled  0000000000000000:0000000000000000 000000000143e080     0 MTA (Threadpool Worker)
  21    4   b94 0000000005e45da0      1220 Enabled  0000000000000000:0000000000000000 000000000143e080     0 Ukn
  24    9   5fc 0000000006a2a890       220 Enabled  000000017fad7d50:000000017fad8880 000000000989f8c0     1 STA
  35    b   e6c 0000000005d29f60   1000220 Enabled  0000000000000000:0000000000000000 000000000143e080     0 Ukn (Threadpool Worker)
  11   10  11a8 00000000098b32e0   8008220 Enabled  0000000000000000:0000000000000000 000000000143e080     0 MTA (Threadpool Completion Port)
   2   12  132c 00000000099e3020       220 Enabled  00000000ff563ca0:00000000ff565c40 000000000143e080     0 Ukn
  37    f  1be4 00000000099e5370   200b220 Enabled  0000000000000000:0000000000000000 000000000989f8c0     0 MTA
  38   16  1138 0000000007027800   200b220 Enabled  00000001bfc4a690:00000001bfc4c1a0 000000000989f8c0     0 MTA
  25   18  187c 0000000007028620       220 Enabled  0000000000000000:0000000000000000 000000000143e080     0 STA
  39   17  1b2c 0000000007027f10   200b220 Enabled  0000000000000000:0000000000000000 000000000989f8c0     0 MTA
  40    d  15a8 00000000099e3e40   1009220 Enabled  00000000ff55de10:00000000ff55fc40 000000000143e080     0 MTA (Threadpool Worker)
  41   14  19cc 0000000007028d30   1009220 Enabled  000000013ff84678:000000013ff84690 000000000143e080     0 MTA (Threadpool Worker)
  26   11  1194 00000000099e2200       220 Enabled  0000000000000000:0000000000000000 000000000143e080     0 STA
  42   13   a50 00000000099e3730   1009220 Enabled  00000000ff565ec0:00000000ff567c40 000000000143e080     0 MTA (Threadpool Worker)
  43    5   e18 00000000070270f0   1009220 Enabled  00000000ff55fd78:00000000ff561c40 000000000143e080     0 MTA (Threadpool Worker)
  44    e  150c 0000000007029b50   200b220 Enabled  00000000ff569e68:00000000ff56bc40 000000000989f8c0     1 MTA
  46    a   a78 0000000007029440   1009220 Enabled  00000000ff567dd0:00000000ff569c40 000000000143e080     0 MTA (Threadpool Worker)
  45    c  1a7c 00000000099e2910       220 Enabled  00000000ff561d88:00000000ff563c40 000000000143e080     0 Ukn

0:002> !eestack
---------------------------------------------
Thread   7
Current frame: ntdll!ZwRemoveIoCompletion+0xa
Child-SP         RetAddr          Caller, Callee
0000000001fffaf0 000007fefdd516ad KERNELBASE!GetQueuedCompletionStatus+0x39, calling ntdll!ZwRemoveIoCompletion
...[생략]...
0000000001fffc70 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  18
Current frame: ntdll!NtWaitForMultipleObjects+0xa
Child-SP         RetAddr          Caller, Callee
00000000043af560 000007fefdd51430 KERNELBASE!WaitForMultipleObjectsEx+0xe8, calling ntdll!NtWaitForMultipleObjects
...[생략]...
00000000043afac0 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  20
Current frame: ntdll!ZwDelayExecution+0xa
Child-SP         RetAddr          Caller, Callee
00000000062ff6c0 000007fefdd51203 KERNELBASE!SleepEx+0xab, calling ntdll!ZwDelayExecution
...[생략]...
00000000062ff860 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  21
Current frame: ntdll!NtWaitForSingleObject+0xa
Child-SP         RetAddr          Caller, Callee
00000000067af9a0 000007fefdd510dc KERNELBASE!WaitForSingleObjectEx+0x79, calling ntdll!NtWaitForSingleObject
...[생략]...
00000000067afe30 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  24
Current frame: ntdll!NtWaitForSingleObject+0xa
Child-SP         RetAddr          Caller, Callee
0000000007a9b0f0 000007fefd3b1e35 mswsock!_GSHandlerCheck_SEH+0x4279, calling ntdll!NtWaitForSingleObject
...[생략]...
0000000007a9f7f0 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  35
Current frame: ntdll!ZwDelayExecution+0xa
Child-SP         RetAddr          Caller, Callee
000000000a96f880 000007fefdd51203 KERNELBASE!SleepEx+0xab, calling ntdll!ZwDelayExecution
...[생략]...
000000000a96f9c0 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  11
Current frame: ntdll!ZwRemoveIoCompletion+0xa
Child-SP         RetAddr          Caller, Callee
00000000027dfcd0 000007fefdd516ad KERNELBASE!GetQueuedCompletionStatus+0x39, calling ntdll!ZwRemoveIoCompletion
...[생략]...
00000000027dff10 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread   2
Current frame: ntdll!ZwWaitForWorkViaWorkerFactory+0xa
Child-SP         RetAddr          Caller, Callee
00000000009af500 0000000077c4fe0b ntdll!TppWorkerThread+0x2c9, calling ntdll!ZwWaitForWorkViaWorkerFactory
...[생략]...
00000000009af830 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  37
Current frame: ntdll!NtWaitForMultipleObjects+0xa
Child-SP         RetAddr          Caller, Callee
000000000a8ee260 000007fefdd51430 KERNELBASE!WaitForMultipleObjectsEx+0xe8, calling ntdll!NtWaitForMultipleObjects
...[생략]...
000000000a8efca0 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  38
Current frame: ntdll!NtWaitForMultipleObjects+0xa
Child-SP         RetAddr          Caller, Callee
000000000abee470 000007fefdd51430 KERNELBASE!WaitForMultipleObjectsEx+0xe8, calling ntdll!NtWaitForMultipleObjects
...[생략]...
000000000abefaa0 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  25
Current frame: ntdll!NtWaitForMultipleObjects+0xa
Child-SP         RetAddr          Caller, Callee
00000000084bf650 000007fefdd51430 KERNELBASE!WaitForMultipleObjectsEx+0xe8, calling ntdll!NtWaitForMultipleObjects
...[생략]...
00000000084bfaa0 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  39
Current frame: ntdll!ZwDelayExecution+0xa
Child-SP         RetAddr          Caller, Callee
000000000aecea80 000007fefdd51203 KERNELBASE!SleepEx+0xab, calling ntdll!ZwDelayExecution
...[생략]...
000000000aecfea0 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  40
Current frame: ntdll!NtWaitForSingleObject+0xa
Child-SP         RetAddr          Caller, Callee
000000000b35f080 000007fefdd510dc KERNELBASE!WaitForSingleObjectEx+0x79, calling ntdll!NtWaitForSingleObject
...[생략]...
000000000b35fbd0 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  41
Current frame: ntdll!NtWaitForSingleObject+0xa
Child-SP         RetAddr          Caller, Callee
000000000c23ec40 000007fefdd510dc KERNELBASE!WaitForSingleObjectEx+0x79, calling ntdll!NtWaitForSingleObject
...[생략]...
000000000c23fc10 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  26
Current frame: ntdll!NtWaitForMultipleObjects+0xa
Child-SP         RetAddr          Caller, Callee
0000000007c5f770 000007fefdd51430 KERNELBASE!WaitForMultipleObjectsEx+0xe8, calling ntdll!NtWaitForMultipleObjects
...[생략]...
0000000007c5fbc0 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  42
Current frame: ntdll!NtWaitForSingleObject+0xa
Child-SP         RetAddr          Caller, Callee
000000000adaec20 000007fefdd510dc KERNELBASE!WaitForSingleObjectEx+0x79, calling ntdll!NtWaitForSingleObject
...[생략]...
000000000adafe70 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  43
Current frame: ntdll!NtWaitForSingleObject+0xa
Child-SP         RetAddr          Caller, Callee
000000000a9feac0 000007fefdd510dc KERNELBASE!WaitForSingleObjectEx+0x79, calling ntdll!NtWaitForSingleObject
...[생략]...
000000000a9ffd90 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  44
Current frame: ntdll!NtWaitForMultipleObjects+0xa
Child-SP         RetAddr          Caller, Callee
000000000acadca0 000007fefdd51430 KERNELBASE!WaitForMultipleObjectsEx+0xe8, calling ntdll!NtWaitForMultipleObjects
...[생략]...
000000000acafb30 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  46
Current frame: ntdll!NtWaitForSingleObject+0xa
Child-SP         RetAddr          Caller, Callee
0000000008daf940 000007fefdd510dc KERNELBASE!WaitForSingleObjectEx+0x79, calling ntdll!NtWaitForSingleObject
...[생략]...
0000000008dafd10 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d
---------------------------------------------
Thread  45
Current frame: ntdll!ZwWaitForWorkViaWorkerFactory+0xa
Child-SP         RetAddr          Caller, Callee
000000000c0ef7d0 0000000077c4fe0b ntdll!TppWorkerThread+0x2c9, calling ntdll!ZwWaitForWorkViaWorkerFactory
000000000c0efad0 0000000077a2652d kernel32!BaseThreadInitThunk+0xd
000000000c0efb00 0000000077c5c521 ntdll!RtlUserThreadStart+0x1d




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







[최초 등록일: ]
[최종 수정일: 12/12/2012]

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)
13489정성태12/19/20232178개발 환경 구성: 697. GoLand에서 ldflags 지정 방법
13488정성태12/18/20232113오류 유형: 884. HTTP 500.0 - 명령행에서 실행한 ASP.NET Core 응용 프로그램을 실행하는 방법
13487정성태12/16/20232416개발 환경 구성: 696. C# - 리눅스용 AOT 빌드를 docker에서 수행 [1]
13486정성태12/15/20232231개발 환경 구성: 695. Nuget config 파일에 값 설정/삭제 방법
13485정성태12/15/20232121오류 유형: 883. dotnet build/restore - error : Root element is missing
13484정성태12/14/20232201개발 환경 구성: 694. Windows 디렉터리 경로를 WSL의 /mnt 포맷으로 구하는 방법
13483정성태12/14/20232335닷넷: 2184. C# - 하나의 resource 파일을 여러 프로그램에서 (AOT 시에도) 사용하는 방법파일 다운로드1
13482정성태12/13/20233007닷넷: 2183. C# - eFriend Expert OCX 예제를 .NET Core/5+ Console App에서 사용하는 방법 [2]파일 다운로드1
13481정성태12/13/20232312개발 환경 구성: 693. msbuild - .NET Core/5+ 프로젝트에서 resgen을 이용한 리소스 파일 생성 방법파일 다운로드1
13480정성태12/12/20232708개발 환경 구성: 692. Windows WSL 2 + Chrome 웹 브라우저 설치
13479정성태12/11/20232374개발 환경 구성: 691. WSL 2 (Ubuntu) + nginx 환경 설정
13477정성태12/8/20232626닷넷: 2182. C# - .NET 7부터 추가된 Int128, UInt128 [1]파일 다운로드1
13476정성태12/8/20232316닷넷: 2181. C# - .NET 8 JsonStringEnumConverter의 AOT를 위한 개선파일 다운로드1
13475정성태12/7/20232413닷넷: 2180. .NET 8 - 함수 포인터에 대한 Reflection 정보 조회파일 다운로드1
13474정성태12/6/20232228개발 환경 구성: 690. 닷넷 코어/5+ 버전의 ilasm/ildasm 실행 파일 구하는 방법 - 두 번째 이야기
13473정성태12/5/20232504닷넷: 2179. C# - 값 형식(Blittable)을 메모리 복사를 이용해 바이트 배열로 직렬화/역직렬화파일 다운로드1
13472정성태12/4/20232251C/C++: 164. Visual C++ - InterlockedCompareExchange128 사용 방법
13471정성태12/4/20232356Copilot - To enable GitHub Copilot, authorize this extension using GitHub's device flow
13470정성태12/2/20232684닷넷: 2178. C# - .NET 8부터 COM Interop에 대한 자동 소스 코드 생성 도입파일 다운로드1
13469정성태12/1/20232446닷넷: 2177. C# - (Interop DLL 없이) CoClass를 이용한 COM 개체 생성 방법파일 다운로드1
13468정성태12/1/20232339닷넷: 2176. C# - .NET Core/5+부터 달라진 RCW(Runtime Callable Wrapper) 대응 방식파일 다운로드1
13467정성태11/30/20232442오류 유형: 882. C# - Unhandled exception. System.Runtime.InteropServices.COMException (0x800080A5)파일 다운로드1
13466정성태11/29/20232614닷넷: 2175. C# - DllImport 메서드의 AOT 지원을 위한 LibraryImport 옵션
13465정성태11/28/20232356개발 환경 구성: 689. MSBuild - CopyToOutputDirectory가 "dotnet publish" 시에는 적용되지 않는 문제파일 다운로드1
13464정성태11/28/20232493닷넷: 2174. C# - .NET 7부터 UnmanagedCallersOnly 함수 export 기능을 AOT 빌드에 통합파일 다운로드1
13463정성태11/27/20232402오류 유형: 881. Visual Studio - NU1605: Warning As Error: Detected package downgrade
1  2  3  4  5  [6]  7  8  9  10  11  12  13  14  15  ...