tech-userlevel archive

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

mmap, ENOMEM and setrlimit


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

        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

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__,
        if (setrlimit(RLIMIT_AS, &rl) < 0) {
                DERR(EX_OSERR, "%s: setrlimit as failed: %s", __func__,

Emmanuel Dreyfus

Home | Main Index | Thread Index | Old Index