You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Segmentation Fault on .NET 5 build for standalone for ARM #41421
This bug is reproduceable on any version of .NET 5 after preview 6.
Build a standalone executable for Linux ARM, and use the produce single file option
It will give segmentation fault at the point on your code you instantiate a new TcpListener class. It works fine if you try on windows x64.
This is the line at where you will see it:
_listener=newTcpListener(address,port);
If you use the TRIM within the produce single file, it misses some assemblies that are used for webclient (given the same settings from before). This won't work even when trying on windows x64.
Configuration
Which version of .NET is the code running on?
.NET 5 Preview 8 (can use any version after Preview 6)
What OS and version, and what distro if applicable?
Archlinux latest version
What is the architecture (x64, x86, ARM, ARM64)?
ARM
Do you know whether it is specific to that configuration?
It won't work on ARM but works fine on Windows x64 (but will fail if TRIM is used)
Regression?
Did this work in a previous build or release of .NET Core, or from .NET Framework?
Yes it worked on all versions before preview 7.
I don't think so, in dotnet 5 we formed a v-team that has been working on making sure our framework is linker-friendly so we've been adding annotations on the framework and I just want to make sure that this issue doesn't mean that we missed one. We can take a look.
@shadowfox87 are you able to get a dump of that so that we can check the managed callstack to see what is the problem here? I tried reproing this using the Preview 8 bits on a RaspberryPi but didn't have any luck. This is the code that I tried:
I published that for linux-arm and published it Trimmed and single file. I can validate that the linker is in fact running and trimming some assemblies. The result runs fine for me on my Raspberry Pi. Can you send more info regarding repro steps as well as a full code snippet of what you are doing to reproduce this issue?
Can you confirm which version of the SDK are you using? to figure this out try running dotnet --list-sdks and dotnet --version as it may be that what you are hitting is already addressed by an annotation that was added later.
Agreed - please open a new issue if there's are still issues with the latest .NET 5 (on any platform).
I also just realized that running dotnet new is not related to single-file, so if that crashed it's definitely a different issue than the one described above.
Thanks for considering this.
Installation is by tarring arm64.tar.gz from the dotnet arm64 site
I've investigated further and got the following observations:
TLDR:
Latest arm64 package (dotnet-sdk-5.0.103-linux-arm64.tar.gz) doesn’t cause segmentation fault anymore when dotnet new is executed. However, build is failing without giving info.
Exhibit A
dotnet-sdk-5.0.103: segmentation fault during dotnet new is gone, but build is failing w/o info
Exhibit B
Previous version of .NET 5.0 that was working
Perhaps, segmentation fault is already resolved (or might be hiding since build failure is not showing).
Anyway, let me know if you or your team need further info.
I'm really looking forward to use the latest .NET 5.0 on my arm64 device.
Activity
joperezr commentedon Aug 27, 2020
cc: @eerhardt this sounds like we are missing an annotation on System.Net.Sockets causing us to trim things that we shouldn't be trimming.
joperezr commentedon Aug 27, 2020
if it is indeed a missing annotation, then we probably will want to take this for 5.0
karelz commentedon Aug 27, 2020
@joperezr is it something we (Networking team) should help with?
joperezr commentedon Aug 27, 2020
I don't think so, in dotnet 5 we formed a v-team that has been working on making sure our framework is linker-friendly so we've been adding annotations on the framework and I just want to make sure that this issue doesn't mean that we missed one. We can take a look.
joperezr commentedon Aug 27, 2020
@shadowfox87 are you able to get a dump of that so that we can check the managed callstack to see what is the problem here? I tried reproing this using the Preview 8 bits on a RaspberryPi but didn't have any luck. This is the code that I tried:
I published that for linux-arm and published it Trimmed and single file. I can validate that the linker is in fact running and trimming some assemblies. The result runs fine for me on my Raspberry Pi. Can you send more info regarding repro steps as well as a full code snippet of what you are doing to reproduce this issue?
HKunogi commentedon Aug 27, 2020
If unmark the Produce single file, it stops giving the issue and works fine.
Also, if trim unused assemblies is marked, gives this issue:
shadowfox87 commentedon Aug 27, 2020
@joperezr I can confirm the answer above. If you need any further information, @HKunogi can answer.
joperezr commentedon Aug 27, 2020
Can you confirm which version of the SDK are you using? to figure this out try running
dotnet --list-sdksanddotnet --versionas it may be that what you are hitting is already addressed by an annotation that was added later.22 remaining items
karelz commentedon Feb 10, 2021
@vitek-karas what would be next step here?
Where should we route the issue?
vitek-karas commentedon Feb 10, 2021
We would need more information about the crash. I haven't seen this repro anywhere (can't try right now, I don't have ARM64 machine handy).
karelz commentedon Feb 10, 2021
Perhaps closing then? Until there is more info available?
vitek-karas commentedon Feb 10, 2021
Agreed - please open a new issue if there's are still issues with the latest .NET 5 (on any platform).
I also just realized that running
dotnet newis not related to single-file, so if that crashed it's definitely a different issue than the one described above.whatevergeek commentedon Feb 11, 2021
what other info you need? I was able to reproduce it on ARM aarch64... i'm running debian on userland...
vitek-karas commentedon Feb 11, 2021
Thanks for more info @whatevergeek :
dotnet --info)dotnet new consoleor something more involved?I'll ask somebody to repo it (I don't have ARM64 available at home unfortunately.. yet).
whatevergeek commentedon Feb 11, 2021
hi @vitek-karas ,
Thanks for considering this.
Installation is by tarring arm64.tar.gz from the dotnet arm64 site
I've investigated further and got the following observations:
TLDR:
Latest arm64 package (dotnet-sdk-5.0.103-linux-arm64.tar.gz) doesn’t cause segmentation fault anymore when
dotnet newis executed. However, build is failing without giving info.Exhibit A
dotnet-sdk-5.0.103: segmentation fault during
dotnet newis gone, but build is failing w/o infoExhibit B
Previous version of .NET 5.0 that was working
Perhaps, segmentation fault is already resolved (or might be hiding since build failure is not showing).
Anyway, let me know if you or your team need further info.
I'm really looking forward to use the latest .NET 5.0 on my arm64 device.
vitek-karas commentedon Feb 16, 2021
@whatevergeek if I understand it correctly this is happening on Linux running in userland (as in https://userland.tech/), right? That is a configuration we don't test as far as I know, so it's not surprising it doesn't work. Feel free to create a new issue to request support for this configuration.
whatevergeek commentedon Feb 17, 2021
hi @vitek-karas ,
That's correct. I'm using linux via userland.
Thanks for the consideration.
I've opened a new issue for this request: #48389