Skip to content
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

.NET runtime on RPI - Segmentation fault #3013

Closed
florrain opened this issue Jan 21, 2018 · 23 comments
Closed

.NET runtime on RPI - Segmentation fault #3013

florrain opened this issue Jan 21, 2018 · 23 comments

Comments

@florrain
Copy link

Steps to reproduce

  • Install the runtime on a Raspberry PI 2 model B, Raspbian Lite:
  • sudo apt-get install curl libunwind8 gettext
  • curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.0.0/dotnet-runtime-latest-linux-arm.tar.gz
  • sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
  • sudo ln -s /opt/dotnet/dotnet /usr/local/bin

Expected behavior

The runtime should run with no segfault.

Actual behavior

$ dotnet
Segmentation fault

Whatever the options passed to the executable are, it always gives a segfault. Tried on Raspbian and on DietPi.

Environment data

I'm not sure what would be valuable for debugging so please tell me.

@Petermarcu
Copy link
Member

There is a decent chance this is because you don't have to the required apt-get packages installed. Take a look here to see the list of packages you should add to your list in your initial apt-get command. They names of the packages may vary slightly depending on distro.

https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x

@Petermarcu
Copy link
Member

In case you didn't see it, there are some instructions for all this here as well for the next steps which would be to get an app you built copied over. https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md

@florrain
Copy link
Author

HI Peter! Thanks for the help.

I just re-installed a fresh Raspbian Lite, ran a apt-get update && apt-get upgrade && apt-get dist-upgrade and right away tried to install the runtime again. Then I tried installing all the dependencies I could find on multiple articles and Github docs, with no luck.

First your prerequisites link, Ubuntu section deps:

pi@raspberrypi:~ $ sudo apt-get install libunwind8 liblttng-ust0 libcurl3 libssl1.0.0 libuuid1 libkrb5-3 zlib1g libicu52 libicu55 libicu57
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libssl1.0.0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libssl1.0.0' has no installation candidate
E: Unable to locate package libicu52
E: Unable to locate package libicu55

I noticed a couple of posts mentioning an issue with the libssl library, which I can't install in version 1.0.0. I do have version 1.0.2 though.

