Re: mmap/clone returns ENOMEM with lots of free memory
From: Christoph Lameter
Date: Mon May 07 2012 - 16:36:33 EST
On Mon, 7 May 2012, Robert ÅwiÄcki wrote:
> root@ise-test:~/kern-fuz# ./cont.sh
> su: Cannot fork user shell
> su: Cannot fork user shell
> su: Cannot fork user shell
>
> root@ise-test:~/kern-fuz# strace -e mmap,clone su test -c 'kill -CONT
> -1' 2>&1 | grep "= \-1"
> clone(child_stack=0,
> flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
> child_tidptr=0x7fadf334f9f0) = -1 ENOMEM (Cannot allocate memory)
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
> 0) = -1 ENOMEM (Cannot allocate memory)
Hmmm... That looks like some maximum virtual memory limit was violated.
Check ulimit and the overcommit settings (see /proc/meminfo's commitlimit
etc)