dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.06k stars 4.69k forks source link

embedded linux-arm dotnet 6/7 segmentation fault #85895

Open BennyBread opened 1 year ago

BennyBread commented 1 year ago

Is there an existing issue for this?

Describe the bug

We have an embedded linux system on which dotnet5 runs without problems.

I tried to upgrade to dotnet 6 or 7 but the newer dotnet versions do not run.

When I try to start dotnet it cashes:

root@dev:/dotnet-7# ./dotnet
Segmentation fault (core dumped)
root@dev:/dotnet-7#

dotnet-6 and dotnet-7 both produce the same output.

All the dotnet Versions where downloaded from official site:

aspnetcore-runtime-5.0.17-linux-arm.tar.gz aspnetcore-runtime-6.0.13-linux-arm.tar.gz aspnetcore-runtime-7.0.2-linux-arm.tar.gz

dotnet5 runs without problems:


root@dev:/# dotnet --info

Host (useful for support):
  Version: 5.0.17
  Commit:  6a98414363

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.17 [/deprag/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.17 [/deprag/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
root@dev:/dotnet-7#

dotnet --info does of course also not run at all.

We'd really highly appreciate it to upgrade to dotnet 7...

Expected Behavior

dotnet executable and the "user programs" runs on the system..

Steps To Reproduce

When I start dotnet 6 or 7 using gdb I get this output:

root@dev:/dotnet-7# gdb ./dotnet
GNU gdb (Linaro GDB) 7.8-2014.09
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.linaro.org>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./dotnet...(no debugging symbols found)...done.
(gdb)
(gdb) r
Starting program: /deprag/dotnet-7/dotnet
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?

Program received signal SIGSEGV, Segmentation fault.
0xb6fdf004 in relocate_pc24 (value=value@entry=0, addend=<optimized out>, map=0xb6fff958)
    at ../sysdeps/arm/dl-machine.h:338
338     ../sysdeps/arm/dl-machine.h: No such file or directory.
(gdb)
(gdb)

Exceptions (if any)

No response

.NET Version

dotnet 6 and 7

Anything else?

Some linux system details:

uname --a Linux dev 4.4.19-gdb0b54cdad dotnet/aspnetcore#54 PREEMPT Fri Dec 9 20:51:56 CET 2016 armv7l GNU/Linux

glibc version is 2.21

cat /proc/cpuinfo processor : 0 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 48.00 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x2 CPU part : 0xc0f CPU revision : 4

Hardware : Keystone Revision : 0000 Serial : 0000000000000000

lspci: 00:00.0 PCI bridge: Texas Instruments Device b00b (rev 01)

free -m total used free shared buff/cache available Mem: 1512 129 593 68 790 1288 Swap: 0 0 0

mitchdenny commented 1 year ago

@BennyBread this is almost certainly something on the runtime side of the fence rather than ASP.NET, can you confirm that you are just trying to invoke the dotnet executable and there is no ASP.NET code involved yet? (that is what it looks like from the command-line invocations listed above).

BennyBread commented 1 year ago

@mitchdenny There is no user code involved at all. I'm only try to run the dotnet command without any parameters.

dotnet 5 executable runs with no problems on the system. net6 and 7 does not. Is there any possibility to find out what's missing on that system? (I'ts an embedded system on a controller we sell)

mitchdenny commented 1 year ago

OK, I'm going to transfer this to to dotnet/runtime since this is more there area.

jeffschwMSFT commented 1 year ago

@mangod9

mangod9 commented 1 year ago

Hello @BennyBread, what distro are you trying this on? Are you able to provide a dump to investigate further? Thx!

BennyBread commented 1 year ago

@mangod9 It's an distro from TI K2G with some minor changes in the kernel. I can provide a gdb coredump, uploaded it here: gdb core dump Hope this helps.

jaelys commented 10 months ago

I have the same problem, different development versions, and .NET 8 is currently the same problem. Are there any progress or news?

Or should I give up using .NET development

embedded linux-arm?

/lib # ./libc.so.6
GNU C Library (GNU libc) stable release version 2.29.
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 7.3.0.
libc ABIs: UNIQUE ABSOLUTE
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
/lib # cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 48.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5
RockNHawk commented 8 months ago

I have same error after a fresh installation (both liunux system & .net core 7 is new installed)

`

xxx@xxx-uos-arm:~$ wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh xxx@xxx-uos-arm:~$ chmod +x ./dotnet-install.sh xxx@xxx-uos-arm:~$ ./dotnet-install.sh --channel 7.0 dotnet-install: Attempting to download using aka.ms link https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.405/dotnet-sdk-7.0.405-linux-arm64.tar.gz dotnet-install: Installation finished successfully. xxx@xxx-uos-arm:~$ dotnet 段错误 xxx@xxx-uos-arm:~$ dotnet --list-sdks 段错误 xxx@xxx-uos-arm:~$ uname -a Linux xxx-uos-arm 4.19.0-arm64-desktop #6108 SMP Wed Sep 13 13:46:40 CST 2023 aarch64 GNU/Linux xxx@xxx-uos-arm:~$

`