Category Archives: Debugging

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, Visual Studio, WinDbg, 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, WinDbg, Windows | Tagged , , , , , , | 6 Comments

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 Software Development, WinDbg, Windows | Tagged , , , | Leave a comment

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, Software Development, WinDbg | Tagged , , , , , , | 3 Comments

Don’t do anything in DllMain… Please

Thinking of adding some code to your DLLs DllMain function? STOP!

Also posted in Software Development, Uncategorized, Windows | Tagged , , , , | Leave a comment

Pinned DataTips in Visual Studio 2010 Beta 2

I’ve just noticed a nice little feature in Visual Studio 2010 Beta 2: pinned DataTips. Values displayed in the debugger as you hover over a variable can now be pinned in place and remain aligned with the source. They can even have annotations added… Tasty!

Also posted in Usability, Visual Studio | Tagged , | Leave a comment

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, Software Development, WinDbg, Windows | Tagged , , , , | 5 Comments

Diagnosing out of memory errors with VMMap – Part 2

(I had problems with WordPress choking on this long post, so I’ve split it into 2 parts. The first part is here. This is the second part).

Also posted in Windows | Tagged , , , | Leave a comment

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 Software Development, WinDbg, Windows | Tagged , , , , | 2 Comments

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 here, or you can just [...]

Also posted in WinDbg | Tagged , | 2 Comments
  • Follow me on Twitter Follow me on Twitter @voyce

  • Categories

  • Archives