« Ease of Deploying Web Applications | Main | Vancouver, Land of the SPUI »

February 27, 2007

Watson and Dr. Watson

I heard a story today that explained something that always confused me: the difference between Dr. Watson and Watson.

Watson is the technology that reports errors to Microsoft when an application crashes; technically Watson ships with Office, and in its Windows incarnation it's known as Windows Error Reporting. But I always knew that if you installed Visual Studio on a machine, it would disable the logging back to Microsoft, because Visual Studio would be launched when an application crashed with an unhandled exception; and the trick to turn the Watson reporting back on was to run the command "drwtsn32 -i". So were Dr. Watson and Watson the same thing?

It turns out no. Dr. Watson was a simple just-in-time debugger that dates back to Windows 95 or thereabouts. When Office first began working on the unhandled exception logging technology, they called it Watson because of Dr. Watson. Actually, to make matters a bit more confusing, they called it D.W., which was technically short for DAD Watson (DAD at the time being the Desktop Applications Division, which was more-or-less Office) but was also a homage to Arthur's moppet-like little sister on the television show Arthur. Calling it D.W. as a way to distinguish it from Dr. Watson reminds me of the story that the state of Washington was originally going to be named Columbia, but the name was changed to avoid confusion with the District of Columbia. Anyway, the D.W. technology eventually became known as Watson, and then morphed into Windows Error Recovery.

And the drwtsn32 thing? It turns out that doing that actually just removes Visual Studio as the default handler of last resort, and restores it to the system default. The system default is Dr. Watson, but Dr. Watson at this point, in current Windows versions, is smart enough to know that it should do nothing, and hands the exception over to Windows Error Reporting. Meanwhile Office still ships with the same Watson technology linked in as its unhandled exception handler. So, technically, when an Office app crashes the system invokes the unhandled exception handler built-in to Office, and when a random app (with no unhandled exception handler) crashes the system invokes a default handler...but since they both wind up being Watson, the user doesn't really notice much difference.

Posted by AdamBa at February 27, 2007 10:34 PM

Trackback Pings

TrackBack URL for this entry:
http://proudlyserving.com/cgi-bin/mt-tb.cgi/559

Comments

"The system default is Dr. Watson, but Dr. Watson at this point, in current Windows versions, is smart enough to know that it should do nothing, and hands the exception over to Windows Error Reporting."

Technically (at least in XP & Server 2003, for which I did the DW integration) this isn't true. Dr. Watson has no knowledge of WER and doesn't hand off control to it. Instead, the default unhandled exception filter in kernel32.dll does the coordinating between invoking DW and/or the configured JIT debugger to handle the crash.

Posted by: Dare at February 28, 2007 01:51 PM

I get it. So it's more that the system recognizes that Dr. Watson is not worth invoking, and invokes WER by default. Thanks.

- adam

Posted by: Adam Barr at February 28, 2007 06:54 PM

I am fairly certain that Dr. Watson shipped earlier than Win 95. I remember it in Win 3.1 and tend to think that it was also there in Win 3.0.

Posted by: Aaron at March 7, 2007 11:30 PM