Re: [real fix] Re: [patch] fix for cc1 Out of memory [Re: [TESTCASE] `Out of memory for cc1']

Linus Torvalds (torvalds@transmeta.com)
Mon, 12 Apr 1999 21:31:26 -0700 (PDT)


[ Looking closer at your second patch.. The first one is obviously
correct, and I've applied it. The second one is not, I believe ]

On Tue, 13 Apr 1999, Andrea Arcangeli wrote:
>
> Well, while the above is the standalone-bugfix, I think that if prev is
> null we just know that mm->mmap will be after our start-end space.

Nope, we don't have any such guarantee.

Think about somebody unmapping a _part_ of the first vma in the process
address space. "prev" will be NULL, but that doesn't mean that mm->mmap
will be after our start-end space: in fact, mm->mmap will be the "partial"
vma that we truncated that will be before "start".

That function is truly subtle. The loop really _is_ needed (although it
could instead just be unrolled once and just be duplicated into two
copies, because we should never iterate more than once through the loop).

That function is just 30 lines of seemingly simple code, but even so it
had two bugs in it (a off-by-one error that Ingo found, and now this).

Anyway, with your simple vm_end -> vm_start fix (ie your first patch), I
believe we can put this function finally to rest.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/