Questions tagged [sos]

SOS is a debugger extension that allows a developer to inspect the managed state of a .NET Core and desktop runtime process. SOS can be loaded by WinDbg/cdb debuggers on Windows and lldb on Linux and macOS.

SOS (Son of Strike) is a debugger extension that allows a developer to inspect the managed state of a .NET Core and desktop runtime process. SOS can be loaded by WinDbg/cdb debuggers on Windows and lldb on Linux and macOS.

Useful links:

344 questions
6
votes
3 answers

Determine line number of InnerException from minidump using WinDbg

I'm trying to track down a NullReferenceException from a dump. The NullReferenceException is not the crashing exception, rather the crashing exception is a TargetInvocationException with an InnerException which is the NullReferenceException. I'm…
Matt Smith
  • 17,026
  • 7
  • 53
  • 103
6
votes
2 answers

Can I set a breakpoint at a source code of managed application when I use WinDbg?

I tried to set a breakpoint using WinDbg at a source code of a c# application, but it didn’t work. Is there a way to set a breakpoint at a source code of managed application when I use WinDbg? Repro step is the below: 1.Make a simple c#…
boby
  • 85
  • 3
6
votes
1 answer

in windbg how to save byte array to the file

before i had see this question and answer: Use WinDbg to Write Contents of Managed Byte[] to File,but i have a question that the mention answer that write all bytes to the file( Method table pointer,array length and the array content),i want just…
zhengchun
  • 1,261
  • 13
  • 19
5
votes
2 answers

Get the .NET framework version from a process dump

Possible Duplicate: How can I know the CLR version of a crash dump? If I open a dump file (of a managed process) in WinDbg, is there anyway of finding which version of .NET framework that process was using?
imak
  • 6,489
  • 7
  • 50
  • 73
5
votes
1 answer

Windbg native call stack trace does not make sense

I have a simple test program causing an infinite wait on lock. public class SyncBlock { } class Program { public static SyncBlock sync = new SyncBlock(); private static void ThreadProc() { try { …
imak
  • 6,489
  • 7
  • 50
  • 73
5
votes
3 answers

.loadby sos clr - specified module could not be found

I am trying to get to the bottom of what the CLR exception that is in my dump file but I am having an issue trying to execute: 0:000> .loadby sos clr The call to LoadLibrary(C:\ProgramData\dbg\sym\clr.dll\5348A1EF9a0000\sos) failed, Win32 error…
Denis
  • 11,796
  • 16
  • 88
  • 150
5
votes
2 answers

windbg !gcroot
returns no roots

What does it mean if !gcroot returns an empty thread list? 0:000> !gcroot 0000000010817c50 Note: Roots found on stacks may be false positives. Run "!help gcroot" for more info. Scan Thread 2 OSTHread 15a4 Scan Thread 10 OSTHread 1db4 Scan Thread…
jgauffin
  • 99,844
  • 45
  • 235
  • 372
5
votes
1 answer

!DumpStackObjects displaying duplicate instances?

I have a small test program. When I look into stack object for main thread, its showing MyClass twice there. Any ideas why there are two object of MyClass on the stack? class Program { struct MyStruct { int x; int…
imak
  • 6,489
  • 7
  • 50
  • 73
5
votes
1 answer

Get list of object instances that are in LOH

I have several hundred instances of MyClass present in managed heap. Some of these are in large-object heap. Below is how various heap structure looks 0:000> !EEHeap -gc Number of GC Heaps: 1 generation 0 starts at 0x0000000002df9de8 generation 1…
paul deter
  • 857
  • 2
  • 7
  • 20
5
votes
1 answer

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…
coding4fun
  • 8,038
  • 13
  • 58
  • 85
5
votes
1 answer

Free objects ~50% of .NET heap. How to know what's causing OOM

I am trying to determine what's contributing to my application high memory usage. So I took process dump file. EEHeap command is showing about 2.8 GB in .NET memory heap. 0:000> !EEHeap -gc Number of GC Heaps: 2 ------------------------------ Heap 0…
crazy novice
  • 1,757
  • 3
  • 14
  • 36
5
votes
1 answer

How to properly work with non-primitive ClrInstanceField values using ClrMD?

I've got some really large memory dumps of a managed process that I'm trying to get a lot of statistics from--as well as be able to present an interactive view of--fairly deep object graphs on the heap. Think something comparable to !do
TheXenocide
  • 1,060
  • 8
  • 22
5
votes
2 answers

Using SOS in a dump with .NET 2 (mscorwks) and .NET 4 (clr)

I have a dump which has both .NET versions loaded: 0:000> lm m clr start end module name 65490000 65aff000 clr (deferred) 0:000> lm m mscorwks start end module name 6a980000 6af2c000 mscorwks (deferred)…
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
5
votes
1 answer

Cannot use WinDbg and SOS in Visual Studio Immediate window

I'm following this tutorial: link. At step 8, when I say .load sos in the Immediate Window, it just pukes expected expression. System: Win 7 x64, Visual Studio 2012 Premium. I have an installed Debugging Tools for Windows (x64) 11/14/2012, Now I…
Csaba Toth
  • 10,021
  • 5
  • 75
  • 121
5
votes
1 answer

Reading instance fields when debugging JIT'ed assemblies

Over the last couple of weeks, I've been playing around with the unmanaged .NET debugging API. While MSDN documents the interfaces itself, to find out how to actually use them in any meaningful way, I resorted to various blogs (mainly Mike Stall's)…
Ruurd Keizer
  • 211
  • 1
  • 7