dotnet / corert

This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.
http://dot.net
MIT License
2.91k stars 508 forks source link

Complie error code -536852669 #7048

Closed rainbowlee closed 5 years ago

rainbowlee commented 5 years ago

I try to build a chat project. The error occuried.

C:\Users\hqfy.nuget\packages\microsoft.dotnet.ilcompiler\1.0.0-alpha-27416-01\build\Microsoft.NETCore.Native.targets(235,5): error MSB3073: 命令“"C:\Users\hqfy.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-27416-01\tools\ilc" @"obj\debug\netcoreapp2.0\win-x64\native\ChatServer.ilc.rsp"”已退出,代码为 -536852669。 [D:\guiltydomain\guiltydomain_netcore\Server\Chat\Chat_dotnet.csproj]

jkotas commented 5 years ago

Would it be possible to share the project that hits the error with us?

rainbowlee commented 5 years ago

I created a new project,and added dependency project one by one. It had an error below: MSBUILD : error MSB1025: 运行 MSBuild 时发生内部错误。 System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at Go7(RegexRunner ) at System.Text.RegularExpressions.CompiledRegexRunner.Go() 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 System.Text.RegularExpressions.Regex.Match(String input) at Microsoft.Build.Shared.CanonicalError.Parse(String message) at Microsoft.Build.Utilities.TaskLoggingHelper.LogMessageFromText(String lineOfText, MessageImportance messageImportance) at Microsoft.Build.Tasks.Exec.LogEventsFromTextOutput(String singleLine, MessageImportance messageImportance) at Microsoft.Build.Utilities.ToolTask.LogMessagesFromStandardErrorOrOutput(Queue dataQueue, ManualResetEvent dataAvailableSignal, MessageImportance messageImportance, StandardOutputOrErrorQueueType queueType) at Microsoft.Build.Utilities.ToolTask.HandleToolNotifications(Process proc) at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) at Microsoft.Build.Tasks.Exec.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) at Microsoft.Build.Utilities.ToolTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) at Microsoft.Build.BackEnd.TaskBuilder.InitializeAndExecuteTask(TaskLoggingContext taskLoggingContext, ItemBucket bucket, IDictionary2 taskIdentityParameters, TaskHost taskHost, TaskExecutionMode howToExecuteTask) at Microsoft.Build.BackEnd.TaskBuilder.ExecuteBucket(TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Dictionary2 lookupHash) at Microsoft.Build.BackEnd.TaskBuilder.ExecuteTask(TaskExecutionMode mode, Lookup lookup) at Microsoft.Build.BackEnd.TaskBuilder.ExecuteTask(TargetLoggingContext loggingContext, BuildRequestEntry requestEntry, ITargetBuilderCallback targetBuilderCallback, ProjectTargetInstanceChild taskInstance, TaskExecutionMode mode, Lookup inferLookup, Lookup executeLookup, CancellationToken cancellationToken) at Microsoft.Build.BackEnd.TargetEntry.ProcessBucket(ITaskBuilder taskBuilder, TargetLoggingContext targetLoggingContext, TaskExecutionMode mode, Lookup lookupForInference, Lookup lookupForExecution) at Microsoft.Build.BackEnd.TargetEntry.ExecuteTarget(ITaskBuilder taskBuilder, BuildRequestEntry requestEntry, ProjectLoggingContext projectLoggingContext, CancellationToken cancellationToken) at Microsoft.Build.BackEnd.TargetBuilder.ProcessTargetStack(ITaskBuilder taskBuilder) at Microsoft.Build.BackEnd.TargetBuilder.BuildTargets(ProjectLoggingContext loggingContext, BuildRequestEntry entry, IRequestBuilderCallback callback, String[] targetNames, Lookup baseLookup, CancellationToken cancellationToken) at Microsoft.Build.BackEnd.RequestBuilder.BuildProject() at Microsoft.Build.BackEnd.RequestBuilder.BuildAndReport() at Microsoft.Build.BackEnd.RequestBuilder.RequestThreadProc(Boolean setThreadParameters)

MSBUILD : error MSB1025: 运行 MSBuild 时发生内部错误。 System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary2 globalProperties, Dictionary2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet1 warningsAsErrors, ISet1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler) at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)

Unhandled Exception: OutOfMemoryException.

Compuer : win10 16G

rainbowlee commented 5 years ago

35475f5f-0fcf-4b0e-8d59-dd73225047fa

error like this occured

Can you give me a e-mail, I will send the project to you

rainbowlee commented 5 years ago

2d79a9ee-7512-4e61-bddc-9d3839be68b8

this error occured

jkotas commented 5 years ago

My e-mail is at my github home page.

rainbowlee commented 5 years ago

Ok, I have sent the code. Thanks for help

rainbowlee commented 5 years ago

@jkotas Have you received mail from 283576530@qq.com?

Is it necessary to send mail again?

jkotas commented 5 years ago

Yes, I received the email. Thanks! I did not have a chance to take a look yet.

rainbowlee commented 5 years ago

Ok, If there is anything I can do for you just tell me

jkotas commented 5 years ago

This is problem with infinite generic expansion.

Eventually, the compiler will crash will out of memory as it is trying to create more and more generic types that look like this:

GameFramework.ObjectPool`1<GameFramework.PoolAllocatedAction`1<GameFramework.IPoolAllocatedObject`1<GameFramework.PoolAllocatedAction`1<GameFramework.IPoolAllocatedObject`1<GameFramework.PoolAllocatedAction`1<GameFramework.IPoolAllocatedObject`1<GameFramework.PoolAllocatedAction`1<GameFramework.IPoolAllocatedObject`1<GameFramework.PoolAllocatedAction`1<...

This is duplicate of #363

jkotas commented 5 years ago

The generic virtual interface methods tend to be unfriendly to AOT compilation (both full AOT compilation like CoreRT and partial AOT compilation like crossgen/NGen). Also, their runtime performance is not good because of their invocation is relatively slow. It is best to avoid them for these reasons.

jkotas commented 5 years ago

Hope this helped. Closing as dup of #363. Thank you for sharing the repro.

rainbowlee commented 5 years ago

Thanks. We will try to avoid this issue