Re: Make sure we populate the initroot filesystem late enough





On Sun, 25 Feb 2007, David Woodhouse wrote:

I'm inclined to agree that it _shouldn't_ be a problem. Nevertheless,
even this hack seems sufficient to 'fix' it:

Ok. Clearly something is using that memory. That said, I *suspect* that
the commit that you bisected to is just showing the problem indirectly.
The ordering shouldn't make any difference, but it can obviously make a
huge difference in various allocation patterns etc, thus just showing a
pre-existing problem more clearly..

Can you try adding something like

memset(start, 0xf0, end - start);

to before the return? That might give a better idea of exactly what is
using it after it's free'd, hopefully by having the user trigger some more
spectacular oops..

It is, of course, also entirely possible that the rootfs unpacking change
really *was* buggy, and I am just missing something totally obvious. The
memset() might still make it more obvious, though. Maybe.


if (start < end)
- printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
+ printk ("NOT Freeing initrd memory: %ldKiB would be freed\n", (end - start) >> 10);

.. so adding the "memset()" here would be what I'm suggesting ..

+ return;

.. and you might as well leave the return there, so that nobody else comes
along and re-uses the memory. That should just improve on the chances of
the memset() hopefully catching the problem..

Linus "I don't see anything wrong" Torvalds
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Initialization of very large blocks of memory
    ... After that, we initialize that memory: ... Is there any way to manage performance ot the initializing (not necessarily using memset)? ... Since vallocexplicitly says it doesn't initialize and is managed by ... thread within the kernel... ...
    (comp.sys.hp.hpux)
  • Re: Test my current RAM clock?
    ... My bus speed is showing at 200mhz and my Rated FSB is showing as ... On an Intel processor, the clock is 200MHz. ... DDR memory has a similar story to tell. ...
    (alt.comp.hardware.pc-homebuilt)
  • Re: why it is not work?
    ... you use memset() to set memory pointed to by pointer data ... If pointer data is not initialized, ... If malloccan't allocate memory, it returns NULL, and dereferencing ...
    (comp.lang.c)
  • Re: Type cast problem with VC++ 2005 Express Edition
    ... Maybe it's my habit from VC++6. ... own doesn't touch that memory, ... But without memset because you can also specify the value to set to resize(), ...
    (microsoft.public.vc.language)
  • Re: Middle parameter to memset that will achieve UCHAR_MAX
    ... What argument can I give memset in order to set an entire chunk of ... memory to all bits 1? ... shite I got back in the other thread. ...
    (comp.lang.c)