[ubuntu-mono] [Bug 390591] Re: mono segfaults on ARM
Dave Martin
Dave.Martin at arm.com
Tue Jun 23 09:17:05 UTC 2009
This is interesting --- I definitely get SIGILL, not SIGSEGV, in the
mono binary. I did try installing f-spot-dbgsym, but this didn't seem
to give me any debug symbols even when explicitly attempting to load
them with "symbol-file /usr/lib/debug/usr/bin/mono" in GDB.
The instruction at PC is pop {r4} (0xE8BD0010), which definitely should
not cause SIGILL. However, this instruction is immediately preceded by
an old-style ARM syscall which probably doesn't work on the imx51
kernel. I couldn't see any explicit hard-coded syscalls in the mono
code, but does the JIT maybe insert them into its output?
I'm not sure why the SIGILL is happening, but it may be that the JIT
tried to execute a cache flush syscall which failed to execute, so the
CPU may have executed stale garbage from the I-cache causing the SIGILL.
But that's just speculation on my part :P
Is CONFIG_OABI_COMPAT enabled in the Marvell board? (Try zgrep OABI
/proc/config.gz) If it is, this would allow the old-style syscalls to
work and could explain the difference between the two boards' behaviour:
CONFIG_OABI_COMPAT it is not enabled in the imx51 kernel right now.
Ideally, mono would be ported to use new-style syscalls, but CONFIG_OABI_COMPAT may provide an easier fix (if it works). I don't know how this handled by other JIT implementations. Putting the syscall number in r7 as well as in the SVC (SWI) instruction comment field will generally work with both ABI variants.
$ gdb --args /usr/bin/mono /usr/lib/f-spot/f-spot.exe
GNU gdb 6.8-debian
Copyright (C) 2008 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"...
(no debugging symbols found)
(no debugging symbols found)
(gdb) r
Starting program: /usr/bin/mono /usr/lib/f-spot/f-spot.exe
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[New Thread 0x40020050 (LWP 13079)]
Program received signal SIGILL, Illegal instruction.
[Switching to Thread 0x40020050 (LWP 13079)]
0x0002eb60 in ?? ()
(gdb) x/4i $pc-4
0x2eb5c: svc 0x009f0002
0x2eb60: pop {r4}
0x2eb64: bx lr
0x2eb68: cmp r3, #0 ; 0x0
(gdb) i r
r0 0x40358000 1077248000
r1 0x40358098 1077248152
r2 0x0 0
r3 0x40358098 1077248152
r4 0x40358098 1077248152
r5 0x40358080 1077248128
r6 0x40358084 1077248132
r7 0x40358088 1077248136
r8 0x40358068 1077248104
r9 0xe1a0f00c 3785420812
r10 0x4035804c 1077248076
r11 0x4035804c 1077248076
r12 0x0 0
sp 0xbeeb229c 0xbeeb229c
lr 0x387f4 231412
pc 0x2eb60 0x2eb60
fps 0x0 0
cpsr 0x20000010 536870928
(gdb) quit
--
mono segfaults on ARM
https://bugs.launchpad.net/bugs/390591
You received this bug notification because you are a member of MOTU Mono
Team, which is subscribed to mono in ubuntu.
More information about the Ubuntu-mono
mailing list