sos

understanding DumpStackObjects

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 y; } class MyClass { int x; int y; } ...

Understanding CLR object size between 32 bit vs 64 bit

I am trying to understand the object size difference between 32 bit and 64 bit processors. Let’s say I have a simple class class MyClass { int x; int y; } So on a 32 bit machine, an integer is 4 bytes. If I add the Syncblock into it ( another 4 bytes), the object size will be 12 bytes. Why is it showing 16 bytes? ...

Why syncblk is located at -4 and not at 0?

So if you want to look at sync block for an object, under sos you have to look at -4 bytes (on 32 bit machines) before the object address. Does anyone know what is the wisdom for going back 4 bytes? I mean they could have sync block at 0, then type handle at +4 and then object fields at +8. ...

WinDbg alternative to !dumpheap -type?

I got the following line from !dumpheap -stat 000007fee09d6960 441762 835293368 System.String I'm interested to find out what the 441 762 strings are used for. Doing a !dumpheap -type System.String would list all, or am I mistaken? How can I just analyze some of them? ...

windbg !gcroot <address> 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 11 OSTHread 147c Scan Thread 12 OSTHread 15d4 Scan Thread 14 OSTHread 9dc Scan Thread 15 O...

Silverlight application under IE attached to Windbg

Is it possible to attach Windbg to a Silverlight based application running under internet explorer ( or any other browser)? If its possible, then will I have to attach windbg to the browser and this will get me into that mini CLR under Internet explorer? ...

Information about object that thread is waiting for

If I have following stack trace where I see that a thread is waiting on certain lock. How can I get information about the object this thread is waiting for? I was thinking that I should be able to SyncBlk command but seem like it can only give information about the locks and its owner threads. 0:000> !CLRStack OS Thread Id: 0x25a8 (0)...

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 { Monitor.Enter(sync); } catch (Exception) { //Monitor.Exit(sync)...

inspect field on all instances in memory dump

I have a memory dump that I'm using to troubleshoot a client issue. This is a .NET (C#) application. The problem with my application is that too many instances of a particular class are being created. There are 6300 instances of this class when there should be something like 20. I want to loop through all of those instances and call ...

Is there a 64 bit version of psscor2?

I'm trying to debug a .NET 3.5, 32 bit application running on Windows 7/64 bit with WinDbg. I'd like to use psscor2, but I can't load it. I can't load sos, either. When I try to load psscor2, I get this error: > .load psscor2 The call to LoadLibrary(psscor2) failed, Win32 error 0n193 "%1 ist keine zulässige Win32-Anwendung." Pleas...

Deadend whilst Debugging Silverlight with WinDBG and SOS

I'm new to WinDBG. I'm looking for the cause of a memory leak and I've got as far as my current knowledge can take me. My MVVM App is leaking MyLovelyView objects. In WinDBG I run !dumpheap -type MyLovelyView and get the following: Address MT Size 05f2a978 0bc948d4 12 05f39638 04d51114 36 05f398d4 04d2...