coding4fun
coding4fun

Reputation: 8189

Exception is thrown by SOS

I'm just getting started with windbg/sos and I created a simple console application for testing (that throws an unhandled exception). It seems like after I load sos I will get an exception on the very next call.

For example:

ntsd consoleapplication1.exe
.symfix
.reload
g
.loadby sos clr

if I call:

!threads
"c0000005 Exception in C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos.threads
      PC: 592b7713  VA: 00000000  R/W: 0  Parameter: 00000000"

if I call:

!ClrStack
c0000005 Exception in C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos.ClrStack
      PC: 592b7713  VA: 00000000  R/W: 0  Parameter: 00000000

Every call after my 1st call will work (it's only the first call that fails after loading SOS).

I tried this recommendation and recompiled my code with native code debugging enabled but it did not make a difference.

Version of windbg: 6.3.9600.16384 X86

Upvotes: 5

Views: 154

Answers (1)

Thomas Weller
Thomas Weller

Reputation: 59238

This seems to be a problem of WinDbg. I tried it with a .NET 4.0 console application, x86 target. I did not check the checkmark for Enable native code debugging, since I never did that before.

I can reproduce your problem in WinDbg (NTSD) 6.3.9600.16384 x86 with both debug build and release build.

For me it works with WinDbg (NTSD) 6.2.9200.16384 x86 with both debug build and release build.

Since I often have the problem of duplicate output in 6.3 anyway, I am still using version 6.2 as my default WinDbg version.

Upvotes: 3

Related Questions