lkml.org 
[lkml]   [2003]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: 2.2/2.4/2.6 VMs: do malloc() ever return NULL?
    From
    Date
    On Tue, 2003-11-25 at 14:27, Ihar 'Philips' Filipau wrote:
    > Hello!
    >
    > I just wondering: do last three stable branches of LK able to return
    > malloc()==NULL and/or ENOMEM?
    >
    > 2.2: I cannot test this stuff right now - but it was hanging hard on
    > "for (;;) memset(malloc(N), 0, N);" So we do not have NULL from malloc().
    > 2.4: same behaviour if OOM disabled. But by default (OOM even has no
    > configuration entry - so always on) it just kills offending process. No
    > NULL pointer either.
    > 2.6: the same as 2.4 with oom killer (default conf). I have no test
    > system to check 2.6. w/o oom killer.
    >
    > Resume: we malloc() never returns NULL. so man-pages are incorrect ;-)

    that is due to the overcommit policy that your admin has set.
    You can set it to disabled and then malloc will return NULL in userspace


    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2005-03-22 13:58    [W:0.020 / U:63.244 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site