Raspberry Pi上的.NET Core运行时环境会引发分段错误

时间:2018-03-08 18:16:20

标签: .net-core raspbian

我尝试按照此处的一个答案安装.NET Core运行时环境:Is it possible to run .NET Core on Raspberry PI?

我已经检查过我已经安装了所有需要的软件包,但是当我运行" dotnet --info"我只是得到分段错误。 Strace没有对可能遗漏的内容提出好的建议:https://pastebin.com/rBUbiYkV

mmap2(NULL, 180536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0)  = 0xb6c9f000
mprotect(0xb6cbb000, 61440, PROT_NONE)  = 0
mmap2(0xb6cca000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0xb6cca000
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) = 0xb6b60000
mprotect(0xb6c8a000, 61440, PROT_NONE)  = 0
mmap2(0xb6c99000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x129000) = 0xb6c99000
mmap2(0xb6c9c000, 9552, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6c9c000
close(3)                                = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f25000
set_tls(0xb6f256d0, 0xb6f25dc8, 0xb6f2b050, 0xb6f256d0, 0xb6f2b050) = 0
mprotect(0xb6c99000, 8192, PROT_READ)   = 0
mprotect(0xb6cca000, 4096, PROT_READ)   = 0
mprotect(0xb6d49000, 4096, PROT_READ)   = 0
mprotect(0xb6e8a000, 20480, PROT_READ)  = 0
mprotect(0xb6eb8000, 4096, PROT_READ)   = 0
mprotect(0xb6ecd000, 4096, PROT_READ)   = 0
mprotect(0xb6ee4000, 20480, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6ee4000, 20480, PROT_READ|PROT_EXEC) = 0
cacheflush(0xb6ee4000, 0xb6ee9000, 0, 0x15, 0) = 0
mprotect(0xb6ef8000, 4096, PROT_READ)   = 0
mprotect(0x21000, 4096, PROT_READ)      = 0
mprotect(0xb6f2a000, 4096, PROT_READ)   = 0
munmap(0xb6ecf000, 83008)               = 0
set_tid_address(0xb6f25278)             = 24092
set_robust_list(0xb6f25280, 12)         = 0
rt_sigaction(SIGRTMIN, {sa_handler=0xb6e972b0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0xb6b8c6c0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0xb6e97390, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0xb6b8c6c0}, 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)                               = 0x100b000
brk(0x1030000)                          = 0x1030000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x6011e} ---
+++ killed by SIGSEGV +++
Segmentation fault

我接下来应该尝试什么?

2 个答案:

答案 0 :(得分:3)

Raspberry Pi 1包含an ARMv6 processor

.NET Core需要一个可以execute the ARMv7 instruction set的处理器,因为这就是JIT发出的:

  

注意:不支持Pi Zero,因为.NET Core JIT依赖于Pi Zero上没有的armv7指令。

所以这不会起作用。抱歉。尝试使用Raspberry Pi 2或3。

(如果你疯狂冒险,你可以尝试自己移植JIT。我不会尝试这个,除非你非常非常适合编写ARM程序集,C,C ++,C#并深入理解编译器)

答案 1 :(得分:0)

是的,.Net Core将在Raspberry Pi 3而不是2上运行。

您可以在stackoverflow中的 here 中找到安装过程。

更多详细信息,您也可以找到以下链接

http://reddyinfosoft.blogspot.com/2020/01/how-to-install-net-core-31-on-raspberry.html