tech-userlevel archive

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

mmap, ENOMEM and setrlimit



Hi

I am tracking a ENOMEM issue in perfused. It happens in libpuffs's
callcontext.c:

        sp = mmap(NULL, stacksize, PROT_READ|PROT_WRITE,
            MAP_ANON|MAP_PRIVATE|MAP_ALIGNED(pu->pu_cc_stackshift), -1, 0);

With stacksize = 262144 and pu->pu_cc_stackshift = 18, which looks rather
reasonable.

setrlimit is called to set RLIMIT_DATA and RLIMIT_AS soft and hard limit to
RLIM_INFINITY, hence I am a bit surprised to hit ENOMEM. I must have been
missing  something. Any hint?

        rl.rlim_cur = RLIM_INFINITY; 
        rl.rlim_max = RLIM_INFINITY;
 
        if (setrlimit(RLIMIT_DATA, &rl) < 0) {
                DERR(EX_OSERR, "%s: setrlimit data failed: %s", __func__,
                    strerror(errno)); 
        }
 
        if (setrlimit(RLIMIT_AS, &rl) < 0) {
                DERR(EX_OSERR, "%s: setrlimit as failed: %s", __func__,
                    strerror(errno));
        }

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index