x86: fix messed up page fault BUG messages
PATCH 1/1 x86: fix messed up page fault BUG messages
The 0day boot test robot hits messed up BUG lines like
[ 25.732010] BUG: unable to handle kernel paging requestrun: /lkp/wfg/sr at 000000000000d908 [ 24.986598] BUG: unable to handle kernel run: /lkp/wfg/srpaging request at 000000000000d908 [ 24.914406] BUG: unable to handle kernel run: /lkp/wfg/srearly console in decompress_kernel
Which makes the generated bug ID not stable and hence not bisectable.
Fix it by printing the BUG message in one shot.
--- arch/x86/mm/fault.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/mm/fault.c +4 -4
@@ -599,13 +599,13 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,printk (nx_warning,from_kuid (&init_user_ns,current_uid ())); } -printk (KERN_ALERT "BUG: unable to handle kernel " );if (address <PAGE_SIZE ) -printk (KERN_CONT "NULL pointer dereference" ); +printk (KERN_ALERT "BUG: unable to handle kernel NULL pointer dereference at %p\n" , + (void *) address);else -printk (KERN_CONT "paging request" ); +printk (KERN_ALERT "BUG: unable to handle kernel NULL pointer paging request at %p\n" , + (void *) address); -printk (KERN_CONT " at %p\n" , (void *) address);printk (KERN_ALERT "IP:" );printk_address (regs->ip);
Signature · 1 line
2.1.0.rc1
Quoted 27 lines · Fengguang Wu
The 0day boot test robot hits messed up BUG lines like
[ 25.732010] BUG: unable to handle kernel paging requestrun: /lkp/wfg/sr at 000000000000d908 [ 24.986598] BUG: unable to handle kernel run: /lkp/wfg/srpaging request at 000000000000d908 [ 24.914406] BUG: unable to handle kernel run: /lkp/wfg/srearly console in decompress_kernelWhich makes the generated bug ID not stable and hence not bisectable.
Fix it by printing the BUG message in one shot.
Signed-off-by Fengguang Wu <[email protected]>--- arch/x86/mm/fault.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)arch/x86/mm/fault.c +1
-2@@ -599,13 +599,13 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,printk (nx_warning,from_kuid (&init_user_ns,current_uid ())); } -printk (KERN_ALERT "BUG: unable to handle kernel " );if (address <PAGE_SIZE ) -printk (KERN_CONT "NULL pointer dereference" ); + printk(KERN_ALERT "BUG: unable to handle kernel NULL pointer dereference at %p\n",
arch/x86/mm/fault.c show_fault_oops(struct pt_regs *regs, unsigned long error_code, · line 611
Quoted 10 lines
arch/x86/mm/fault.c +3
-2+ (void *) address); else -printk (KERN_CONT "paging request" ); + printk(KERN_ALERT "BUG: unable to handle kernel NULL pointer paging request at %p\n", + (void *) address); -printk (KERN_CONT " at %p\n" , (void *) address);printk (KERN_ALERT "IP:" );printk_address (regs->ip);
That's been around forever, but I trust that an automated boot testing robot would find it more troublesome than most, so I agree it needs to be fixed. One problem: it changes the message from
BUG: unable to handle kernel paging request at %p
to
BUG: unable to handle kernel NULL pointer paging request at %p
and the test for address < PAGE_SIZE is supposed to be the determining factor on whether it is a "NULL pointer" or not. When that's fixed: