Welcome to MSDN Blogs Sign in | Join | Help

aWorkBlogByGus

Gus Perez on C#, .NET Development and Software Testing
C# compiler bug workaround

We've received a couple of reports of people running into this internally and I figured it was worth posting about for anyone who searches for information on the problem. It's a very easy workaround and I think most would be able to figure it out on their own but we've run across a few users who missed it.

The problem is the 7.1 (Everett) version of the C# compiler crashes (ICEs) when attempting to create a pdb where one already exists that was created with a more recent version of the compiler (e.g. 8.0 aka Whidbey).

The workaround is just a matter of deleting the existing PDB file.

The error output you'd see if you run into it would be similar to the following:

Microsoft (R) Visual C# .NET Compiler version 7.10.4133.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

fatal error CS0041: Unexpected error writing debug information to file 'c:\test\test.PDB' --
'Catastrophic failure '
error CS0583: Internal Compiler Error (0xc0000005 at address 53625106): likely culprit is 'CODEGEN'.
An internal error has occurred in the compiler. To work around this problem, try simplifying or changing the
program near the locations listed below. Locations at the top of the list are closer to the point at which the
internal error occurred.
test.cs(5,14): error CS0584: Internal Compiler Error: stage 'CODEGEN' symbol 'Test.Main()'
test.cs(5,14): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'Test.Main()'
test.cs(5,14): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'Test.Main()'
test.cs(3,7): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'Test'
test.cs(1,1): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol ''
test.cs: error CS0586: Internal Compiler Error: stage 'COMPILE'
error CS0587: Internal Compiler Error: stage 'COMPILE'
error CS0587: Internal Compiler Error: stage 'BEGIN'

A KB article is in the works but those sometimes take a bit. Also, if you ended up here because you ran across an instance of the C# compiler crashing with an ICE (Internal Compiler Error) that is not the one described above. Please help us fix it by logging a bug on our MSDN Feedback site. Thanks!

Posted: Saturday, April 09, 2005 12:47 AM by GusPerez
Filed under:

Comments

Craig Nicholson said:

It would be great if the MSDN Feedback Site (http://lab.msdn.microsoft.com/ProductFeedback/) allowed for VS.NET 2003 bugs to be reported.

I've got a similar problem but I can only reproduce it in my project and not in a seperate project. How do I go about reporting it?
# April 9, 2005 4:35 PM

GusPerez said:

Craig, feel free to submit it via the MSDN Feedback site even if it may be an Everett-only issue. Just make sure you identify it as a C# compiler issue and it should get to us soon after. We'll investigate at that point and contact you if we need some more info. Thanks!
# April 10, 2005 1:43 AM

Mateusz Kierepka said:

# September 14, 2005 2:27 PM

Oz said:

That works! thanks!
# November 3, 2005 12:08 PM

Dan McKinley said:

Thanks for the info.
# February 22, 2006 10:56 AM

Nick said:

You saved my life!!
# March 13, 2006 9:36 AM

James Shaw said:

Perfect, that's exactly what happened. You should expect a lot of hits from this over the coming months.

I'll be blogging this tonight :)
# March 21, 2006 12:16 PM

Steve Moxon said:

Nice post, and quick solution.

Many thanks.
# April 13, 2006 4:19 AM

C# compiler bug workaround said:

# November 26, 2007 9:16 AM
New Comments to this post are disabled
Page view tracker