windbg

WinDbg - Problem with 'Open Executable'

Hello, I tried to debug a .NET console app using WinDbg. I normally do this by File -> Open Executable, then WinDbg would load up the selected exe. This was working for the .NET app mentioned. But now I get the following output every time: Microsoft (R) Windows Debugger Version 6.11.0001.404 X86 Copyright (c) Microsoft Corporation. Al...

WINDBG, how to view the contents of an array?

I'm using WINDBG to analyze a dump file for a program that exhibits a bit too high memory usage. One of the objects involved is holding an object array, referencing a lot of objects I'd like to look at, to try to find out why they were allocated. Here's what I've tried: First, my collection of ServiceContainer objects: 0:000> !do 056...

WinDbg/SOS: Explanation of !SyncBlk output

Hi! I am looking of a description of the output generated by the !SyncBlk command of SOS. Particularly I found no useful explanation on the column "MonitorHeld". This column shows high values in a series of crash dumps. Example: 0:000> !SyncBlk Index SyncBlock MonitorHeld Recursion Owning Thread Info SyncBlock Owner ...

what does <unclassified> mean in windbg !address output

Example: 0:074> !address -summary --- Usage Summary ---------------- RgnCount ----------- Total Size -------- %ofBusy %ofTotal Free 90919 7ec`34659000 ( 7.923 Tb) 99.03% <unclassified> 95426 12`3c3e9000 ( 72.941 Gb) 92.12% 0.89% Heap ...

Why does the number of threads reported by WinDbg, Task Manager and VS Debugger differ?

While my .Net 3.5 app was running, the Windows Task Manager shown that my app had 16 threads. I collected a memory dump for the process and opened it using WinDbg/SOS. Running the !threads command reveals that I have : ThreadCount: 456 UnstartedThread: 0 BackgroundThread: 6 PendingThread: 0 DeadThread: 449 Hosted Runtime: no Here are...

How to print each function call during execution in WinDbg?

I am debugging an application written in VC++. How do i make WinDbg print the function name and all the values of the arguments to the functions during execution of the debuged process? ...

Mismatch in object size returned by sos.dll and in-memory process size.

Hello, I have used the following sos command to enumerate all instances of a particular type in a running asp application (hosted on windows xp 4 GB machine). .foreach (obj { !dumpheap -type ::my type:: -short ::start of address space:: ::end of address space:: }) { !objsize ${obj} }. This enumerates all objects of the given type in ...

Performance Counters in Windbg Crash Dump

Is it possible to see thread performance counters in dump of native c++ application in windbg. ...

What could explain over 5,000,000 System.WeakReference instances on the managed heap?

I have been running load tests against a production ASP.NET web application and am seeing a huge number of System.WeakReferences created on the heap. Within about 15 minutes under load managed heap memory has shot up to about 3GB and I have approximately 5,000,000 references to System.WeakReference. Performing a forced garbage collection...

Troubleshooting a COM+ application deadlock

I'm trying to troubleshoot a COM+ application that deadlocks intermittently. The last time it locked up, I was able to take a usermode dump of the dllhost process and analyze it using WinDbg. After inspecting all the threads and locks, it all boils down to a critical section owned by this thread: ChildEBP RetAddr Args to Child ...

List loaded modules using gdb

Hello, Is there a way to list all the loaded modules using gdb, just like Windbg, that automatically shows all the loaded modules. Its okay if there is no one word answer, I'll be happy to work things out myself if someone could please provide me a pointer. ...

How to break WinDbg in an anonymous method?

Title kinda says it all. The usual SOS command !bpmd doesn't do a lot of good without a name. Some ideas I had: dump every method, then use !bpmd -md when you find the corresponding MethodDesc not practical in real world usage, from what I can tell. Even if I wrote a macro to limit the dump to anonymous types/methods, there's no ob...

Production debugging: Is there a less intrusive way than WinDbg?

Hi, I was wondering if there is a less intrusive way to analyze a running, managed process in production environments. Less intrusive meaning: No delay of execution when attaching the debugger. No delay of execution when getting basic stats like running threads. In the Java world there is a such a tool part of the JDK. I was wonder...

WinDbg remote debugger protocol

I'd like to build a client for dbgsrv.exe. I'd like to know if there's a spec on the protocol that it uses and if there are any (open source?) libraries that are able to communicate with it for a remote debugging session. ...

Comparing two Object addresses in WinDbg

Is there a way to know if two addresses, which are references to two objects are connected ? By connected I mean whether one of the objects holds a reference to the other object. ...

In windbg, how do I get a heap header address from !heap -l results?

I am playing around with windbg's !heap command, particular the "-l" switch which detects memory leaks. When -l does detect a leak, I am having problems navigating from its results to a stack trace for the source of the leak. Here is a snippet of the results from !heap -l. Formatting has been changed to make the output more readabl...

What is the header of an array in .NET

Hi all, I have a little bit seen the representation of an array in memory with Windbg and SOS plugin. Here it is the c# : class myobj{ public int[] arr; } class Program{ static void Main(string[] args){ myobj o = new myobj(); o.arr = new int[7]; o.arr[0] = 0xFFFFFF; o.arr[1] = 0xFFFFFF; o.arr[2] = 0xFFFFFF; ...

How to debug command line file with symbolic data

I have a compiled .exe file (compiled with gfortran and -g option) that crashes. I can attach the WinDBG program to it using the WinDBG -I command. Funny enough it generates a stack overflow: (38f0.2830): Stack overflow - code c00000fd (!!! second chance !!!) However, the output says that there is no debugging information in my progr...

What is the exact difference between MEM_RESERVE and MEM_COMMIT states?

As I understand it MEM_RESERVE is actually 'free' memory, ie available to be used by my process, but just hasn't been allocated yet? Or it was previously allocated, but had since been freed? Specifically, see in my !address output below how I am nearly out of virtual address space (99900 KB free, 2307872 as MEM_PRIVATE. But the sta...

How to open a logfile in windbg from a script, such that each logfile is named by the timestamp of creation?

Hi,I want to run a windbg script that will accomplish the following: I want to track certain registers the moment an API is hit, without stopping due to timing issues. So , the moment the API is called, I want the script to open a logfile, echo the fact that the api is hit with the details of the parameters, and let it run till it hits ...