msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

[Unhandled Exception]: Exception of type 'System.OutOfMemoryException' was thrown

Open bendjukastein opened this issue 2 years ago • 1 comments

Issue Description

When the compiler is out of memory, the builder crashed and asked me to report it to you, this is that report.

Steps to Reproduce

It would take too long to scrape out the private info.

Actual Behavior

##[error]C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): Error MSB8071: Cannot parse tool output 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\include\vector(1938,1): fatal error C1060: compiler is out of heap space (compiling source file LC100.cpp)' with regex '^In file included from .$': Exception of type 'System.OutOfMemoryException' was thrown. 58>C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB8071: Cannot parse tool output 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\include\vector(1938,1): fatal error C1060: compiler is out of heap space (compiling source file LC100.cpp)' with regex '^In file included from .$': Exception of type 'System.OutOfMemoryException' was thrown. ##[error]This is an unhandled exception in MSBuild -- PLEASE UPVOTE AN EXISTING ISSUE OR FILE A NEW ONE AT https://aka.ms/msbuild/unhandled System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at Go6(RegexRunner ) at System.Text.RegularExpressions.RegexRunner.Scan(Regex regex, String text, Int32 textbeg, Int32 textend, Int32 textstart, Int32 prevlen, Boolean quick, TimeSpan timeout) at System.Text.RegularExpressions.Regex.Run(Boolean quick, Int32 prevlen, String input, Int32 beginning, Int32 length, Int32 startat) at System.Text.RegularExpressions.Regex.Match(String input, Int32 startat) at Microsoft.Build.CPPTasks.VCToolTask.ParseLine(String inputLine) --- End of stack trace from previous location where exception was thrown ---

Analysis

No response

Versions & Configurations

No response

bendjukastein avatar Jul 23 '24 21:07 bendjukastein

Thanks for filing! Unfortunately I don't think that'll be actionable since it looks like cl.exe also crashed out of heap, so the memory pressure on the machine is probably unavoidable.

We should see if we can avoid advising filing this bug (and also investigate why we emitted this error instead of the "file a bug on the task owner" one).

rainersigwald avatar Jul 23 '24 21:07 rainersigwald