Saturday, July 9, 2011

Inspecting the Memory dump of a .NET Application

There are times when a .NET application crashes and what logging is in place is not enough. In this case, if you happen to have a memory dump of the application in a .dmp file, then the application's memory and stack trace of the application's threads can be investigated, with the right tools.

The Windows Debugger is the tool for investigating Windows memory dump files. Microsoft provides this tool to query the memory dump files, files with the .dmp extension. On its own, this tool cannot show the stack trace for .NET 2.0 applications, but with the extension PSSCore2, .NET stack traces can be viewed and a great level of detail gleamed from the stack trace. PSSCore2 replaces an older tool SOS. Most of the resources I've found refer to SOS instead of PSSCore2, though the commands for the most part are the same between the two systems.

Once both of these tools have been installed, open the memory dump file with Windows Debugger. After the memory dump file has been loaded, issue the command:

    .load clr10\psscore2

You may have to replace clr10 with the folder that you placed psscore2. If you place the psscore2 dll in the same folder as the Windows Debugger, then the command would simply be:

    .load psscore2

But how do you use the Windows Debugger once its been installed? This article details the basic steps for loading the old extensions, but it still contains some good references (just replace references to 'sos' with 'psscore2'). This blog post from MSDN outlines some of the most useful commands and how to use them. Also, this blog post provides a real world use case for the Windbg tool. Finally, this blog post contains numerous links and a few random tidbits about the tool.

This outlines most of the useful pages I've found on the web for loading the memory dump of a .NET application. The command “!help” will return the name of the various commands available for the psscore2 extension. In general, commands that start with “!” refer to the commands available in the loaded extension, while those starting with “.” are those available natively in the Windows debugger.

Wednesday, June 8, 2011

Is the Dream of Courier about to be fulfilled?

A couple weeks ago, a new project appeared on Kickstarter that got a bit of attention. Kickstarter is a site that allows anyone to fund projects that they like in hopes that the project will become a reality. In many cases, those who donate to a project will receive things in return, such as a copy of the application (if its software).

This project, which is named Taposé, provides a few interesting videos on the planned design of the application. Watching these videos is a bit of deja vu, with a journal like application on half of the screen and various other applications in the other side. In fact, the title of the project says it all: Bringing the Courier to the iPad.

Despite the fact that the Microsoft announced the Courier's demise over a year ago, the device's possibility always stuck with me. And obviously, I was not the only one taken in by the device's promise. The Kickstarter project had a goal of $10,000, but surpassed it with $26,561.

My initial reaction to this was obvious excitement, with a bit of scorn, since I'd rather not pony up the money for an iPad. I'm no fan of Apple products (I don't own a single one), but if the only way to get Courier like functionality is to buy an iPad, well, I might have to give in to the dark side.

(Its funny. Back in the mid 90's, when my parents bought a Pentium 1 PC with Windows 95, my 5th grade teacher claimed I was going to the dark side (he was a big Mac guy). But I stand by my statement. Apple seems as dark today as Microsoft did back then. Oh the irony of Apple's '1984' commercial when viewed today).

But, given the amount of money the Tapose team raised, they areconsidering a Droid application. Being a happy Droid phone owner, a Droid tablet is one device I can see myself owning without switching allegiances. I hope these guys the best of luck. Perhaps there will be a Droid tablet on store shelves in a few months promising Courier like functionality right out of the box.

Monday, June 6, 2011

Samsung Intercept

I'm notoriously frugal, which is why when I read from Robert Cringely's prediction of the demise of Feature phones, I thought he was overly optimistic. When someone disdains monthly cell phone plans, what other options are there for a cell phone but a feature phone?

Well, it turns out, there are a few options out there. In fall of last year, Virgin Mobile started offering the Samsung Intercept, a phone with Android 2.1. The initial price was steep ($250!), but it was a fully loaded smart phone, on a pre-paid plan! Of course, if you wanted data, you're better off with a monthly plan, but these plans are ridiculously priced. For $25 a month, one can get unlimited data, texting, and 300 minutes.

It all sounds good on paper, especially if you were to compare phone and data plans with other carriers. The reduced monthly price (at expense for higher hardware costs) pays for itself in about a year.

Needless to say, I eventually bought the phone (on sale after Christmas for $180) and have been using it for 5 months. I honestly can say I don't know how I operated without this device. Prior to this, I had a cheap phone for calls, an MP3 player to listen to music at work, an old Pocket PC for reading and writing, a Tom Tom GPS in the car for directions. This device has replaced them all and then some.

I use the sliding Qwerty keyboard all the time to write notes, search the web, or even write blog posts. The on screen keyboard is a little cramped, but is handy with the auto-sense.

I have better success with navigation on the phone vs. Tom Tom. This is largely because the GPS device's maps are a few years out of date and map updates cost so much, I might as well buy a new device.

I have a lot more storage on the phone as compared to my MP3 player, so I can keep a much larger music collection on hand. And if I get bored of that, there's always YouTube and Pandora.

With Amazon's Kindle application, reading is much easier on my phone compared to my old Pocket PC. I've finished a few books on the device, plus read hundreds of articles using the InstaFetch application that synchronizes with my InstaPaper account.

Finally, I've taken many more pictures with the phone's camera thanks to it always being in my pocket. Uploading to Facebook can be a bit difficult (as it doesn't always recognize orientation), but I've installed the application PicSay to handle this when the native application fails.

All told, I'm still loving my Droid phone. It was upgraded to Droid 2.2 about a month ago. The only downside here is that during the upgrade, the note application, which I had saved a dozen notes in, was removed and I lost all of the notes. This warning was clearly stated, but unfortunately, I did not heed the warning.