Repository navigation
Closed
Description
I have a node.js app that repeatable causes the following kernel error:
pi@pi ~ $ uname -a
Linux pi 3.12.36+ #737 PREEMPT Wed Jan 14 19:40:07 GMT 2015 armv6l GNU/Linux
Feb 27 19:33:22 pi kernel: [169472.321768] Modules linked in: snd_bcm2835 snd_pcm snd_page_alloc snd_seq snd_seq_device snd_timer snd pl2303 usbserial leds_gpio led_class spi_bcm2708
Feb 27 19:33:22 pi kernel: [169472.339986] CPU: 0 PID: 2472 Comm: node Not tainted 3.12.36+ #737
Feb 27 19:33:22 pi kernel: [169472.347687] task: d6178c80 ti: d61ee000 task.ti: d61ee000
Feb 27 19:33:22 pi kernel: [169472.354723] PC is at vfp_save_state+0x0/0x28
Feb 27 19:33:22 pi kernel: [169472.360637] LR is at vfp_sync_hwstate+0x70/0x7c
Feb 27 19:33:22 pi kernel: [169472.366797] pc : [<c00099c4>] lr : [<c0009588>] psr: 60000013
Feb 27 19:33:22 pi kernel: [169472.366797] sp : d61efeb0 ip : 00000018 fp : beb11de0
Feb 27 19:33:22 pi kernel: [169472.381537] r10: 01771044 r9 : d6179028 r8 : 00000000
Feb 27 19:33:22 pi kernel: [169472.388375] r7 : d61effb0 r6 : beb11cd0 r5 : 80000780 r4 : d61ee030
Feb 27 19:33:22 pi kernel: [169472.396549] r3 : d61ee0f8 r2 : c062ce60 r1 : c0000780 r0 : d61ee0f8
Feb 27 19:33:22 pi kernel: [169472.404701] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Feb 27 19:33:22 pi kernel: [169472.414917] Control: 00c5387d Table: 16140008 DAC: 00000015
Feb 27 19:33:22 pi kernel: [169472.563714] [<c00099c4>] (vfp_save_state+0x0/0x28) from [<c0009588>] (vfp_sync_hwstate+0x70/0x7c)
Feb 27 19:33:22 pi kernel: [169472.576493] [<c0009588>] (vfp_sync_hwstate+0x70/0x7c) from [<c0009794>] (vfp_preserve_user_clear_hwstate+0x20/0x8c)
Feb 27 19:33:22 pi kernel: [169472.590885] [<c0009794>] (vfp_preserve_user_clear_hwstate+0x20/0x8c) from [<c0010a8c>] (setup_sigframe+0x190/0x1a0)
Feb 27 19:33:22 pi kernel: [169472.605262] [<c0010a8c>] (setup_sigframe+0x190/0x1a0) from [<c0010ee8>] (do_signal+0x2e8/0x440)
Feb 27 19:33:22 pi kernel: [169472.617874] [<c0010ee8>] (do_signal+0x2e8/0x440) from [<c00111d8>] (do_work_pending+0xa4/0xb4)
Feb 27 19:33:22 pi kernel: [169472.630384] [<c00111d8>] (do_work_pending+0xa4/0xb4) from [<c000df00>] (work_pending+0xc/0x20)
Feb 27 19:33:23 pi kernel: [169472.661933] ---[ end trace ca4423d502cf7049 ]---
Feb 27 19:33:23 pi kernel: [169472.675291] note: node[2472] exited with preempt_count 2
Feb 27 19:33:23 pi kernel: [169472.705002] Modules linked in: snd_bcm2835 snd_pcm snd_page_alloc snd_seq snd_seq_device snd_timer snd pl2303 usbserial leds_gpio led_class spi_bcm2708
Feb 27 19:33:23 pi kernel: [169472.748913] CPU: 0 PID: 2472 Comm: node Tainted: G D 3.12.36+ #737
Feb 27 19:33:23 pi kernel: [169472.776293] [<c00143d4>] (unwind_backtrace+0x0/0xec) from [<c00116b8>] (show_stack+0x10/0x14)
Feb 27 19:33:23 pi kernel: [169472.805157] [<c00116b8>] (show_stack+0x10/0x14) from [<c04459b8>] (__schedule_bug+0x48/0x64)
Feb 27 19:33:23 pi kernel: [169472.833943] [<c04459b8>] (__schedule_bug+0x48/0x64) from [<c044aebc>] (__schedule+0x518/0x5ac)
Feb 27 19:33:23 pi kernel: [169472.862904] [<c044aebc>] (__schedule+0x518/0x5ac) from [<c0045758>] (__cond_resched+0x24/0x34)
Feb 27 19:33:23 pi kernel: [169472.891872] [<c0045758>] (__cond_resched+0x24/0x34) from [<c044b6c4>] (_cond_resched+0x3c/0x44)
Feb 27 19:33:23 pi kernel: [169472.920995] [<c044b6c4>] (_cond_resched+0x3c/0x44) from [<c00c3004>] (__get_user_pages.part.91+0xa0/0x408)
Feb 27 19:33:23 pi kernel: [169472.950871] [<c00c3004>] (__get_user_pages.part.91+0xa0/0x408) from [<c00b8214>] (get_user_pages_fast+0x60/0x78)
Feb 27 19:33:23 pi kernel: [169472.981397] [<c00b8214>] (get_user_pages_fast+0x60/0x78) from [<c0065af8>] (get_futex_key+0xec/0x244)
Feb 27 19:33:23 pi kernel: [169473.010922] [<c0065af8>] (get_futex_key+0xec/0x244) from [<c0065d00>] (futex_wake+0x30/0x160)
Feb 27 19:33:23 pi kernel: [169473.039707] [<c0065d00>] (futex_wake+0x30/0x160) from [<c0067e0c>] (do_futex+0x120/0xb78)
Feb 27 19:33:23 pi kernel: [169473.068342] [<c0067e0c>] (do_futex+0x120/0xb78) from [<c00688e4>] (SyS_futex+0x80/0x160)
Feb 27 19:33:23 pi kernel: [169473.097280] [<c00688e4>] (SyS_futex+0x80/0x160) from [<c001d328>] (mm_release+0xfc/0x138)
Feb 27 19:33:23 pi kernel: [169473.126477] [<c001d328>] (mm_release+0xfc/0x138) from [<c0021774>] (do_exit+0x110/0x970)
Feb 27 19:33:23 pi kernel: [169473.155673] [<c0021774>] (do_exit+0x110/0x970) from [<c00119f0>] (die+0x334/0x390)
Feb 27 19:33:23 pi kernel: [169473.184507] [<c00119f0>] (die+0x334/0x390) from [<c0008334>] (do_undefinstr+0x1b0/0x1dc)
Feb 27 19:33:23 pi kernel: [169473.213890] [<c0008334>] (do_undefinstr+0x1b0/0x1dc) from [<c044d0ec>] (__und_svc_finish+0x0/0x34)
Feb 27 19:33:23 pi kernel: [169473.244100] Exception stack(0xd61efe28 to 0xd61efe70)
Feb 27 19:33:23 pi kernel: [169473.259851] fe20: d61ee0f8 c0000780 c062ce60 d61ee0f8 d61ee030 80000780
Feb 27 19:33:23 pi kernel: [169473.288918] fe40: beb11cd0 d61effb0 00000000 d6179028 01771044 beb11de0 00000018 d61efeb0
Feb 27 19:33:23 pi kernel: [169473.317875] fe60: c0009588 c00099c4 60000013 ffffffff
Feb 27 19:33:23 pi kernel: [169473.333576] [<c044d0ec>] (__und_svc_finish+0x0/0x34) from [<c00099c4>] (vfp_save_state+0x0/0x28)
Feb 27 19:33:23 pi kernel: [169473.363003] [<c00099c4>] (vfp_save_state+0x0/0x28) from [<c0009588>] (vfp_sync_hwstate+0x70/0x7c)
Feb 27 19:33:23 pi kernel: [169473.392348] [<c0009588>] (vfp_sync_hwstate+0x70/0x7c) from [<c0009794>] (vfp_preserve_user_clear_hwstate+0x20/0x8c)
Feb 27 19:33:23 pi kernel: [169473.423359] [<c0009794>] (vfp_preserve_user_clear_hwstate+0x20/0x8c) from [<c0010a8c>] (setup_sigframe+0x190/0x1a0)
Feb 27 19:33:23 pi kernel: [169473.454368] [<c0010a8c>] (setup_sigframe+0x190/0x1a0) from [<c0010ee8>] (do_signal+0x2e8/0x440)
Feb 27 19:33:23 pi kernel: [169473.483620] [<c0010ee8>] (do_signal+0x2e8/0x440) from [<c00111d8>] (do_work_pending+0xa4/0xb4)
Feb 27 19:33:23 pi kernel: [169473.512866] [<c00111d8>] (do_work_pending+0xa4/0xb4) from [<c000df00>] (work_pending+0xc/0x20)
Happy to help debug this more, but I'm not sure exactly how. As I said, it's very repeatable.
Metadata
Metadata
Assignees
Labels
No labels
Activity
popcornmix commentedon Feb 28, 2015
3.12 kernel is no longer supported. Can you apt-get upgrade to get current 3.18 kernel and confirm if the issue is still present?
radford-for-smpte commentedon Feb 28, 2015
OK thanks, upgraded. I'll update if the problem persists...
radford-for-smpte commentedon Mar 2, 2015
OK problem still occurs:
popcornmix commentedon Mar 2, 2015
Can you provide a tar file containing something that can be run on raspbian to produce this error?
popcornmix commentedon Mar 2, 2015
Your problem looks similar to:
#600
Interestingly that appeared to get fixed by an update to BOINC:
http://boinc.berkeley.edu/dev/forum_thread.php?id=9222
not by a kernel change, so I suspect the bug is in your user code.
Ferroin commentedon Mar 4, 2015
If you are hitting an illegal instruction in kernel mode, it's not a userspace issue, it's a kernel bug. The only reason that it doesn't happen with the updated version of BOINC is that it was modified to not hit that codepath in the kernel, thus avoiding triggering the bug.
popcornmix commentedon Mar 4, 2015
@Ferroin Do you know what the exact change that was made to BOINC? It might help understand the issue.
Ferroin commentedon Mar 4, 2015
No, but It shouldn't take me long to figure out, I use a local build of the BOINC client on all my systems, so I have a local copy of the upstream repository anyway. I'll see if I can figure it out and hopefully be back with an answer shortly.
Ferroin commentedon Mar 4, 2015
Hmm, I'm not seeing any tag for the release hey are saying is working, despite having just updated my local copy today.
In theory, it shouldn't be too hard to find out what is causing this, as there isn't a huge ammount of stuff in the kernel that actually uses VFP. Based on the backtraces it looks like something in the kernel's signal handling code is what's having the issues, although why that would be I have no idea. The actual stacktrace appears to be almost identical to the one seen in #600, and I believe the BOINC client changed how it's using signals to manage individual apps between 7.2 and 7.4, so the signal handling code would make some sense as a common issue.
It would be interesting though to see if the same thing happens on a Pi2, as arm7a has a different superset of the ISA than armv6.
popcornmix commentedon Mar 4, 2015
The should be no VFP code in the kernel.
Ferroin commentedon Mar 4, 2015
In the core kernel there isn't any that uses it for floating point calculations, although there are some SIMD optimizations that use it (CryptoAPI has some modules that do this if they detect VFP support, but I don't know for certain of anywhere else that uses it). Also, some non-FP op-codes might get used during context switch when saving the FPU state, and that looks like what is causing the issue here, although why it is only triggering during the context switch for the signal handler I have no idea.
P33M commentedon Mar 6, 2015
It's an undefined instruction exception around the VFP save/restore state.
From http://lxr.free-electrons.com/source/arch/arm/vfp/vfpmodule.c#L516
It appears that the macros are using MCR/MRC accesses to talk to VFP registers. Pi 1 is "unusual" in having a VFPv2 implementation which isn't widely used.
While waiting on availability of the node.js implementation that causes this - perhaps a printk inside vfp_sync_hwstate() will tell us if this function is ever called without crashing?
radford-for-smpte commentedon Mar 6, 2015
Re sample code, it's a rather large project that among other things, polls a lot of different equipment. It'd be rather difficult to run externally. I'll see if I weed it down to a smaller utility that is more portable while still exhibiting the crash.
Since my last post I had upgraded node to the latest v0.10.28 and I had thought the problem went away. Now after 3 days, the problem recurred:
johnspackman commentedon Mar 12, 2015
We have a lot of Pis in production (70+) and this seems to crop up from time to time in recent builds; I now have a couple in my office that are doing it more frequently and one which does it every morning. The odd thing is that with the Pi which does it every day, I have replaced the SD card and the Pi itself (both brand new out of the packaging, the SD card is supplied by Raspberry themselves), leaving only the PSU, HDML cable, and the TV. The PSU is a standard PSU from RS components.
Last night I restarted it and by 2:35am it had gone again.
Stack trace below
P33M commentedon Mar 12, 2015
Just built from raspberrypi/linux with bcmrpi_defconfig.
Some disassembly:
351 remaining items
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c
Update vfpmodule.c