Category Archives: WinDbg

Examining PDB files with DBH

Wow, it’s been a ridiculously long time since I’ve blogged. I think it’s time I put something up just to break the curse, and this seemed like a good, and hopefully useful, place to start. Time to polish some of these dusty drafts into published gems. Ever been in that situation where you (or someone […]

Also posted in Debugging, Software Development, Visual Studio | Tagged , , , , , | 1 Response

Am I being called from DllMain?

How can you tell if your code is being called from within DllMain? You could use an undocumented function from ntdll.dll.

Also posted in .NET, Debugging, Visual Studio, Windows | Leave a comment

.NET 4.0 Type Equivalence causes BadImageFormatException

Interop assemblies containing certain constructs will cause a BadImageFormatException in .NET 4.0

Also posted in .NET, COM, Debugging, Windows | Tagged , , , , , , | 6 Responses

Modifying the VC runtime to get better heap allocation stack traces

Heap allocation stack traces are useless when using certain versions of the MSVC runtime. Is it possible to modify and rebuild MSVCR80 to avoid this?

Also posted in Debugging, Software Development, Windows | Tagged , , , | 1 Response

Beware of using stack-based COM objects from .NET

COM objects that don’t have the expected lifetime can cause chaos when combined with .NETs garbage collection system.

Also posted in .NET, COM, Debugging, Software Development | Tagged , , , , , , | 3 Responses

Getting IUnknown from __ComObject

How do you find the unmanaged COM object that’s being referenced by a .NET object?

Also posted in .NET, COM, Debugging, Software Development, Windows | Tagged , , , , | 6 Responses

Finding the largest free block of address space

I’ve been seeing problems recently with fragmented virtual address space. During the lifetime of a process, bits and pieces of memory are allocated throughout the 2GB 32-bit address space to such an extent that large contiguous blocks of free space are no longer available. If anything subsequently requires a large block of memory (like, for […]

Also posted in Software Development, Windows | Tagged , , , , , | 2 Responses

Diagnosing out of memory errors with VMMap

VMMap is a new tool from Mark Russinovich et al that’s very useful for diagnosing virtual memory/address space exhaustion issues. I describe it here, and give some information that should help you interpret what it reports.

Also posted in Debugging, Software Development, Windows | Tagged , , , , | 2 Responses

WinDbg !locks command broken

It seems that the extremely useful !locks command is broken in 6.11.1.40x, the current and previous release of WinDbg from the debugging tools for Windows. You’ll get errors like: 0:007> !locks NTSDEXTS: Unable to resolve ntdll!RTL_CRITICAL_SECTION_DEBUG type NTSDEXTS: Please check your symbols The suggested solution seems to be to roll-back to version 6.10.3.233, available from […]

Also posted in Debugging | Tagged , | 6 Responses

Troubleshooting an InvalidProgramException

One of the developers who uses the .NET/COM interop DLL that I wrote recently informed me that when they used it in a certain way, they would get a fatal System.InvalidProgramException. Nasty. So I set about seeing how I could find out exactly why this was happening: here are the gory details… To spoil the […]

Also posted in .NET, Software Development, Windows | Tagged , , , , , , , , | Leave a comment
  • Follow me on Twitter Follow me on Twitter @voyce

  • Check out Wordz my new fast-paced make-a-word game for iOS.
  • Categories

  • Archives