Re: [patch] mm: sparsemem memory_present() memory corruption fix

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Pekka Enberg <penberg@...>, Christoph Lameter <clameter@...>, <linux-kernel@...>, Mel Gorman <mel@...>, Nick Piggin <npiggin@...>, Andrew Morton <akpm@...>, Rafael J. Wysocki <rjw@...>, <Yinghai.Lu@...>, <apw@...>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>, Arjan van de Ven <arjan@...>
Date: Wednesday, April 16, 2008 - 11:03 am

* Ingo Molnar <mingo@elte.hu> wrote:


the method was to notice that the slub_debug_slabs SLUB variable got 
corrupted from an expected value of 0 to a value of 0x1.

Then i added a simple brute-force function-tracer hook (in sched-devel) 
that checked when slub_debug_slabs went from 0 to 1, and which then 
printed a backtrace.

Since under CONFIG_FTRACE=y every kernel function calls this callback, 
it triggered immediately after the value got corrupted:

[    0.000000] console [earlyser0] enabled
[    0.000000] BUG: slub_debug_slabs: 00000001
[    0.000000] Pid: 0, comm: swapper Not tainted 2.6.25-rc9-sched-devel.git-x86-latest.git #982
[    0.000000]  [<c0177fba>] print_slub_debug_slabs+0x3a/0x40
[    0.000000]  [<c01050f7>] trace+0x8/0x11
[    0.000000]  [<c0cc929e>] ? mtrr_bp_init+0xe/0x320
[    0.000000]  [<c01050f7>] ? trace+0x8/0x11
[    0.000000]  [<c0cd7369>] ? memory_present+0x9/0x50
[    0.000000]  [<c0cc7a09>] ? find_max_pfn+0x99/0xb0
[    0.000000]  [<c0cc6af7>] setup_arch+0x217/0x470
[    0.000000]  [<c012c59b>] ? printk+0x1b/0x20
[    0.000000]  [<c0cc2b46>] start_kernel+0x96/0x3f0
[    0.000000]  [<c0cc22fd>] i386_start_kernel+0xd/0x10
[    0.000000]  =======================
[    0.000000] x86: PAT support disabled.

and the backtrace had all the guilty parties on stack - memory_present() 
[which was just called] and find_max_pfn()/setup_arch() - thanks to the 
new fuzzy "?" backtrace entries we print out in v2.6.25.

(i could also have printed out the current ftrace buffer as well, 
showing the history of all recent function calls that the kernel 
executed.)

	Ingo
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [bug] mm/slab.c boot crash in -git, "kernel BUG at mm/sl..., Christoph Lameter, (Fri Apr 11, 3:25 pm)
Re: [bug] mm/slab.c boot crash in -git, "kernel BUG at mm/sl..., Christoph Lameter, (Fri Apr 11, 3:26 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 2:25 am)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Linus Torvalds, (Tue Apr 15, 12:02 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 12:15 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 4:23 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Linus Torvalds, (Tue Apr 15, 1:23 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 3:39 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 3:54 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 4:03 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 4:17 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 4:54 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 4:58 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 5:08 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Pekka Enberg, (Tue Apr 15, 4:34 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 4:40 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Linus Torvalds, (Tue Apr 15, 5:06 pm)
Re: [patch] mm: sparsemem memory_present() memory corruption..., Ingo Molnar, (Wed Apr 16, 11:03 am)
Re: [patch] mm: sparsemem memory_present() memory corruption..., KAMEZAWA Hiroyuki, (Tue Apr 15, 9:48 pm)
Re: [patch] mm: sparsemem memory_present() memory corruption..., Christoph Lameter, (Tue Apr 15, 8:45 pm)
Re: [patch] mm: sparsemem memory_present() memory corruption..., Christoph Lameter, (Tue Apr 15, 8:19 pm)
Re: [patch] mm: sparsemem memory_present() memory corruption..., Christoph Lameter, (Tue Apr 15, 8:46 pm)
Re: [patch] mm: sparsemem memory_present() memory corruption..., KAMEZAWA Hiroyuki, (Tue Apr 15, 10:20 pm)
Re: [patch] mm: sparsemem memory_present() memory corruption..., Christoph Lameter, (Tue Apr 15, 8:10 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 5:13 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 5:24 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 5:42 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 5:55 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 6:06 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Yinghai Lu, (Tue Apr 15, 7:18 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 6:13 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 6:27 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 7:22 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 7:27 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 8:04 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 7:32 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 6:32 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 4:28 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 4:34 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 4:42 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 4:50 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 4:58 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 5:08 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 5:19 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Mike Travis, (Tue Apr 15, 5:27 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 5:21 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 5:23 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 5:24 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 5:28 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 6:07 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Mike Travis, (Tue Apr 15, 5:43 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Christoph Lameter, (Tue Apr 15, 5:33 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Mike Travis, (Tue Apr 15, 5:16 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 3:35 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 3:41 pm)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Pekka Enberg, (Tue Apr 15, 2:41 am)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 3:08 am)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 5:11 am)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Yinghai Lu, (Tue Apr 15, 4:31 am)
Re: [bug] SLUB + mm/slab.c boot crash in -rc9, Ingo Molnar, (Tue Apr 15, 4:46 am)
Re: [bug] mm/slab.c boot crash in -git, "kernel BUG at mm/sl..., Christoph Lameter, (Fri Apr 11, 3:28 pm)
Re: [bug] mm/slab.c boot crash in -git, "kernel BUG at mm/sl..., Christoph Lameter, (Sat Apr 12, 6:38 am)