Tuesday, October 10, 2006

FatalExecutionEngineError with EventPool

At work I have been converting our product to Visual Studio.Net 2005. After Visual Studio converted the solution, and I fixed all the compiler warnings caused by stuff that has been obsoleted in the .Net Framework 2.0, I pressed F5 to run. The app started up successfully, but when I tried any functionality, I got a nasty error:

FatalExecutionEngineError was detected
Message: The runtime has encountered a fatal error. The address of the error was at 0x79f783dd, on thread 0x5d0. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

The error was presented in a Managed Debugging Assistant (MDA), which is something new for Visual Studio.Net 2005:


I tracked the issue down to a call in some EventPool code that we got from Marc Clifton's site. There was a demo program (EventPoolDemo.zip; you need to register with the site to be able to see the download link) available, so I downloaded it and loaded the solution in Visual Studio.Net 2005. The solution was written in Visual Studio.Net 2003, so the conversion wizard popped up and converted it without any issue. I pressed F5 to run, and Presto, I hit the same error.

I next checked the forums on Marc's site and discovered that someone else had hit this issue too. Unfortunately, nobody had posted a response. I decided to drop a line to Marc to see if he had any clues.

I spent the rest of the day banging my head against the wall trying to figure out the issue by debugging and Googling. I made no progress and by the end of the day had a real headache.

And then, as I was ready to throw in the towel for the day, up popped an email reply from Marc.

Hi Darryl,

See if the solution posted in this link solves the problem.

http://www.codeproject.com/csharp/eventpool.asp?msg=1541283#xx1541283xx

Marc

Holy deus ex machina, Batman, it worked! The problem was a naming conflict in the EventPool code. All I had to do was rename a delegate that conflicted with System.MulticastDelegate from this:

protected delegate void MulticastDelegate(object sender, EventArgs e);

to this:

protected delegate void EpMulticastDelegate(object sender, EventArgs e);

Hooray, the app is working again! Until I hit the next conversion issue...



Friday, October 06, 2006

Araxis Merge with Rational ClearCase

About a year ago I finally got tired of the Diff tool that comes with Microsoft Visual Source Safe (VSS). A little Googling pulled up this Coding Horror post on Araxis Merge.

After a quick download and 30 day free trial, I was hooked. It is sooooooo sweet, and if you've never used anything better than the dumb VSS Diff, you don't know what you're missing. Then the 30 days came to an end.

Cheap, it is not. But hey, I rationalized: I'm a developer, and a good Diff tool is essential for the toolbox. I found that I was easy to convince. So, I bought it for myself with my own Buckazoids (more on those here, if you're interested). Since then have used it nearly every day, and it makes doing a diff nearly enjoyable. It was well worth the cost, and I only wish I had found it years earlier.

But then I changed jobs, and joined a place where Rational ClearCase is used. The ClearCase Diff tool was better than VSS' tool, but I preferred to stick with my beloved Araxis Merge. How to integrate it with ClearCase?

Fortunately Araxis had a page devoted to this topic, and an entry for ClearCase. This led me to Ganesh Viswanathan's nifty Clearaxis utility. A quick download and Presto, I was back in business with Merge.

After a few days of use, I noticed a little problem with Clearaxis: files in paths with embedded spaces would not load into Merge properly. I sent an email to Ganesh, and within a few days, he had provided me with a fix to try out, and it worked like a charm. Now that's terrific support. If you use ClearCase and Araxis Merge, you need Clearaxis!