This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Kernel panic when compiled using gcc-4.7

Other Parts Discussed in Thread: AM3874

Hi,

I am trying to run new openembedded ditro on AM3874 board. I have found that 2.6.37 kernel needs no-unaligned-access switch and I was able to run it. However I still observe issue with notyfik module (pointed here: https://lists.yoctoproject.org/pipermail/meta-ti/2012-May/001144.html). Did anyone solved it already? Could we expect any TI patch for this issue?

Here is printout from serial console:

[    1.850000] usbhid: USB HID core driver
[    1.850000] Unable to handle kernel NULL pointer dereference at virtual address 00000002
[    1.860000] pgd = c0004000
[    1.860000] [00000002] *pgd=00000000
[    1.870000] Internal error: Oops: 5 [#1]
[    1.870000] last sysfs file:
[    1.870000] Modules linked in:
[    1.870000] CPU: 0    Not tainted  (2.6.37 #1)
[    1.870000] PC is at strcmp+0x10/0x48
[    1.870000] LR is at omap_mbox_get+0x3c/0x1d0
[    1.870000] pc : [<c0226da0>]    lr : [<c005cecc>]    psr: a0000013
[    1.870000] sp : ef83df20  ip : ef83df30  fp : ef83df2c
[    1.870000] r10: 00000000  r9 : 00000000  r8 : 00000000
[    1.870000] r7 : c0026b58  r6 : c0553800  r5 : c04a3f58  r4 : c052d9e8
[    1.870000] r3 : 00000000  r2 : 00000064  r1 : c04a3f58  r0 : 00000002
[    1.870000] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[    1.870000] Control: 10c5387d  Table: 80004019  DAC: 00000017
[    1.870000] Process swapper (pid: 1, stack limit = 0xef83c2e8)
[    1.870000] Stack: (0xef83df20 to 0xef83e000)
[    1.870000] df20: ef83df54 ef83df30 c005cecc c0226d9c c033e138 c0226d9c c05536d8 c05537a4
[    1.870000] df40: c05537a0 c0067eb0 ef83df74 ef83df58 c0341f0c c005ce9c 00000000 00000000
[    1.870000] df60: c002c1c8 c002c24c ef83df9c ef83df78 c0026b94 c0341d84 ef83c000 c002c1c8
[    1.870000] df80: c002c24c c0067eb0 c0026b58 00000000 ef83dfd4 ef83dfa0 c00383bc c0026b64
[    1.870000] dfa0: ef83dfbc 00000176 c053b1a8 c0067eb0 ef83dfd4 c002c1c8 c002c24c c0067eb0
[    1.870000] dfc0: 00000013 00000000 ef83dff4 ef83dfd8 c0008a90 c003830c 00000000 00000000
[    1.870000] dfe0: 00000000 c00089d8 00000000 ef83dff8 c0067eb0 c00089e4 28258100 80741106
[    1.870000] Backtrace:
[    1.870000] [<c0226d90>] (strcmp+0x0/0x48) from [<c005cecc>] (omap_mbox_get+0x3c/0x1d0)
[    1.870000] [<c005ce90>] (omap_mbox_get+0x0/0x1d0) from [<c0341f0c>] (notify_shm_drv_setup+0x194/0x26c)
[    1.870000]  r6:c0067eb0 r5:c05537a0 r4:c05537a4
[    1.870000] [<c0341d78>] (notify_shm_drv_setup+0x0/0x26c) from [<c0026b94>] (notify_init+0x3c/0x2b0)
[    1.870000]  r5:c002c24c r4:c002c1c8
[    1.870000] [<c0026b58>] (notify_init+0x0/0x2b0) from [<c00383bc>] (do_one_initcall+0xbc/0x190)
[    1.870000]  r8:00000000 r7:c0026b58 r6:c0067eb0 r5:c002c24c r4:c002c1c8
[    1.870000] r3:ef83c000
[    1.870000] [<c0038300>] (do_one_initcall+0x0/0x190) from [<c0008a90>] (kernel_init+0xb8/0x168)
[    1.870000]  r8:00000000 r7:00000013 r6:c0067eb0 r5:c002c24c r4:c002c1c8
[    1.870000] [<c00089d8>] (kernel_init+0x0/0x168) from [<c0067eb0>] (do_exit+0x0/0x624)
[    1.870000]  r5:c00089d8 r4:00000000
[    1.870000] Code: e1a0c00d e92dd800 e24cb004 e3a03000 (e7d02003)
[    2.100000] ---[ end trace f1865b47150691cb ]---
[    2.100000] Kernel panic - not syncing: Attempted to kill init!
[    2.110000] Backtrace:
[    2.110000] [<c0040cb0>] (dump_backtrace+0x0/0x10c) from [<c03ded10>] (dump_stack+0x18/0x1c)
[    2.120000]  r6:c0531c6c r5:c0531c6c r4:c05593e0 r3:60000113
[    2.130000] [<c03decf8>] (dump_stack+0x0/0x1c) from [<c03def00>] (panic+0x5c/0x17c)
[    2.130000] [<c03deea4>] (panic+0x0/0x17c) from [<c0067f20>] (do_exit+0x70/0x624)
[    2.140000]  r3:ef83816c r2:ef838000 r1:00000000 r0:c04a5d8f
[    2.150000]  r7:00000001
[    2.150000] [<c0067eb0>] (do_exit+0x0/0x624) from [<c0041108>] (die+0x298/0x2d4)
[    2.160000]  r7:00000000
[    2.160000] [<c0040e70>] (die+0x0/0x2d4) from [<c03ded70>] (__do_kernel_fault.part.2+0x5c/0x7c)
[    2.170000] [<c03ded14>] (__do_kernel_fault.part.2+0x0/0x7c) from [<c03e66c0>] (do_page_fault.part.3+0x270/0x288)
[    2.180000]  r7:ef838000 r3:ef83ded8
[    2.180000] [<c03e6450>] (do_page_fault.part.3+0x0/0x288) from [<c03e672c>] (do_page_fault+0x54/0x60)
[    2.190000] [<c03e66d8>] (do_page_fault+0x0/0x60) from [<c03e675c>] (do_translation_fault+0x24/0xa4)
[    2.200000]  r6:00000005 r5:c051a600 r4:00000005 r3:00000002
[    2.210000] [<c03e6738>] (do_translation_fault+0x0/0xa4) from [<c00381fc>] (do_DataAbort+0x3c/0xa0)
[    2.220000]  r7:ef83ded8 r6:00000002 r5:c051a600 r4:00000005
[    2.230000] [<c00381c0>] (do_DataAbort+0x0/0xa0) from [<c03e472c>] (__dabt_svc+0x4c/0x60)
[    2.230000] Exception stack(0xef83ded8 to 0xef83df20)
[    2.240000] dec0:                                                       00000002 c04a3f58
[    2.250000] dee0: 00000064 00000000 c052d9e8 c04a3f58 c0553800 c0026b58 00000000 00000000
[    2.260000] df00: 00000000 ef83df2c ef83df30 ef83df20 c005cecc c0226da0 a0000013 ffffffff
[    2.260000]  r7:c0026b58 r6:c0553800 r5:ef83df0c r4:ffffffff
[    2.270000] [<c0226d90>] (strcmp+0x0/0x48) from [<c005cecc>] (omap_mbox_get+0x3c/0x1d0)
[    2.280000] [<c005ce90>] (omap_mbox_get+0x0/0x1d0) from [<c0341f0c>] (notify_shm_drv_setup+0x194/0x26c)
[    2.290000]  r6:c0067eb0 r5:c05537a0 r4:c05537a4
[    2.290000] [<c0341d78>] (notify_shm_drv_setup+0x0/0x26c) from [<c0026b94>] (notify_init+0x3c/0x2b0)
[    2.300000]  r5:c002c24c r4:c002c1c8
[    2.310000] [<c0026b58>] (notify_init+0x0/0x2b0) from [<c00383bc>] (do_one_initcall+0xbc/0x190)
[    2.320000]  r8:00000000 r7:c0026b58 r6:c0067eb0 r5:c002c24c r4:c002c1c8
[    2.320000] r3:ef83c000
[    2.330000] [<c0038300>] (do_one_initcall+0x0/0x190) from [<c0008a90>] (kernel_init+0xb8/0x168)
[    2.340000]  r8:00000000 r7:00000013 r6:c0067eb0 r5:c002c24c r4:c002c1c8
[    2.340000] [<c00089d8>] (kernel_init+0x0/0x168) from [<c0067eb0>] (do_exit+0x0/0x624)
[    2.350000]  r5:c00089d8 r4:00000000

  • There is an error in the omap_mbox_get with the loop using pointer math for each mbox structure location.  It should be accessed as an array of pointers; the rest of the routines in this file are written this way.

    --- a/arch/arm/plat-omap/mailbox.c
    +++ b/arch/arm/plat-omap/mailbox.c
    @@ -337,14 +337,16 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
     struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb)
     {
     	struct omap_mbox *mbox;
    -	int ret;
    +	int ret, i;
     
     	if (!mboxes)
     		return ERR_PTR(-EINVAL);
     
    -	for (mbox = *mboxes; mbox; mbox++)
    +	for (i = 0; mboxes[i]; i++) {
    +		mbox = mboxes[i];
     		if (!strcmp(mbox->name, name))
     			break;
    +	}
     
     	if (!mbox)
     		return ERR_PTR(-ENOENT);
    

  • Hi,

    Thank you Scott, that was very helpful.

    Kernel booted after this fix. However I cannot run eth port. Actually, system does not report any errors, but cannot mount NFS. If I run filesystem from memory (NAND jffs2), board works fine and ifconfig shows me correct (static) IP, but the board is inaccessible. Did you have similar issue?

    If I set ip in bootargs to DHCP, system cannot discover proper IP:

    [    1.920000] Detected MACID=0:17:eb:62:73:ac
    [    2.440000]
    [    2.440000] CPSW phy found : id is : 0x221612
    [    3.460000] Sending DHCP requests ..
    [    7.440000] PHY: 0:07 - Link is Up - 1000/Full
    [    7.850000] DHCP/BOOTP: Reply not for us, op[2] xid[7c786298]
    [   10.440000] ..
    [   24.160000] DHCP/BOOTP: Reply not for us, op[2] xid[7d786298]
    [   31.800000] .
    [   41.700000] DHCP/BOOTP: Reply not for us, op[2] xid[7e786298]
    [   41.890000] DHCP/BOOTP: Reply not for us, op[2] xid[eec9c8cc]
    [   55.580000] .
    [   57.910000] DHCP/BOOTP: Reply not for us, op[2] xid[7f786298]
    [   64.150000] DHCP/BOOTP: Reply not for us, op[2] xid[36f02393]
    [   74.000000] DHCP/BOOTP: Reply not for us, op[2] xid[80786298]
    [   85.580000]  timed out!
    [   85.580000] IP-Config: Reopening network devices...
    [   86.100000]
    [   86.100000] CPSW phy found : id is : 0x221612
    [   87.120000] Sending DHCP requests .
    [   88.100000] PHY: 0:07 - Link is Up - 1000/Full
    [   89.400000] .
    [   90.280000] DHCP/BOOTP: Reply not for us, op[2] xid[81786298]
    [   93.390000] ..
    [  106.480000] DHCP/BOOTP: Reply not for us, op[2] xid[82786298]
    [  112.580000] .
    [  117.730000] DHCP/BOOTP: Reply not for us, op[2] xid[66ae42ae]
    [  124.140000] DHCP/BOOTP: Reply not for us, op[2] xid[83786298]
    [  125.290000] DHCP/BOOTP: Reply not for us, op[2] xid[304ed245]
    [  127.030000] DHCP/BOOTP: Reply not for us, op[2] xid[304ed245]
    [  128.830000] DHCP/BOOTP: Reply not for us, op[2] xid[304ed245]
    [  129.820000] DHCP/BOOTP: Reply not for us, op[2] xid[304ed245]
    [  131.820000] DHCP/BOOTP: Reply not for us, op[2] xid[304ed245]
    [  133.940000] .
    [  134.530000] DHCP/BOOTP: Reply not for us, op[2] xid[16bd20a7]
    [  135.820000] DHCP/BOOTP: Reply not for us, op[2] xid[304ed245]
    [  137.020000] DHCP/BOOTP: Reply not for us, op[2] xid[4021b2ba]
    [  137.020000] DHCP/BOOTP: Reply not for us, op[2] xid[4021b2ba]
    [  137.030000] DHCP/BOOTP: Reply not for us, op[2] xid[4021b2ba]
    [  137.040000] DHCP/BOOTP: Reply not for us, op[2] xid[4021b2ba]
    [  140.500000] DHCP/BOOTP: Reply not for us, op[2] xid[84786298]
    [  157.760000] DHCP/BOOTP: Reply not for us, op[2] xid[85786298]
    [  163.940000]  timed out!
    [  163.940000] IP-Config: Auto-configuration of network failed.

  • OK, never mind, I have found that issue is caused by my build system. For some reason it did not rebuild the kernel properly. Thanks once again!