pi@raspberrypi:~ $ sudo apt-get install libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libssl-dev is already the newest version (1.1.0f-3+deb9u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ sudo apt-get install libssl1.0.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
libssl1.0.2 is already the newest version (1.0.2l-2+deb9u2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Then I found a couple other resources:
dotnet/core#447
https://www.leowkahman.com/2017/07/16/running-dotnet-core-on-raspberry-pi-raspbian/
https://github.com/dotnet/dotnet-docker/blob/master/2.0/runtime-deps/stretch/arm32v7/Dockerfile

pi@raspberrypi:~/Downloads $ sudo apt-get install libc6 libcurl3 libgcc1 libgssapi-krb5-2 libicu57 liblttng-ust0 libssl1.0.2 libstdc++6 libunwind8 libuuid1 zlib1g
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6 is already the newest version (2.24-11+deb9u1).
libcurl3 is already the newest version (7.52.1-5+deb9u3).
libcurl3 set to manually installed.
libgcc1 is already the newest version (1:6.3.0-18+rpi1).
libgssapi-krb5-2 is already the newest version (1.15-1+deb9u1).
libgssapi-krb5-2 set to manually installed.
libicu57 is already the newest version (57.1-6+deb9u1).
libicu57 set to manually installed.
liblttng-ust0 is already the newest version (2.9.0-2).
liblttng-ust0 set to manually installed.
libssl1.0.2 is already the newest version (1.0.2l-2+deb9u2).
libstdc++6 is already the newest version (6.3.0-18+rpi1).
libunwind8 is already the newest version (1.1-4.1).
libuuid1 is already the newest version (2.29.2-1).
zlib1g is already the newest version (1:1.2.8.dfsg-5).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~/Downloads $ dotnet
Segmentation fault

@florrain
Copy link
Author

gdb doesn't help much, seems like the issue happens very early during the bin execution.

pi@raspberrypi:~ $ gdb dotnet
(gdb) run
Starting program: /usr/local/bin/dotnet
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0006011e in ?? ()
(gdb) backtrace
#0  0x0006011e in ?? ()
dotnet/core-setup#1  0x00010f6a in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) where
#0  0x0006011e in ?? ()
dotnet/core-setup#1  0x00010f6a in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) list
1	../sysdeps/unix/sysv/linux/arm/dl-procinfo.c: No such file or directory.
(gdb)

@Petermarcu
Copy link
Member

@janvorli any other thoughts on how to diagnose?

@Petermarcu
Copy link
Member

Can you try running with strace and see if that gives any hints around anything that may be trying to get loaded but can't be found? That would help rule out dependencies. Also, can you share the output of cat /etc/*-release?

@florrain
Copy link
Author

Sure here's the output of strace and the content of the release file.

pi@pi2:~ $ strace dotnet
execve("/usr/local/bin/dotnet", ["dotnet"], [/* 20 vars */]) = 0
brk(NULL)                               = 0x78d000
uname({sysname="Linux", nodename="pi2", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fd3000
access("/etc/ld.so.preload", R_OK)      = 0
open("/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=42, ...}) = 0
mmap2(NULL, 42, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0xb6fd2000
close(3)                                = 0
open("/usr/lib/arm-linux-gnueabihf/libarmmem.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\210\5\0\0004\0\0\0"..., 512) = 512
lseek(3, 20868, SEEK_SET)               = 20868
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1000) = 1000
lseek(3, 20540, SEEK_SET)               = 20540
read(3, "A,\0\0\0aeabi\0\1\"\0\0\0\0056\0\6\6\10\1\t\1\n\3\f\1\22\4\24"..., 45) = 45
fstat64(3, {st_mode=S_IFREG|0644, st_size=21868, ...}) = 0
mmap2(NULL, 86080, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f90000
mprotect(0xb6f95000, 61440, PROT_NONE)  = 0
mmap2(0xb6fa4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0xb6fa4000
close(3)                                = 0
munmap(0xb6fd2000, 42)                  = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=33137, ...}) = 0
mmap2(NULL, 33137, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6fca000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0P\t\0\0004\0\0\0"..., 512) = 512
lseek(3, 8680, SEEK_SET)                = 8680
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1120) = 1120
lseek(3, 8328, SEEK_SET)                = 8328
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0644, st_size=9800, ...}) = 0
mmap2(NULL, 73912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f7d000
mprotect(0xb6f7f000, 61440, PROT_NONE)  = 0
mmap2(0xb6f8e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0xb6f8e000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0dI\0\0004\0\0\0"..., 512) = 512
lseek(3, 125740, SEEK_SET)              = 125740
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1560) = 1560
lseek(3, 90536, SEEK_SET)               = 90536
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=127300, ...}) = 0
mmap2(NULL, 164432, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f54000
mprotect(0xb6f6a000, 61440, PROT_NONE)  = 0
mmap2(0xb6f79000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0xb6f79000
mmap2(0xb6f7b000, 4688, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6f7b000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/arm-linux-gnueabihf/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0000\332\6\0004\0\0\0"..., 512) = 512
lseek(3, 1268340, SEEK_SET)             = 1268340
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1280) = 1280
lseek(3, 1267740, SEEK_SET)             = 1267740
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0644, st_size=1269620, ...}) = 0
mmap2(NULL, 1341504, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6e0c000
mprotect(0xb6f3b000, 65536, PROT_NONE)  = 0
mmap2(0xb6f4b000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12f000) = 0xb6f4b000
mmap2(0xb6f52000, 6208, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6f52000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0`=\0\0004\0\0\0"..., 512) = 512
lseek(3, 451032, SEEK_SET)              = 451032
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1120) = 1120
lseek(3, 450676, SEEK_SET)              = 450676
read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 49) = 49
fstat64(3, {st_mode=S_IFREG|0644, st_size=452152, ...}) = 0
mmap2(NULL, 516220, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6d8d000
mprotect(0xb6dfa000, 65536, PROT_NONE)  = 0
mmap2(0xb6e0a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6d000) = 0xb6e0a000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\200\321\0\0004\0\0\0"..., 512) = 512
lseek(3, 115292, SEEK_SET)              = 115292
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1080) = 1080
lseek(3, 114944, SEEK_SET)              = 114944
read(3, "A,\0\0\0aeabi\0\1\"\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 45) = 45
fstat64(3, {st_mode=S_IFREG|0644, st_size=116372, ...}) = 0
mmap2(NULL, 180536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6d60000
mprotect(0xb6d7c000, 61440, PROT_NONE)  = 0
mmap2(0xb6d8b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0xb6d8b000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0@h\1\0004\0\0\0"..., 512) = 512
lseek(3, 1231820, SEEK_SET)             = 1231820
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2880) = 2880
lseek(3, 1228284, SEEK_SET)             = 1228284
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=1234700, ...}) = 0
mmap2(NULL, 1303888, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6c21000
mprotect(0xb6d4b000, 61440, PROT_NONE)  = 0
mmap2(0xb6d5a000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x129000) = 0xb6d5a000
mmap2(0xb6d5d000, 9552, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6d5d000
close(3)                                = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fc8000
set_tls(0xb6fc86d0, 0xb6fc8dc8, 0xb6fd7050, 0xb6fc86d0, 0xb6fd7050) = 0
mprotect(0xb6d5a000, 8192, PROT_READ)   = 0
mprotect(0xb6d8b000, 4096, PROT_READ)   = 0
mprotect(0xb6e0a000, 4096, PROT_READ)   = 0
mprotect(0xb6f4b000, 20480, PROT_READ)  = 0
mprotect(0xb6f79000, 4096, PROT_READ)   = 0
mprotect(0xb6f8e000, 4096, PROT_READ)   = 0
mprotect(0xb6f90000, 20480, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f90000, 20480, PROT_READ|PROT_EXEC) = 0
cacheflush(0xb6f90000, 0xb6f95000, 0, 0x15, 0) = 0
mprotect(0xb6fa4000, 4096, PROT_READ)   = 0
mprotect(0x21000, 4096, PROT_READ)      = 0
mprotect(0xb6fd6000, 4096, PROT_READ)   = 0
munmap(0xb6fca000, 33137)               = 0
set_tid_address(0xb6fc8278)             = 414
set_robust_list(0xb6fc8280, 12)         = 0
rt_sigaction(SIGRTMIN, {sa_handler=0xb6f582b0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0xb6c4d6c0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0xb6f58390, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0xb6c4d6c0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
ugetrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
brk(NULL)                               = 0x78d000
brk(0x7b2000)                           = 0x7b2000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x6011e} ---
+++ killed by SIGSEGV +++
Segmentation fault
pi@pi2:~ $ cat /etc/*-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

@florrain
Copy link
Author

florrain commented Jan 24, 2018

@Petermarcu Please let me know if you have any pointers on how I can investigate this, the error message isn't helping at all. I also can't believe I'm the only one experiencing this issue?

  • Either it's a dependency thing, the documentation lacks of visibility in terms of pre-requisites for ARM devices and this is easy to fix. I tried all the libs I could find so there might be one or multiple missing in the docs.
  • It could also be a new dep lib version that is conflicting with the latest release of the runtime.
  • Lack of file permissions. I'll double check that.

@janvorli
Copy link
Member

@florrain I have looked into it a bit. First, on RPI 3 with the same debian version and using your steps to install the dotnet, it works fine.
My output of the sudo apt-get install libc6 libcurl3 libgcc1 libgssapi-krb5-2 libicu57 liblttng-ust0 libssl1.0.2 libstdc++6 libunwind8 libuuid1 zlib1g is the same as in your case - all versions match what you get.

My strace looks the same until the point where you get the SIGSEGV and then continues:

futex(0x76efc290, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x76efc294, FUTEX_WAKE_PRIVATE, 2147483647) = 0
lstat64("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat64("/proc/self", {st_mode=S_IFLNK|0777, st_size=0, ...}) = 0
readlink("/proc/self", "28670", 4095)   = 5
lstat64("/proc/28670", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat64("/proc/28670/exe", {st_mode=S_IFLNK|0777, st_size=0, ...}) = 0
readlink("/proc/28670/exe", "/opt/dotnet/dotnet", 4095) = 18
lstat64("/opt", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/opt/dotnet", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/opt/dotnet/dotnet", {st_mode=S_IFREG|0755, st_size=75916, ...}) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
write(1, "\n", 1)                       = 1
write(1, "Usage: dotnet [options]\n", 24) = 24
write(1, "Usage: dotnet [path-to-applicati"..., 36) = 36
write(1, "\n", 1)                       = 1
write(1, "Options:\n", 9)               = 9
write(1, "  -h|--help            Display h"..., 37) = 37
write(1, "  --version         Display vers"..., 37) = 37
write(1, "\n", 1)                       = 1
write(1, "path-to-application:\n", 21)  = 21
write(1, "  The path to an application .dl"..., 51) = 51
exit_group(-2147450751)                 = ?
+++ exited with 129 +++

That doesn't give us any reasonable info on what can be causing the crash.

I was googling for what can be causing a SIGSEGV before the main function is executed and it seems that it is most likely one of the shared libraries we depend on. Could you please try the following and get me the results?

  1. run ldd /usr/local/bin/dotnet
  2. run LD_DEBUG=all /usr/local/bin/dotnet >log.txt 2>&1. This will generate a long log of which shared libraries were loaded, which symbols were resolved etc, so please share the file using gist.
  3. run cat /proc/meminfo.
  4. run dotnet under gdb again and after it crashes, execute the following commands:
    a. info proc map
    b. info reg
    c. f 1 followed by disass

@livarcocc
Copy link
Contributor

This does not belong at area-SDK, this is about the runtime failing to run due to missing requirements.

@janvorli
Copy link
Member

@livarcocc why do you think it is about the runtime failing to run due to missing requirements? The log provided by @florrain doesn't show any attempt to load the runtime.

@steveharter
Copy link
Member

@janvorli since this a missing dependency that the runtime requires, where do you think this should be? Kindof a gray area, since we don't have a "platform environment" or "troubleshooting distros" repo or area.

I think coreclr would be the best location for this, as ideally a better error message can be displayed, or a tool that could do a pre-flight check of sorts.

@steveharter
Copy link
Member

@florrain can you provide the information that @janvorli is requesting? Thanks

@oyvindh
Copy link

oyvindh commented Apr 8, 2018

Seems I have it reproduced. If that confuses the thread, please remove. Here is the output requested by @janvorli

  1. ldd /usr/local/bin/dotnet

  2. LD_DEBUG=all /usr/local/bin/dotnet

  3. cat /proc/meminfo

  4. info proc map

  5. info reg

  6. f 1 disass

This is also on a RPI2 with stretch. On my RPI3 with stretch it works fine.

@TheFanatr
Copy link

In case it is helpful, I am having the same issue as well, but with a first generation Raspberry Pi B. I cannot collect telemetry at this time.

@sherlock1982
Copy link

Exactly the same thing:

pi@raspberrypi:~ $ cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2835
Revision        : 000e
Serial          : 0000000016cbe805

@hrumhurum
Copy link

hrumhurum commented Nov 14, 2018

Experiencing the very same issue for a standalone .NET Core 2.1 hello world app on Raspberry Pi Zero W.
strace.txt

EDIT: It looks like the issue is caused by the fact that .NET Core 2.1 apps can only be run on ARMv7 CPUs and newer. Raspberry Pi Zero W is built with ARMv6 BCM2835. This does not explain why the issue occurs for the original topic starter though (Raspberry Pi 2 Model B is based on ARMv7 BCM2836).

@janvorli
Copy link
Member

@oyvindh or @Florain, could you please run

cat /proc/cpuinfo

on your Raspberry Pi 2 where you had or still have problems running .NET?

@oyvindh
Copy link

oyvindh commented Jan 8, 2019

cat /proc/cpuinfo
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : BCM2835
Revision : 000e
Serial : 00000000fedb144e

@janvorli
Copy link
Member

janvorli commented Jan 8, 2019

@oyvindh This is ARM v6 that is not supported by .NET Core. Your device is not Raspberry Pi 2, based on the BCM2835 reported, it is Raspberry Pi Model A, B, B+, the Compute Module, or the Raspberry Pi Zero (see https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/README.md)

@NeilQ
Copy link

NeilQ commented Jan 26, 2019

Hello, my app raised the same issue. I was using the .net core 2.1 and hosting the app at ubuntu 16.04. My app reading the text from a file and doing a rsa encription, then it crashed with Segmentation fault. I debuged with strace which shows almost same as @florrain described. After some researching, I found it was cased by the ASCII filetype, so I delete the text file and re-create avoiding ASCII, it works finally!

So checking if there's any file created at windows. May it helps you.

FYI: 13 hours debugging a segmentation fault in .NET Core on Raspberry Pi and the solution was...

@msftgits msftgits transferred this issue from dotnet/core-setup Jan 30, 2020
@msftgits msftgits added this to the 2.0.x milestone Jan 30, 2020
@gnraju20411
Copy link

There is any way to install ASP.net core on Raspberry pi Zero W device?

Capture

My device configuration:
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 997.08
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : BCM2835
Revision : 9000c1
Serial : 00000000f6bd1450

@janvorli
Copy link
Member

@gnraju20411 no, it cannot be installed there. We don't support the ARMv6, only ARMv7. The ARMv6 doesn't support THUMB2 instruction encoding that our JIT generates and runtime requires. Some effort to make runtime work on ARMv6 was initiated by @franksinankaya (PR #657), but I am not aware of any work done on the JIT side.
Also see #7764 for more details.

@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Feb 23, 2020
@jeffschwMSFT jeffschwMSFT removed the untriaged New issue has not been triaged by the area owner label Feb 24, 2020
@jkotas jkotas closed this as completed Mar 1, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests