I have downloaded .NET Core SDK for linux ARM64 on my Jetson TX2 running ubuntu 16.04.
nvidia@tegra-ubuntu:~$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.1.302
Commit: 9048955601
Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-arm64
Base Path: /usr/share/dotnet/sdk/2.1.302/
Host (useful for support):
Version: 2.1.2
Commit: 811c3ce6c0
.NET Core SDKs installed:
2.1.302 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.NETCore.App 2.1.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
nvidia@tegra-ubuntu:~$
However I am unable to run any dotnet application (even the hello world example) on my Jetson TX2.
nvidia@tegra-ubuntu:~$ dotnet new console -o myApp --force
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on myApp/myApp.csproj...
Restoring packages for /home/nvidia/myApp/myApp.csproj...
Generating MSBuild file /home/nvidia/myApp/obj/myApp.csproj.nuget.g.props.
Generating MSBuild file /home/nvidia/myApp/obj/myApp.csproj.nuget.g.targets.
Restore completed in 1.58 sec for /home/nvidia/myApp/myApp.csproj.
Restore succeeded.
nvidia@tegra-ubuntu:~/myApp$ dotnet run
/usr/share/dotnet/sdk/2.1.302/Roslyn/Microsoft.CSharp.Core.targets(52,5): error MSB6006: "csc.dll" exited with code 139. [/home/nvidia/myApp/myApp.csproj]
The build failed. Please fix the build errors and run again.
I wish to build iotedge for Jetson TX2 and dotnet Core 2.1 is a dependency for the same.
This is my binary log file. I had to rename it with a .zip extension to upload here.
just rename the file from msbuild.binlog.zip to msbuild.binlog
Adding info from the Roslyn issue:
This currently has not been investigated. For a work around to this issue please use the dotnet core 2.2 aarch64 preview release in place of dotnet core 2.1 for aarch64.
The latest preview of 2.2 can be found https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.2.1xx/dotnet-sdk-latest-linux-arm64.tar.gz. If the link no longer works see: https://github.com/dotnet/core-sdk for more downloads.
Please feel free to target netcoreapp2.1, just use the newer runtime.
Currently the dotnet core 3.0 preview is broken due to https://github.com/dotnet/coreclr/issues/19805. Once it is fixed I will update with a link and suggest using the 3.0 preview.
I tried this version and it didn't work for me: 2.2.100-preview2-009404/Roslyn/Microsoft.CSharp.Core.targets(52,5): error MSB6006: "csc.dll" exited with code 139. Preview 3 wouldn't get as far and broke on an unrelated parsing error.
@pellet Can you provide more details about your platform so that I can know if we have the same issue or not?
P.S. I am not working on this anymore but would like to keep track of the issue for the future.
@gauravagarwal28 sure it's ubuntu 16 arm64. I've switched to using mono for the time being.
The problem still exists on 2.1.402 and 2.2.100-preview3-009423.
But the problem doesn't exist on sdk 3.0.100-alpha1-009630 (host: 3.0.0-preview1-26928-03).
Here is mine testcase:
rock64@rock64:~/dev$ dotnet new console -o myApp --force
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on myApp/myApp.csproj...
Restoring packages for /home/rock64/dev/myApp/myApp.csproj...
Generating MSBuild file /home/rock64/dev/myApp/obj/myApp.csproj.nuget.g.props.
Generating MSBuild file /home/rock64/dev/myApp/obj/myApp.csproj.nuget.g.targets.
Restore completed in 4.37 sec for /home/rock64/dev/myApp/myApp.csproj.
Restore succeeded.
rock64@rock64:~/dev/myApp$ dotnet run
/home/rock64/dotnet/sdk/2.1.402/Roslyn/Microsoft.CSharp.Core.targets(52,5): error MSB6006: "csc.dll" exited with code 139. [/home/rock64/dev/myApp/myApp.csproj]
The build failed. Please fix the build errors and run again.
rock64@rock64:~/dev/myApp$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.1.402
Commit: 3599f217f4
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-arm64
Base Path: /home/rock64/dotnet/sdk/2.1.402/
Host (useful for support):
Version: 2.1.4
Commit: 85255dde3e
.NET Core SDKs installed:
2.1.402 [/home/rock64/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.NETCore.App 2.1.4 [/home/rock64/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
I installed preview version of dotnet:
rock64@rock64:~/dev/myApp2$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.2.100-preview3-009423
Commit: 559795b616
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-arm64
Base Path: /home/rock64/dotnet/sdk/2.2.100-preview3-009423/
Host (useful for support):
Version: 2.2.0-preview3-27002-02
Commit: 525082ca3e
.NET Core SDKs installed:
2.2.100-preview3-009423 [/home/rock64/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.NETCore.App 2.2.0-preview3-27002-02 [/home/rock64/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
rock64@rock64:~/dev$ dotnet new console -o myApp2 --force
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). For establishing trust on other platforms refer to the platform specific documentation.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
Getting ready...
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on myApp2/myApp2.csproj...
Restoring packages for /home/rock64/dev/myApp2/myApp2.csproj...
/home/rock64/dev/myApp2/myApp2.csproj : error NU1102: Unable to find package Microsoft.NETCore.App with version (>= 2.2.0-preview3-27002-02)
/home/rock64/dev/myApp2/myApp2.csproj : error NU1102: - Found 43 version(s) in nuget.org [ Nearest version: 2.2.0-preview2-26905-02 ]
Generating MSBuild file /home/rock64/dev/myApp2/obj/myApp2.csproj.nuget.g.props.
Generating MSBuild file /home/rock64/dev/myApp2/obj/myApp2.csproj.nuget.g.targets.
Restore failed in 3.74 sec for /home/rock64/dev/myApp2/myApp2.csproj.
Restore failed.
Post action failed.
Description: Restore NuGet packages required by this project.
Manual instructions: Run 'dotnet restore'
rock64@rock64:~/dev$ cd myApp2
rock64@rock64:~/dev/myApp2$ dotnet run
/home/rock64/dev/myApp2/myApp2.csproj : error NU1102: Unable to find package Microsoft.NETCore.App with version (>= 2.2.0-preview3-27002-02)
/home/rock64/dev/myApp2/myApp2.csproj : error NU1102: - Found 43 version(s) in nuget.org [ Nearest version: 2.2.0-preview2-26905-02 ]
The build failed. Please fix the build errors and run again.
@olgierdd as for the package restoration issue, the arm64 2.2 packages for the runtime you are using are not on nuget yet. You need to add NuGet.Config file with the following contents next to your .csproj:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="myget" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
</packageSources>
</configuration>
The same is tru in case you'd like to try the 3.0 SDK nightly builds.
I concur with @hez2010 . I still have the issue with 2.2.100-preview3-009423, but not 3.0.100-alpha1-009640
@janvorli Thenks for helpful hint. I was able to restore packages, but compilation still does not work.
rock64@rock64:~/dev/myApp5$ dotnet restore
Restoring packages for /home/rock64/dev/myApp5/myApp5.csproj...
Installing Microsoft.NETCore.DotNetAppHost 2.2.0-preview3-27002-02.
Installing Microsoft.NETCore.DotNetHostResolver 2.2.0-preview3-27002-02.
Installing Microsoft.NETCore.DotNetHostPolicy 2.2.0-preview3-27002-02.
Installing Microsoft.NETCore.Platforms 2.2.0-preview3-27002-02.
Installing Microsoft.NETCore.Targets 2.0.0.
Installing Microsoft.NETCore.App 2.2.0-preview3-27002-02.
Generating MSBuild file /home/rock64/dev/myApp5/obj/myApp5.csproj.nuget.g.props.
Generating MSBuild file /home/rock64/dev/myApp5/obj/myApp5.csproj.nuget.g.targets.
Restore completed in 8.85 sec for /home/rock64/dev/myApp5/myApp5.csproj.
rock64@rock64:~/dev/myApp5$ dotnet run
/home/rock64/dotnet/sdk/2.2.100-preview3-009423/Roslyn/Microsoft.CSharp.Core.targets(52,5): error MSB6006: "csc.dll" exited with code 139. [/home/rock64/dev/myApp5/myApp5.csproj]
The build failed. Please fix the build errors and run again.
rock64@rock64:~/dev/myApp5$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.2.100-preview3-009423
Commit: 559795b616
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-arm64
Base Path: /home/rock64/dotnet/sdk/2.2.100-preview3-009423/
Host (useful for support):
Version: 2.2.0-preview3-27002-02
Commit: 525082ca3e
.NET Core SDKs installed:
2.2.100-preview3-009423 [/home/rock64/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.NETCore.App 2.2.0-preview3-27002-02 [/home/rock64/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
I confirm dotnet core 3.0.100-alpha1-009640 works on ROCK64 ARM64. Good job.
rock64@rock64:~/dev$ dotnet new console -o myApp6
rock64@rock64:~/dev/myApp6$ dotnet run
Hello World!
rock64@rock64:~/dev/myApp6$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100-alpha1-009640
Commit: 0e75592c43
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-arm64
Base Path: /home/rock64/dotnet/sdk/3.0.100-alpha1-009640/
Host (useful for support):
Version: 3.0.0-preview1-27004-04
Commit: 35a0b3f880
.NET Core SDKs installed:
3.0.100-alpha1-009640 [/home/rock64/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.NETCore.App 3.0.0-preview1-27004-04 [/home/rock64/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
I still see this problem in 2.1.403:
.NET Core SDK (reflecting any global.json):
Version: 2.1.403
Commit: 04e15494b6
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-arm64
Base Path: /home/rido/dotnet/sdk/2.1.403/
Host (useful for support):
Version: 2.1.5
Commit: 290303f510
.NET Core SDKs installed:
2.1.403 [/home/rido/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.NETCore.App 2.1.5 [/home/rido/dotnet/shared/Microsoft.NETCore.App]
Build fails with:
/home/rido/dotnet/sdk/2.1.403/Roslyn/Microsoft.CSharp.Core.targets(52,5): error MSB6006: "csc.dll" exited with code 139. [/home/rido/code/MyCoreConsole/MyCoreConsole.csproj]
I'm getting the same issue with the GA bits .NET Core 2.2 for ARM64 (dotnet-sdk-2.2.100-linux-arm64.tar.gz)
As others noted, I can run .net core DLLs that were built elsewhere (including local Windows machine), but not do a "dotnet build":
Restoring packages for /home/ubuntu/armconsole22/armconsole22.csproj...
Restore completed in 393.98 ms for /home/ubuntu/armconsole22/armconsole22.csproj.
/opt/dotnet/sdk/2.2.100/Roslyn/Microsoft.CSharp.Core.targets(52,5): error MSB6006: "csc.dll" exited with code 139. [/home/ubuntu/armconsole22/armconsole22.csproj]
I did the build with /bl on, and pulled down the msbuild.binlog file to my Windows 10 laptop.
The error shows up in the MSBuild Log Viewer, the Task is Csc, with following nodes:
Or if someone wants to the msbuild.binlog file itself, I'm more than happy to stick it up on an S3 bucket or something.
I am also receiving this error when trying to simply do the Hello World tutorial.
jeff@rock64:~/Programs/myApp$ dotnet run
/home/jeff/dotnet/sdk/2.2.100/Roslyn/Microsoft.CSharp.Core.targets(52,5): error MSB6006: "csc.dll" exited with code 139. [/home/jeff/Programs/myApp/myApp.csproj]
The build failed. Please fix the build errors and run again.
Armbian Ubunto 18.04 build.
Linux rock64 4.4.162-rockchip64 dotnet/coreclr#1 SMP Fri Oct 26 21:02:58 CEST 2018 aarch64 aarch64 aarch64 GNU/Linux
Used the precompiled dotnet-sdk-2.2.100-linux-arm64.tar.gz
Also tested the "latest" 2.2, which happened to be 2.2.101-rtm-009628, but the build failed with the same MSB6006 error.
3.0.100-preview-009820 seems to have the problem fixed, but it would be good to have it fixed in 2.2...
I also got same error 'error MSB6006: "csc.dll" exited with code 139' on arm64 (dotnet-sdk-2.2.100-linux-arm64.tar.gz)
root@odroid-stretch64:/opt/webapp2# dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.2.100
Commit: b9f2fa0ca8
Runtime Environment:
OS Name: debian
OS Version: 9
OS Platform: Linux
RID: debian.9-arm64
Base Path: /usr/share/dotnet/sdk/2.2.100/
Host (useful for support):
Version: 2.2.0
Commit: 1249f08fed
.NET Core SDKs installed:
2.2.100 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.NETCore.App 2.2.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
root@odroid-stretch64:/opt/webapp2# dotnet publish -c release
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 262.96 ms for /opt/webapp2/webapp2.csproj.
/usr/share/dotnet/sdk/2.2.100/Roslyn/Microsoft.CSharp.Core.targets(52,5): error MSB6006: "csc.dll" exited with code 139. [/opt/webapp2/webapp2.csproj]
`
I can confirm I ran repro it reliably on my Raspberry PI 3 with aarch64 arch linux. From the first look at the stack trace it looks like a GC hole. I will look into it.
I've found what's wrong. It is not a GC hole, but rather a JIT bug when accessing Nullable<System.Security.Cryptography.HashAlgorithmName> argument in Microsoft.CodeAnalysis.Emit.EmitOptions..ctor(Boolean, Microsoft.CodeAnalysis.Emit.DebugInformationFormat, System.String, System.String, Int32, UInt64, Boolean, Microsoft.CodeAnalysis.SubsystemVersion, System.String, Boolean, Boolean, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind>, System.Nullable<System.Security.Cryptography.HashAlgorithmName>)
If I recall it correctly, Nullable<T> type arguments should be passed as boxed T arguments, it means null if the nullable was empty or boxed T if it was not. However, the caller passes it as a byte (Nullable<T>.hasValue) immediately followed by T (the T goes at address of the hasValue + 1).
And the Microsoft.CodeAnalysis.Emit.EmitOptions..ctor tries to read it as if it was a byte (Nullable<T>.hasValue) followed by T at address of the hasValue + 8.
So both caller and callee are doing it wrong.
The relevant part of the callee code looks like this:
0000ffff3f3de8a0 a0630191 add x0, x29, #0x58 <<< Arg location Nullable<System.Security.Cryptography.HashAlgorithmName>
^^^^^^^^^^^^^^^^ The value at that location contains byte 0x01 followed by eight bytes of the System.Security.Cryptography.HashAlgorithmName
0000ffff3f3de8a4 0b004039 ldrb w11, [x0]
0000ffff3f3de8a8 ab630039 strb w11, [x29, #0x18] <<< local Nullable<System.Security.Cryptography.HashAlgorithmName> (hasValue )
0000ffff3f3de8ac 000440f9 ldr x0, [x0, #0x8]
0000ffff3f3de8b0 a01300f9 str x0, [x29, #0x20] <<< local Nullable<System.Security.Cryptography.HashAlgorithmName> (the value)
And the relevant part of the code of the caller (Microsoft.CodeAnalysis.CSharp.CSharpCommandLineParser.Parse(System.Collections.Generic.IEnumerable<System.String>, System.String, System.String, System.String)):
0000ffff3fcf9844 e0a30039 strb w0, [sp, #0x28] <<< This is the 'hasValue' member
0000ffff3fcf9848 eb9302f8 stur x11, [sp, #0x29] <<< This is the actual value
0000ffff3fcf984c e00317aa mov x0, x23
0000ffff3fcf9850 abc340f9 ldr x11, [x29, #0x180]
0000ffff3fcf9854 eb0300f9 str x11, [sp]
0000ffff3fcf9858 cbcffff0 adrp x11, -1541
0000ffff3fcf985c 6b413d91 add x11, x11, #0xf50
0000ffff3fcf9860 030080d2 mov x3, #0x0
0000ffff3fcf9864 040080d2 mov x4, #0x0
0000ffff3fcf9868 c9cffff0 adrp x9, -1541
0000ffff3fcf986c 29413d91 add x9, x9, #0xf50
0000ffff3fcf9870 290140f9 ldr x9, [x9]
0000ffff3fcf9874 20013fd6 blr x9
Due to this issue, the call to Microsoft.CodeAnalysis.Emit.EmitOptions::set_PdbChecksumAlgorithm at the end of the constructor sets the PdbChecksumAlgorithm property to a garbage value instead of a valid string reference.
I've debugged it with 2.2.101-rtm-009628 release of the .NET core SDK (coreclr commit 418e094916).
cc @dotnet/jit-contrib, @jashook
I think Nullable<T> is just an ordinary struct from an ABI standpoint. So would hazard a guess that the caller is wrong here and the callee is ok?
This should repro for any Nullable<T> passed as the last of a large number of arguments (enough to exhaust all the register slots and force the nullable to be passed on the stack).
Nullable<T>type arguments should be passed as boxedTarguments, it means null if the nullable was empty or boxed T if it was not.
That is not correct.
I think
Nullable<T>is just an ordinary struct from an ABI standpoint.
That is correct.
Ah, I got mislead by the reflection code - what I've said is true only for "this" reference.
@AndyAyersMS just in case you've missed that from the conversation above, the issue is fixed in master, so it would be great to figure out which commit was the cure and port it to 2.2.
Looked for likely PRs but nothing looked exactly like this. I would have to do some digging. Before I do that let me see if anyone else recognizes this issue with passing or receiving (potentially odd-sized) structs as memory args on Arm64.
@dotnet/arm64-contrib does the above ring any bells? Something that got fixed in the past few months?
We don't support ARM64 in 2.x (https://github.com/dotnet/coreclr/issues/19843), so do we need to keep this issue open?
Agree -- given that ARM64 is not supported in 2.2, I think we should close this.
I have the same issue on Ubuntu 18.04-ARM64.

Most helpful comment
The problem still exists on 2.1.402 and 2.2.100-preview3-009423.
But the problem doesn't exist on sdk 3.0.100-alpha1-009630 (host: 3.0.0-preview1-26928-03).