让Mono在Artik710上工作时遇到问题。我安装了fedora 24的“mono-devel”软件包,DNF说一切都好。
但是当我尝试用mcs编译一个最小的“Hello world”程序时,我得到一个分段错误
此外,当我在PC上编译程序并尝试使用“mono hello.exe”在Artik710上运行它时,我也会出现分段错误。
只是“mono -V”的作用并说:
Mono JIT compiler version 4.2.4 (tarball Thu Jun 23 19:09:56 UTC 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: normal
Notifications: epoll
Architecture: armel,vfp+hard
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
我认为在64位Cortex A-53核心处理器上运行32位操作系统(以及32位Mono)会导致此问题。所以问题是 - 有没有办法在32位操作系统上安装(或从源代码构建)x64 Mono,是否有任何可行的方法?或其他任何问题?这是来自运行Hello world程序的gdb的一些堆栈跟踪(不是很有用):
[New Thread 0xf6bff440 (LWP 4925)]
[New Thread 0xf7123440 (LWP 4926)]
Thread 1 "mono" received signal SIGILL, Illegal instruction.
0xf71b1b04 in ?? ()
(gdb) continue
Continuing.
Thread 1 "mono" received signal SIGSEGV, Segmentation fault.
0xf75e608c in strchrnul () from /lib/libc.so.6
(gdb) continue
Continuing.
Thread 1 "mono" received signal SIGSEGV, Segmentation fault.
0xf75e608c in strchrnul () from /lib/libc.so.6
(gdb) continue
Continuing.
Unable to fetch general registers.: No such process.
Unable to fetch general registers.: No such process.
Unable to fetch general registers.: No such process.
(gdb) [Thread 0xf7123440 (LWP 4926) exited]
[Thread 0xf6bff440 (LWP 4925) exited]
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
The program is not being run.
感谢您的帮助!
注意:
在valgrind工具调试下,我的“Hello world”程序实际上是单声道工作。因此,如果我运行“mono /root/Release/HelloWorldArtik.exe” - 它只返回“Segmentation failed(core dumped)”。但如果我运行“valgrind --tool = memcheck -v --leak-check = full --smc-check = all mono /root/Release/HelloWorldArtik.exe”,则返回:
--2632-- Contents of /proc/version:
--2632-- Linux version 4.4.71-0710GC0F-44F-01QC (release@iotadmin-PowerEdge-T630) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) ) #1 SMP PREEMPT Thu Jul 13 19:58:14 KST 2017
--2632-- Arch and hwcaps: ARM, LittleEndian, ARMv7-neon-vfp
--2632-- Page sizes: currently 4096, max supported 4096
--2632-- Reading syms from /usr/bin/mono-sgen
--2632-- Considering /usr/lib/debug/.build-id/03/d41817d1bf496a1e9fbb96dcbaf91dca2f2a36.debug ..
--2632-- .. build-id is valid
--2632-- Considering /usr/lib/debug/.build-id/be/69fde943ee25e3d503d6e9298eca48dfbb1696.debug ..
--2632-- .. build-id is valid
--2632-- Warning: cross-CU LIMITATION: some inlined fn names
--2632-- might be shown as UnknownInlinedFun
--2632-- Reading syms from /usr/lib/ld-2.23.so
--2632-- Considering /usr/lib/debug/usr/lib/ld-2.23.so.debug ..
--2632-- .. CRC mismatch (computed 8c51544a wanted a0a8f5fa)
--2632-- Reading EXIDX entries: 147 available
==2632== Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2632== Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
(a lot of same warnings and redirections)
Reading EXIDX entries: 2018 attempted, 1836 successful
--2632-- REDIR: 0x49df1c0 (libc.so.6:memcpy) redirected to 0x4831690 (_vgnU_ifunc_wrapper)
--2632-- REDIR: 0x49deec0 (libc.so.6:memset) redirected to 0x484df08 (memset)
--2632-- REDIR: 0x49e75c0 (libc.so.6:__memcpy_neon) redirected to 0x484be9c (memcpy)
--2632-- REDIR: 0x49dd5f0 (libc.so.6:rindex) redirected to 0x4849a4c (rindex)
--2632-- REDIR: 0x49dd241 (libc.so.6:strlen) redirected to 0x484a23c (strlen)
--2632-- REDIR: 0x49dc8b1 (libc.so.6:strcmp) redirected to 0x484b48c (strcmp)
--2632-- REDIR: 0x49dd464 (libc.so.6:strncmp) redirected to 0x484ab74 (strncmp)
--2632-- REDIR: 0x49dc7c0 (libc.so.6:index) redirected to 0x4849c9c (index)
--2632-- REDIR: 0x49de5b1 (libc.so.6:memchr) redirected to 0x484b75c (memchr)
--2632-- REDIR: 0x49e104c (libc.so.6:strchrnul) redirected to 0x484e8e0 (strchrnul)
--2632-- REDIR: 0x49d6f58 (libc.so.6:malloc) redirected to 0x48464f8 (malloc)
--2632-- REDIR: 0x49d72b8 (libc.so.6:free) redirected to 0x4847b38 (free)
--2632-- REDIR: 0x49d7978 (libc.so.6:calloc) redirected to 0x4848c40 (calloc)
--2632-- REDIR: 0x49dd5a0 (libc.so.6:strncpy) redirected to 0x484a634 (strncpy)
--2632-- REDIR: 0x49d7394 (libc.so.6:realloc) redirected to 0x4848eac (realloc)
--2632-- REDIR: 0x49dcbc0 (libc.so.6:strcpy) redirected to 0x484a3fc (strcpy)
--2632-- REDIR: 0x49dc79c (libc.so.6:strcat) redirected to 0x4849ddc (strcat)
--2632-- REDIR: 0x49deb80 (libc.so.6:memmove) redirected to 0x484dfd0 (memmove)
--2632-- REDIR: 0x49ddf74 (libc.so.6:strstr) redirected to 0x484f254 (strstr)
--2632-- REDIR: 0x49e0fc0 (libc.so.6:rawmemchr) redirected to 0x484e918 (rawmemchr)
--2632-- REDIR: 0x49dd31c (libc.so.6:strnlen) redirected to 0x484a184 (strnlen)
--2632-- REDIR: 0x49dcbb0 (libc.so.6:stpcpy) redirected to 0x484d72c (stpcpy)
--2632-- REDIR: 0x49df0bc (libc.so.6:strcasecmp_l) redirected to 0x484b0b4 (strcasecmp_l)
--2632-- REDIR: 0x49de64c (libc.so.6:bcmp) redirected to 0x484d5b4 (bcmp)
--2632-- memcheck GC: 1000 nodes, 0 survivors (0.0%)
Hello, world! From Artik 710 (this is program output)
==2632==
==2632== HEAP SUMMARY:
==2632== in use at exit: 12,271 bytes in 330 blocks
==2632== total heap usage: 44,241 allocs, 43,911 frees, 15,597,707 bytes allocated
==2632==
==2632== Searching for pointers to 330 not-freed blocks
==2632== Checked 23,350,064 bytes
==2632==
==2632== 8 bytes in 1 blocks are definitely lost in loss record 9 of 297
==2632== at 0x4846584: malloc (vg_replace_malloc.c:299)
==2632== by 0x336A43: monoeg_malloc (gmem.c:73)
==2632== by 0x25958F: mono_metadata_type_dup (metadata.c:5048)
==2632== by 0x1BB0AF: get_shared_gparam (mini-generic-sharing.c:2850)
==2632== by 0x1BB2EF: UnknownInlinedFun (mini-generic-sharing.c:2915)
==2632== by 0x1BB2EF: get_shared_inst.isra.15 (mini-generic-sharing.c:2939)
==2632== by 0x1BD117: mini_get_shared_method_full (mini-generic-sharing.c:2997)
==2632== by 0x132943: lookup_method (mini-runtime.c:1763)
==2632== by 0x1329EB: mono_jit_compile_method_with_opt (mini-runtime.c:1868)
==2632== by 0x133437: mono_jit_runtime_invoke (mini-runtime.c:2179)
==2632== by 0x2ABA7B: mono_runtime_invoke (object.c:2783)
==2632== by 0x2ABF23: mono_runtime_class_init_full (object.c:367)
==2632== by 0x15CF67: mono_method_to_ir (method-to-ir.c:11237)
(and so on)
LEAK SUMMARY:
==2632== definitely lost: 746 bytes in 29 blocks
==2632== indirectly lost: 0 bytes in 0 blocks
==2632== possibly lost: 288 bytes in 2 blocks
==2632== still reachable: 11,237 bytes in 299 blocks
==2632== suppressed: 0 bytes in 0 blocks
==2632== Reachable blocks (those to which a pointer was found) are not shown.
==2632== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==2632==
==2632== ERROR SUMMARY: 22 errors from 22 contexts (suppressed: 0 from 0)
==2632== ERROR SUMMARY: 22 errors from 22 contexts (suppressed: 0 from 0)
有人可以为我澄清,这一切意味着什么?
答案 0 :(得分:0)
使用valgrind工具检查无效的读写。这将为您提供正确的信息。