This is my first official blogging experience and that explains the topic.

Let me introduce myself before getting into anything techie. I am Srinivas N working as a developer for the Visual Studio for Devices (VSD) team  where I currently drive the Managed Debugger effort and as well contribute to the Native Debugging story .

My current planning for this blog space is to provide commentary on the debugging story for VSD team: how the debugger differs from the desktop debugger, why it is designed the way it is and so on. I hope this blog would also serve as a useful platform for interfacing with the VSD customer issues.

Apart from this I would also like to pen on one of my favorite (does not necessarily mean that I am expert at it :-)) topic: tools for increasing the productivity at work, in particular debugging.

Recently I got a chance to contribute in a deceptively tricky bug in VS. The issue was that of a crash in different components of VS at various stages of using the VS due to a cycle of events from the user. This resulted in Watson dumps in different components . The call stack in some of the Watson dumps had ntdll.dll:"RtlpAllocateHeapLookaside" and I immediately suspected this could be a possible heap corruption based on my past experience. The non-deterministic nature of the crash was another key hint. I have learnt from Rich Hanbidge that using NT “Page Heap”  offers the quickest way to debug heap corruption issues. gflags tool can be used to enable page heap verification. Once I monitored the user scenario with this, the function causing heap corruption was identified. The issue was that of double free triggered as part of handling a CANCEL event from the user. Reverse engineering from the code gave us a consistent repro scenario for the crash to happen.

I believe the way heap corruption is detected by such tools is by having a verification/validation layer between the application and the system so that all the dynamic memory operations of the application can be monitored.

Can't imagine life without such tools! Stay tuned for more.