+1  A: 

You might try installing Debugging Tools for Windows then use the -iae option (for NTSD/CDB) or the -I option (for WinDBG) to have one of the debuggers from that package be the JIT/AeDebug debugger.

Michael Burr
Thank you. I've just done that. Reproducing: waiting for the compiler to crash.
GregC
Updated the question. Please let me know if you'd like me to create another question there.
GregC
It looks like the exception is happening in native code - try using the ".symfix" command and see if getting symbols from Microsoft's server helps get a better "!analyze". Other than that, I know nothing about the specifics of cslangsvc or anything else related to what happens in a C# compile. But Microsoft might well be interested in a crash dump (use the ".dump" command).
Michael Burr
I've submitted the callstack at https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=444357. They should already have the dump file too, from my prior bug report.
GregC
A: 

I finally arrived at an exception type and callstack for the faulting compiler. I did this by saving a full dump file (.dump /ma c:\myCSCdump.dmp), then opening the dump file as you would open any other project file in VS2005. Pressing the run button produced the following in the call stack window:

kernel32.dll!_RaiseException@16()  + 0x3c bytes

cslangsvc.dll!ALLOCHOST::ThrowOutOfMemoryException() + 0x10 bytes cslangsvc.dll!PAGEHEAP::AllocPages() + 0xc1fd8 bytes cslangsvc.dll!SYMTBL::GrowTable() + 0x5b bytes cslangsvc.dll!BSYMMGR::AddChild() + 0x3b bytes cslangsvc.dll!BSYMMGR::CreateGlobalSym() + 0x2ba bytes cslangsvc.dll!BSYMMGR::CreateMethod() + 0xc bytes cslangsvc.dll!IMPORTER::ImportMethod() + 0x1d9 bytes cslangsvc.dll!IMPORTER::DefineImportedType() + 0x3b2 bytes cslangsvc.dll!CLSDREC::prepareAggregate() + 0x8d bytes cslangsvc.dll!COMPILER::ForceAggStates() + 0x8e bytes cslangsvc.dll!COMPILER::ForceAggStates() + 0x127 bytes cslangsvc.dll!COMPILER::EnsureState() + 0x2e bytes cslangsvc.dll!CLSDREC::CheckForTypeErrors() + 0x23 bytes cslangsvc.dll!CLSDREC::CheckForTypeErrors() + 0x2ba bytes cslangsvc.dll!CLSDREC::CheckForTypeErrors() + 0x80 bytes cslangsvc.dll!CLSDREC::CheckForTypeErrors() + 0x8a bytes cslangsvc.dll!CLSDREC::CheckForTypeErrors() + 0x8a bytes cslangsvc.dll!CLSDREC::CheckForTypeErrors() + 0x8a bytes cslangsvc.dll!COMPILER::CheckForTypeErrors() + 0x100 bytes cslangsvc.dll!COMPILER::CompileAll() + 0x546 bytes cslangsvc.dll!COMPILER::Compile() + 0x7c bytes cslangsvc.dll!CController::RunCompiler() + 0x177 bytes cslangsvc.dll!CController::Compile() + 0x16 bytes cslangsvc.dll!CCSharpProjectSite::BuildProjectCore() + 0x5a bytes cslangsvc.dll!CProjectSite::BuildProject() + 0x11 bytes csproj.dll!CCSharpBuildCompiler::DoMainBuild() + 0x88 bytes csproj.dll!CCscMSBuildHostObject::Compile() + 0x4e bytes mscorwks.dll!_CLRToCOMWorker@8() + 0x171 bytes

GregC
A: 

This is a bit wordy, so I'll post it as a reply. It's taken from Microsoft Connect site, in response to my issue. Reader might find it relevant:

Date: Thu, 7 May 2009 19:14:52 -0700

Greetings from Microsoft Connect!

This notification was generated for feedback item: Nightly build troubles (bucket 365749762) which you submitted at the Microsoft Connect site.

Thanks for reporting this issue you've encountered with Visual Studio 2005, and thanks for the dumps you've provided!

It looks like the issue is in cslangsvc.dll (the in-process C# Compiler), which is DevEnv is calling into to perform your build.

Our suggestion to work around this issue would be to try using MSBuild instead to do your nightly builds, as this should be more robust than automating DevEnv /build. Specifically, you'll likely avoid this particular issue as MSBuild will use csc.exe for compilation rather than cslangsvc.dll.

We're unlikely to have a further VS 2005 release to get out a fix to the cslangsvc issue, so I'm resolving this bug Won't Fix, but please reactivate it if you do still see an issue when using MSBuild.

Thanks again for all the information on this issue!

Alex Turner Program Manager Visual C# Compiler

GregC
Wow - that's a pretty quick turn around from MS. And by a PM no less, not a front-line support grunt. I'm not surprised they won't work the issue given that it's on VS2005. Hope the workaround does the trick for you.
Michael Burr
Using msbuild has greatly improved the stability of our build process.
GregC