Fatal Execution Engine Failure(0x7927e03e) and WCF
An interesting issue cropped up during development this week. It centered around a mysterious error that was happening in our web applications and causing IIS to crash…hard.
Peeking in the event log, I found the following error:
1 2 3 4 5 6 7 8 9 10 11 12 |
Event Type: Error Event Source: .NET Runtime Event Category: None Event ID: 1023 Date: 8/8/2008 Time: 7:07:28 PM User: N/A Computer: ZORCH6 Description: .NET Runtime version 2.0.50727.1433 - Fatal Execution Engine Error (79FFEE24) (80131506) For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. |
It was mind boggling even more so because the app worked on some environments and not others. We chased various options around and none of them seemed to solve the issue. Further confounding the issue was that IE would throw up an authentication dialog instead of outright generating an error on the AJAX call where the error was originating from. This lead us in circles fiddling with the domain controller and permissions for a while, too.
There was no concrete info anywhere in the system which explained why we were getting this error. Then I came across a post in the Microsoft Connect site which mentioned this issue. I wasn’t completely sure that this was the same as our issue, since we weren’t using IEnumerable<T> in our contracts, but it was a lead. So I built a small sample project to model our service calls.
It turns out that there’s something borked with WCF data contract serialization in IIS when running in Windows 2003 environments.
In our case, we did not have IEnumerable<T> in our contracts (well, not explicitly anyways). However, we had a few methods which took Collection<T> as an argument. This worked all fine and dandy when sending a normal collection like so:
1 2 3 4 5 6 7 8 9 10 |
<FONT face="Lucida Console"><FONT color=#800080>Collection</FONT><FONT color=#5e82fd><</FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>> </FONT><FONT color=#000000>c1 </FONT><FONT color=#5e82fd>= </FONT><FONT color=#0000ff>new </FONT><FONT color=#800080>Collection</FONT><FONT color=#5e82fd><</FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>>();</FONT> <FONT color=#000000>Person thuy </FONT><FONT color=#5e82fd>= </FONT><FONT color=#0000ff>new </FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>(</FONT><FONT color=#ff00ff>"Thuy"</FONT><FONT color=#5e82fd>, </FONT><FONT color=#ff00ff>"Ha"</FONT><FONT color=#5e82fd>, </FONT><FONT color=#ff00ff>"UT"</FONT><FONT color=#5e82fd>);</FONT> <FONT color=#000000>c1</FONT><FONT color=#5e82fd>.</FONT><FONT color=#ff8040>Add</FONT><FONT color=#5e82fd>(</FONT><FONT color=#000000>thuy</FONT><FONT color=#5e82fd>);</FONT> <FONT color=#000000>client</FONT><FONT color=#5e82fd>.</FONT><FONT color=#000000>ProcessPeople</FONT><FONT color=#5e82fd>(</FONT><FONT color=#000000>c1</FONT><FONT color=#5e82fd>);</FONT> <FONT color=#800080>Collection</FONT><FONT color=#5e82fd><</FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>> </FONT><FONT color=#000000>c2 </FONT><FONT color=#5e82fd>= </FONT><FONT color=#0000ff>new </FONT><FONT color=#800080>Collection</FONT><FONT color=#5e82fd><</FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>>();</FONT> <FONT color=#000000>client</FONT><FONT color=#5e82fd>.</FONT><FONT color=#000000>ProcessPeople</FONT><FONT color=#5e82fd>(</FONT><FONT color=#000000>c2</FONT><FONT color=#5e82fd>);</FONT></FONT> |
However, using this approach breaks it (I repeat, this does not work):
1 2 3 4 5 |
<FONT face="Lucida Console"><FONT color=#000000>Person chuck </FONT><FONT color=#5e82fd>= </FONT><FONT color=#0000ff>new </FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>(</FONT><FONT color=#ff00ff>"Charles"</FONT><FONT color=#5e82fd>, </FONT><FONT color=#ff00ff>"Chen"</FONT><FONT color=#5e82fd>, </FONT><FONT color=#ff00ff>"NJ"</FONT><FONT color=#5e82fd>);</FONT> <FONT color=#000000>Person</FONT><FONT color=#5e82fd>[] </FONT><FONT color=#000000>a3 </FONT><FONT color=#5e82fd>= </FONT><FONT color=#0000ff>new </FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>[</FONT><FONT color=#000000>1</FONT><FONT color=#5e82fd>];</FONT> <FONT color=#000000>a3</FONT><FONT color=#5e82fd>[</FONT><FONT color=#000000>0</FONT><FONT color=#5e82fd>] = </FONT><FONT color=#000000>chuck</FONT><FONT color=#5e82fd>;</FONT> <FONT color=#000000>client</FONT><FONT color=#5e82fd>.</FONT><FONT color=#000000>ProcessPeople</FONT><FONT color=#5e82fd>(</FONT><FONT color=#0000ff>new </FONT><FONT color=#800080>Collection</FONT><FONT color=#5e82fd><</FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>>(</FONT><FONT color=#000000>a3</FONT><FONT color=#5e82fd>));</FONT></FONT> |
To work around this, you can use an intermediate step like so (of course, this is only necessary if you have data coming from an array to begin with):
1 2 3 4 5 6 7 8 9 |
<FONT face="Lucida Console"><FONT color=#000000>Person chuck </FONT><FONT color=#5e82fd>= </FONT><FONT color=#0000ff>new </FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>(</FONT><FONT color=#ff00ff>"Charles"</FONT><FONT color=#5e82fd>, </FONT><FONT color=#ff00ff>"Chen"</FONT><FONT color=#5e82fd>, </FONT><FONT color=#ff00ff>"NJ"</FONT><FONT color=#5e82fd>);</FONT> <FONT color=#000000>Person</FONT><FONT color=#5e82fd>[] </FONT><FONT color=#000000>a3 </FONT><FONT color=#5e82fd>= </FONT><FONT color=#0000ff>new </FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>[</FONT><FONT color=#000000>1</FONT><FONT color=#5e82fd>];</FONT> <FONT color=#000000>a3</FONT><FONT color=#5e82fd>[</FONT><FONT color=#000000>0</FONT><FONT color=#5e82fd>] = </FONT><FONT color=#000000>chuck</FONT><FONT color=#5e82fd>;</FONT> <STRONG><FONT color=#008000>List</FONT><FONT color=#5e82fd><</FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>> </FONT><FONT color=#000000>l3 </FONT><FONT color=#5e82fd>= </FONT><FONT color=#0000ff>new </FONT><FONT color=#008000>List</FONT><FONT color=#5e82fd><</FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>>();</FONT> <FONT color=#000000>l3</FONT><FONT color=#5e82fd>.</FONT><FONT color=#ff8040>AddRange</FONT><FONT color=#5e82fd>(</FONT><FONT color=#000000>a3</FONT><FONT color=#5e82fd>);</FONT></STRONG> <FONT color=#000000>client</FONT><FONT color=#5e82fd>.</FONT><FONT color=#000000>ProcessPeople</FONT><FONT color=#5e82fd>(</FONT><FONT color=#0000ff>new </FONT><FONT color=#800080>Collection</FONT><FONT color=#5e82fd><</FONT><FONT color=#000000>Person</FONT><FONT color=#5e82fd>>(</FONT><FONT color=#000000><STRONG>l3</STRONG></FONT><FONT color=#5e82fd>));</FONT> </FONT> |
In any case, what further confounded the issue is that it worked in an XP environment but did not work in a server 2003 environment. Glad to have this issue behind me :-D; hopefully, you won’t waste as much time fiddling with this as I did.