Hi,
I have a piece of code running fine on native Linux, but terminating unexpected with SIGSEGV while running on l4linux on the same piece of hardware.
The relevant code is in _armv7_neon_probe "vorr q15,q15,q15" (undefined instruction on ARMv5) which normally would throw SIGILL and thus being caught in the caller.
With CONFIG_L4_DEBUG_SEGFAULTS enabled, the exception is correctly printed as
CPSR: 6000010 Err: 00100000 MyApp/171: Undefined instruction at 0007c7e0 with content f26ee1fe,
err 00100000
Unfortunately, when I look into l4linux/arch/l4/kernal/signal.c in l4x_deliver_signal(), errcode is not used at all and so IGSEGV will always be sent, regardless of the exceptions.
Martin
openssl/crypto/armv4cpuid.S:
.global _armv7_neon_probe .type _armv7_neon_probe,%function _armv7_neon_probe: .word 0xf26ee1fe @ vorr q15,q15,q15 .word 0xe12fff1e @ bx lr .size _armv7_neon_probe,.-_armv7_neon_probe
Hi,
On Fri Jan 24, 2014 at 17:04:00 +0100, Martin Schröder wrote:
I have a piece of code running fine on native Linux, but terminating unexpected with SIGSEGV while running on l4linux on the same piece of hardware.
The relevant code is in _armv7_neon_probe "vorr q15,q15,q15" (undefined instruction on ARMv5) which normally would throw SIGILL and thus being caught in the caller.
With CONFIG_L4_DEBUG_SEGFAULTS enabled, the exception is correctly printed as
CPSR: 6000010 Err: 00100000 MyApp/171: Undefined instruction at 0007c7e0 with content
f26ee1fe, err 00100000
Unfortunately, when I look into l4linux/arch/l4/kernal/signal.c in l4x_deliver_signal(), errcode is not used at all and so IGSEGV will always be sent, regardless of the exceptions.
Thanks, I think I see the problem. Do you have CONFIG_VFP enabled in either Linux version?
Adam
Am 26.01.2014 15:59, schrieb Adam Lackorzynski:
Do you have CONFIG_VFP enabled in either Linux version?
normally not, but CONFIG_VFP crashes both qemu (arm-rv-arm9):
VFS: Mounted root (ext2 filesystem) readonly on device 1:0. Freeing unused kernel memory: 112K (022ab000 - 022c7000) 0: 00000000 00000040 00000040 00000000 4: 00000040 00000000 bfa86f0c 00000000 8: 00000000 00000000 00000000 00000000 12: 40000000 bfa86da0 00160c54 0016b6cc CPSR: 20000010 Err: 00100000 sh/1: Undefined instruction at 0016b6cc with content eef11a10, err 00100000 00008000 - 001f8000 r-xp 00000 /bin/busybox <==== (0x1636cc) 001f8000 - 001f9000 rwxp 001f0 /bin/busybox 001f9000 - 001ff000 rwxp b7b28000 - b7b29000 r-xp bfa65000 - bfa87000 rw-p 0: 00000000 00000040 00000040 00000000 4: 00000040 00000000 bfa86f0c 00000000 8: 00000000 00000000 00000000 00000000 12: 40000000 bfa86da0 00160c54 0016b6cc CPSR: 20000010 Err: 00100000 Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
CPU: 0 PID: 1 Comm: sh Not tainted 3.12.0-l4 #1 [<0200c264>] (unwind_backtrace+0x0/0xf0) from [<020054b0>] (show_stack+0x10/0x14) [<020054b0>] (show_stack+0x10/0x14) from [<021f3a2c>] (panic+0x78/0x1b8) [<021f3a2c>] (panic+0x78/0x1b8) from [<0201d64c>] (do_exit+0x6b8/0x7c8) [<0201d64c>] (do_exit+0x6b8/0x7c8) from [<0201d828>] (do_group_exit+0x3c/0xa0) [<0201d828>] (do_group_exit+0x3c/0xa0) from [<020271a8>] (get_signal_to_deliver+0x18c/0x478) [<020271a8>] (get_signal_to_deliver+0x18c/0x478) from [<020069b4>] (do_signal+0x78/0x3d8) [<020069b4>] (do_signal+0x78/0x3d8) from [<02003a48>] (l4x_deliver_signal+0xc8/0xd8) [<02003a48>] (l4x_deliver_signal+0xc8/0xd8) from [<020090ac>] (l4x_vcpu_entry_c+0x6e8/0x2468) [<020090ac>] (l4x_vcpu_entry_c+0x6e8/0x2468) from [<00160c54>] (0x160c54) panic: going to sleep forever, bye l4linux | panic: going to sleep forever, bye qemu: terminating on signal 2 make: *** [qemu] Unterbrechung
as well as real HW (i.MX28 EVK):
CPU: Testing write buffer coherency: ok Setting up static identity map for 0x02225fb0 - 0x02225fb0 devtmpfs: initialized l4linux | Copro10/11 access (FPU), invalid, will oops 0: 00000000 00000000 00000002 022ec4c8 4: 06c28000 0230e2f8 022ec3b4 0232c000 8: 00000043 02300bd4 022e618c 00000000 12: 00000064 06c29ee8 022ec3ec 020031b0 CPSR: 80000013 Err: 00000000 l4linux | Non-resolvable page fault at 141, ip 20cded8. l4linux | Page fault (non-resolved): pfa=141 pc=20cded8 l4linux | Non-resolvable page fault at 146, ip 20cded8. Internal error: Boom!: 410007 [#1] ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 3.12.0-l4 #12 task: 06c27be0 ti: 06c28000 task.ti: 06c28000 PC is at do_coredump+0x38/0xdcc LR is at get_signal_to_deliver+0x170/0x448
Martin
On Mon Jan 27, 2014 at 15:12:26 +0100, Martin Schröder wrote:
Am 26.01.2014 15:59, schrieb Adam Lackorzynski:
Do you have CONFIG_VFP enabled in either Linux version?
normally not, but CONFIG_VFP crashes both qemu (arm-rv-arm9):
as well as real HW (i.MX28 EVK):
Ah, thanks for testing on real hardware, this is actually what I saw as well and confirms that there's "nothing wrong" when it aborts with CONFIG_VFP. I'll come up with a fix.
Adam
l4-hackers@os.inf.tu-dresden.de