CLR and Unhandled Exception Filters

December 30, 2007

I was recently asked how the CLR and Win32 unhandled exception filters interoperate.  Specifically, the original question was (edited for clarity): We’ve registered to the current AppDomain's UnhandledException event handler.  From unmanaged code, we’ve called the SetUnhandledExceptionFilter Win32 API function.  In the face of an exception, all unhandled exceptions are caught by the unmanaged exception handler, and the call stack of managed exceptions is shown corrupted. Removing the unmanaged registration catches managed exceptions correctly, but then unmanaged exceptions are lost. From looking at the SSCLI implementation and running a couple of tests I...
one comment

On Measuring Performance

December 27, 2007

To rephrase this post (or rant) in a nutshell: Measuring performance is not as simple as people think it is.  I have seen all kinds of information in books, the web, in hallway conversations etc. that is based on some kind of simple performance measurement; these performance measurements almost never reflect the actual state of affairs.  To measure performance, it isn’t enough to wrap a block of code with two Environment.TickCount samples; it isn’t enough to use a Stopwatch, either, even though even a Stopwatch is not often to be seen.  Measuring performance correctly, and more importantly – deciding...
3 comments

DEP, NXCOMPAT, .NET 2.0 SP1

December 21, 2007

Yesterday I had an interesting case that I thought of sharing, even though there's nothing very new. In the customer's scenario, a .NET 2.0 GUI application which was functioning perfectly on XP, has stopped working when she moved that application to Vista.  Namely, it was getting an access violation in a piece of native code, and terminating unexpectedly.  After much grief and looking up some forums on the web, she discovered that a similar problem could be caused by Data Execution Prevention, an important security feature that modern hardware and software work in tandem to implement.  (Very briefly, DEP...
no comments

Video Recording of My Developers Academy Lecture (DEV409: Psychic Performance and Debugging 101)

December 19, 2007

(This is going to be my last post about the DevAcademy II; I promise.) The video recording of my Developers Academy II lecture (DEV409: Psychic Performance and Debugging 101, download the slides and demos too) is now available.  If you tried accessing it during the last two days, there was something wrong with the streaming, but it works now (I'm watching it as I'm writing this post).  There are several funny quotes, such as "The last thing I prepared for you is an application crash; it's a good way to end the day - a crash." By the way,...

.NET File Access, Process Monitor, and Continental Airlines

December 16, 2007

(Surprisingly, this is not a post about associative memory and how apparently disconnected things appear to be inter-related after all.)  I'm writing this from my plane back home from the US, where I had the pleasure of teaching a Windows Internals course on Sela's behalf.  As part of the course, I demonstrate various debugging and investigation tools that can be used in the Windows ecosystem, including Sysinternals' excellent Process Monitor.  For those of you unfamiliar with the tool, I strongly recommend it - it's the Swiss Army knife for analyzing file system and registry activity on a machine.  Combined...
3 comments

.NET Parallel Extensions December CTP

December 1, 2007

Introduction November 29: Soma has announced a CTP release of the Parallel Extensions to the .NET framework, available to download as a full product (approx. 1.7MB) or just CHM documentation.  For more info, look at the Parallel Programming blog and the Parallel Computing developer center on MSDN. Software consultants, architects, decision-makers and community leaders have been blowing the "free lunch is over" horn for several years now.  With the advent of multi-core machines, Moore's law has been rephrased: the individual core's speed is not dramatically increasing, but the number of cores is expected to double every X months.  As...
no comments