-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet publish quite often fails with System.NullReferenceException on Apple Silicon #51250
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
probably just a different incarnation of the same underlying issue. Happy to keep both active for now. |
This one too seems only on osx.1100.arm64.open
|
@sdmaclea Is there anything I can help with? Does this look like a dotnet issue, or we are still waiting for the next macOS updates? |
@k15tfu Is this still failing on your local machine with recent macOS version? I've had trouble reproducing most of the above |
@sdmaclea Yes, I have just checked it again on macOS 11.3.1 using latest dotnet-sdk-6.0.100-preview.5.21267.9-osx-arm64:
I used 4 different folders and ran it simultaneously in 4 different terminals, they all failed as above:
, or
, or
, or
|
I just tried this with .NET 6 preview3 on macOS 11.4 (with only 100 runs). I saw one failure which your shell script didn't catch 17
Microsoft (R) Build Engine version 16.10.0-preview-21181-07+073022eb4 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored /Users/stmaclea/git/issue48902/Sol/B/B.csproj (in 239 ms).
Restored /Users/stmaclea/git/issue48902/Sol/C/C.csproj (in 239 ms).
Restored /Users/stmaclea/git/issue48902/Sol/A/A.csproj (in 239 ms).
You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Roslyn/Microsoft.CSharp.Core.targets(71,5): error MSB4018: The "Csc" task fa
iled unexpectedly. [/Users/stmaclea/git/issue48902/Sol/C/C.csproj]
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Roslyn/Microsoft.CSharp.Core.targets(71,5): error MSB4018: System.InvalidOpe
rationException: The "Csc" task has not registered its resources. In order to use the "TaskLoggingHelper.FormatResourceString()" m
ethod this task needs to register its resources either during construction, or via the "TaskResources" property. [/Users/stmaclea/
git/issue48902/Sol/C/C.csproj]
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Roslyn/Microsoft.CSharp.Core.targets(71,5): error MSB4018: at Microsoft.B
uild.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args) [/Users/stmaclea/git/issue48902/Sol/C/C.cspro
j]
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Roslyn/Microsoft.CSharp.Core.targets(71,5): error MSB4018: at Microsoft.B
uild.Shared.ErrorUtilities.VerifyThrowInvalidOperation(Boolean condition, String resourceName, Object arg0) [/Users/stmaclea/git/i
ssue48902/Sol/C/C.csproj]
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Roslyn/Microsoft.CSharp.Core.targets(71,5): error MSB4018: at Microsoft.B
uild.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args) [/Users/stmaclea/git/issue48902/Sol/C/C.
csproj]
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Roslyn/Microsoft.CSharp.Core.targets(71,5): error MSB4018: at Microsoft.B
uild.Utilities.TaskLoggingHelper.LogErrorWithCodeFromResources(String subcategoryResourceName, String file, Int32 lineNumber, Int3
2 columnNumber, Int32 endLineNumber, Int32 endColumnNumber, String messageResourceName, Object[] messageArgs) [/Users/stmaclea/git
/issue48902/Sol/C/C.csproj]
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Roslyn/Microsoft.CSharp.Core.targets(71,5): error MSB4018: at Microsoft.B
uild.Utilities.TaskLoggingHelper.LogErrorWithCodeFromResources(String messageResourceName, Object[] messageArgs) [/Users/stmaclea/
git/issue48902/Sol/C/C.csproj]
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Roslyn/Microsoft.CSharp.Core.targets(71,5): error MSB4018: at Microsoft.C
odeAnalysis.BuildTasks.ManagedCompiler.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [/U
sers/stmaclea/git/issue48902/Sol/C/C.csproj]
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Roslyn/Microsoft.CSharp.Core.targets(71,5): error MSB4018: at Microsoft.B
uild.Utilities.ToolTask.Execute() [/Users/stmaclea/git/issue48902/Sol/C/C.csproj]
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Roslyn/Microsoft.CSharp.Core.targets(71,5): error MSB4018: at Microsoft.B
uild.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/Users/stmaclea/git/issue48902/Sol/C/C.csproj
]
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Roslyn/Microsoft.CSharp.Core.targets(71,5): error MSB4018: at Microsoft.B
uild.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, Task
Host taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/Users/stmaclea/git/issue48902/Sol/C/C.csproj]
A -> /Users/stmaclea/git/issue48902/Sol/A/bin/Debug/net6.0/osx-arm64/A.dll
You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
A -> /Users/stmaclea/git/issue48902/Sol/A/bin/Debug/net6.0/osx-arm64/publish/
B -> /Users/stmaclea/git/issue48902/Sol/B/bin/Debug/net6.0/osx-arm64/B.dll
B -> /Users/stmaclea/git/issue48902/Sol/B/bin/Debug/net6.0/osx-arm64/publish/
18 I think this
Should be
|
That stack above looks like dotnet/msbuild#6253 |
I ran this a few more times with preview3 and with the script modified as above. I saw a total of 22 failures in 1026 publish runs.
I guess I'll try with a recent daily build with:
Maybe that will help root cause the issue |
Note that dotnet/msbuild#6253 here is just causing an exception while it's trying to log a (?fatal) compiler error. So it's quite possible it's a NRE in Roslyn, for example. (cc @jaredpar to correct me, as I see he's tracked that issue) |
Per linked issue, the Csc task problem is fixed in latest SDK builds. |
@sdmaclea Yep, it was a typo. I used |
@sdmaclea I see a similar random NullReferenceException in MSBuild and Roslyn, when I try to compile code on my M1 Mac Mini. |
@mfilippov yeah this is not related to publish specifically. Its an intermittent failure within the runtime. |
@mangod9 Any news about this issue? It is a painful problem for Apple M1 workloads. |
we continue to investigate, unfortunately havent been able to get it to repro under a debugger. |
Think it's pretty likely that this is a duplicate of #53420. |
@mfilippov we investigated and this seems to be fixed with a change in preview6: #53510. Could you please check if it still fails on preview6? |
Failed again in runtime-coreclr r2r 20210721.1 Failed test:
One of error messages:
|
This will continue to fail in CI till we update the sdk in the runtime to preview6. Notice that it only fails with crossgen2 since it uses the preview4 sdk at the moment (not the live one) |
@mangod9 @janvorli Hi! After upgrading to
(full log is here dotnet_2021-07-27-014106.crash.txt) and output is:
(full log is here dotnet_2021-07-27-100601.crash.txt) w/o output. |
Ok, thanks for checking. Jan recently also fixed another issue which might be contributing to this, so that should be included in rc1. |
Failed again in runtime-coreclr r2r 20210731.1 Failed test:
Error message:
|
preview6 sdk should merge on 8/2. Hoping that would resolve this issue. |
I am going to close this issue now that preview6 sdk has merged into the runtime repo. The other issues are possibly fixed by #56059. Else we can open a new issue if the issue persists in rc1. Thanks for your patience while we investigated the long running issue. |
Steps to reproduce the same as for #48902, tested with
dotnet-sdk-6.0.100-preview.3.21202.5-osx-arm64
on macOS 11.3 Beta 7 (see #48902 (comment)):, or
, or
, or
, or
, or
The text was updated successfully, but these errors were encountered: