[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#247300: libc6: malloc() never fails on 2.4 kernels, making processes crash



On 2004-05-06 19:05:53 -0400, Daniel Jacobowitz wrote:
> On Fri, May 07, 2004 at 12:58:28AM +0200, Vincent Lefevre wrote:
> > On 2004-05-06 16:44:54 -0400, Daniel Jacobowitz wrote:
> > > The documentation in the 2.4 kernel is, indeed, wrong IIRC.
> > > 
> > > BTW, from 2.6:
> > >   In mode 2 the MAP_NORESERVE flag is ignored. 
> > 
> > This is precisely what I thought to be the bug in glibc: the fact
> > (at least with the 2.4 kernel) that this flag is used by glibc.
> > On which documentation is glibc based (in particular, concerning
> > old_mmap)?
> 
> I don't know.  The comments suggest malloc made the choice
> deliberately, though, so I don't think it's appropriate to reverse it.

But there are no explanations concerning this choice. And without
explanations, it is difficult to say if this is right or wrong.

The malloc(3) man page more or less says that this is a kernel bug
and a kernel with strict overcommit is necessary. But this is a
contradiction with the 2.4 kernel documentation, which says that
the kernel checks if there's enough memory left (if the memory is
really reserved -- so the problem of reserving memory comes from
the caller, here glibc).

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% validated (X)HTML - Acorn / RISC OS / ARM, free software, YP17,
Championnat International des Jeux Mathématiques et Logiques, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA



Reply to: