Oops ERROR : Unable to handle kernel NULL pointer dereference at virtual address 00000000
Hi,
I patched my 2.4.18 kernel with latest MTD source. Now it crashes in in fucntion add_mtd_device (mtdcore.c). I need help on this topic. I patched the code because the previous one was crashing while invalidating the device after it detects partitions.
---- source -----
DEBUG(0, "mtd: Giving out device %d to %s\n",i, mtd->nam$
/* No need to get a refcount on the module containing
the notifier, since we hold the mtd_table_mutex */
list_for_each(this, &mtd_notifiers) {
struct mtd_notifier *not = list_entry(this, stru$
not->add(mtd); <------------- CRASH
}---- output ------
H720x-MTD probing 16bit FLASH
Amd/Fujitsu Extended Query Table v1.0 at 0x0040
number of CFI chips: 1cfi_cmdset_0002: Disabling fast programming due to code brokenness. cmdlinepart partition parsing not available
Using builtin partition table
Creating 1 MTD partitions on "SinX Flash":
0x00100000-0x00200000 : "jffs2"
mtd: Giving out device 0 to jffs2
Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c0004000 *pgd = 00000000, *pmd = 00000000 Internal error: Oops: ffffffff CPU: 0 pc : [<c00879a8>] lr : [<00000001>] Not tainted
sp : c0117f68 ip : 60000013 fp : 00000000
r10: 00000000 r9 : 00000001 r8 : c00c5970
r7 : c00c57d4 r6 : c00c584c r5 : ffffffff r4 : c011f2e0 r3 : 00000000 r2 : c00c5898 r1 : fffffff8 r0 : c011f2e0
Flags: nzcv IRQs on FIQs on Mode SVC_32 Segment kernel
Control: 217F Table: 4000401D DAC: 0000001D Process swapper (pid: 1, stackpage=c0117000)
Stack: (0xc0117f58 to 0xc0118000)
7f40: 00000001 c00879a8
7f60: 00000013 ffffffff c00c587c c01e1160 c00c5890 c00c57d4 c0087da0 c00c58cc 7f80: c01e1160 c00c57e8 c0084080 c01e1160 c01e1060 00000005 00000000 c0085724
7fa0: 00200000 00000001 c00b9bac c00e44b4 c00e44b8 00000000 c00e44b0 41807202
7fc0: 4000f848 c000f5e8 c0010318 c001031c c00c7418 c00c740c c00c2b40 c00088b4
7fe0: 00000800 c00e5358 c001104c 00000800 c00e5358 c00c7418 c00c740c c0012d28
Backtrace: no frame pointer Code: e582e000 e121f00c d1a0c002 dbfe30e5 (e5833000) Kernel panic: Attempted to kill init!
Quoted 6 lines · On Sat, 2003-05-24 at 22:20, [email protected] wrote:
Hi,
I patched my 2.4.18 kernel with latest MTD source. Now it crashes in in fucntion
add_mtd_device(mtdcore.c).
Quoted 7 lines
DEBUG(0, "mtd: Giving out device %d to %s\n",i, mtd->nam$
/* No need to get a refcount on the module containing
the notifier, since we hold the mtd_table_mutex */
list_for_each(this, &mtd_notifiers) {
struct mtd_notifier *not = list_entry(this, stru$
not->add(mtd); <------------- CRASH
}Thanks for the report. Please could you apply this patch and check what it prints...
Index: mtdcore.c
===================================================================
RCS file: /home/dwmw2/.mtd-cvs-backup/cvs/mtd/drivers/mtd/mtdcore.c,v retrieving revision 1.39
mtdcore.c +6 -0
@@ -64,6 +64,7 @@ int add_mtd_device(struct mtd_info *mtd)the notifier, since we hold the mtd_table_mutex */ list_for_each (this, &mtd_notifiers) { struct mtd_notifier *not = list_entry(this, struct mtd_notifier, list); +printk ("Add %p for notifier at %p\n" , not->add, not); not->add (mtd); }
@@ -134,6 +135,11 @@ int del_mtd_device (struct mtd_info *mtdvoid register_mtd_user (struct mtd_notifier *new) {int i; + +if (!new->add) { +printk ("Notifier at %p has no ->add().\n" , new); +BUG (); + }down (&mtd_table_mutex);
Signature · 1 line
dwmw2
Quoted 1 line · On Sat, 2003-05-24 at 22:20, [email protected] wrote:
Backtrace: no frame pointer
That's going to render the information given by the BUG() I just added quite useless. Build with -mapcs-frame in your CFLAGS
Signature · 1 line
dwmw2
Quoted 4 lines
Thanks for the report. Please could you apply this patch and check what it prints...
Here's the new output.
H720x-MTD probing 16bit FLASH
Amd/Fujitsu Extended Query Table v1.0 at 0x0040
number of CFI chips: 1cfi_cmdset_0002: Disabling fast programming due to code brokenness. cmdlinepart partition parsing not available
Using builtin partition table
Creating 3 MTD partitions on "SinX Flash":
0x00000000-0x00010000 : "SinX Bootloader"
Add c00895d0 for notifier at c00c787c
Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c0004000 *pgd = 00000000, *pmd = 00000000 Internal error: Oops: ffffffffC
Quoted 4 lines · On Sun, 2003-05-25 at 19:26, [email protected] wrote:
Quoted 3 lines
Thanks for the report. Please could you apply this patch and check what it prints...
Here's the new output.
Where exactly is the oops this time, and if it's not in add_mtd_device() can you show the (decoded) backtrace too? (you need -mapcs-frame).
If it's still in add_mtd_device(), please show the entire disassembly of that function. What compiler are you compiling with?
Signature · 1 line
dwmw2
Quoting David Woodhouse <[email protected]>:
Quoted 8 lines
Where exactly is the oops this time, and if it's not in
add_mtd_device()can you show the (decoded) backtrace too? (you need -mapcs-frame).If it's still in
add_mtd_device(), please show the entire disassembly of that function. What compiler are you compiling with?Signature · 1 line
dwmw2
It's still at the same line in add_mtd_device()
Compiler gcc-2.95.2
Backtrace :
Unable to handle kernel NULL pointer dereference at virtual address 00000000 *pgd = 00000000, *pmd = 00000000 Internal error: Oops: ffffffff CPU: 0 pc : [<c0089200>] lr : [<00000001>] Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386 sp : c0115ee8 ip : 60000013 fp : c0115f04
r10: 00000000 r9 : 00000001 r8 : c00c7928
r7 : c00c77d4 r6 : c00c7804 r5 : ffffffff r4 : c011d2e0 r3 : 00000000 r2 : c00c7850 r1 : fffffff8 r0 : c011d2e0
Flags: nzcv IRQs on FIQs on Mode SVC_32 Segment kernel
Control: 217F Table: 4000401D DAC: 0000001D Process swapper (pid: 1, stackpage=c0115000)
Stack: (0xc0115ed8 to 0xc0116000)
5ec0: 00000001 c0089200
5ee0: 00000013 ffffffff c011d2e0 c01df160 c00c7804 c00c77d4 c0115f20 c0115f08 5f00: c00885fc c008919c c00c7834 c01df160 c00c7848 c0115f3c c0115f24 c0089608 5f20: c008859c c00c7884 c01df160 c00c77e8 c0115f5c c0115f40 c00865bc c00895e0 5f40: c01df160 c01df060 00000004 00000000 c0115f90 c0115f60 c0087cd8 c008653c 5f60: 00010000 00000003 c00bb748 c00e6494 c00e6498 00000000 c00e6490 41807202
5f80: 4000fba4 c0115fb4 c0115f94 c000f93c c00877c8 c0010674 c0010678 c00c93f8 5fa0: c00c93ec c00c4b40 c0115fcc c0115fb8 c00088e4 c000f870 00000800 c00e7338 5fc0: c0115fdc c0115fd0 c0008924 c00088d8 c0115ffc c0115fe0 c0011064 c000890c 5fe0: 00000800 c00e7338 c00c93f8 c00c93ec 00000000 c0116000 c0012e38 c0011064
Backtrace: Code: e582e000 e121f00c d1a0c002 dbfe2b27 (e5833000)
sh: /usr/bin/objdump: No such file or directory
Error (pclose_local): Oops_decode_part pclose failed 0x7f00 Error (Oops_decode_part): no objdump lines read for /tmp/ksymoops.33xPCD
Quoted 7 lines
Quoted 7 lines
EIP;
c0089200<add_mtd_blktrans_dev+74/2b0> <=====ip; 60000013 <stack_end+5fffe075/c0002062>
r8;c00c7928<h720x_partitions+0/48>
r7;c00c77d4<mtd_table_mutex+0/14>
r6;c00c7804<mtdblock_tr+0/44>
r2;c00c7850<mtd_table_mutex+0/14>
Kernel panic: Attempted to kill init!
Quoted 1 line · On Sun, 2003-05-25 at 20:30, [email protected] wrote:
It's still at the same line in
add_mtd_device()
Why do you say that? It doesn't _look_ like it is...
Quoted 1 line
Quoted 1 line
Quoted 1 line
EIP;
c0089200<add_mtd_blktrans_dev+74/2b0> <=====
Please show the backtrace.
Signature · 1 line
dwmw2