Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 6 Aug 2011 13:50:15 +0200
From: Szabolcs Nagy <>
Subject: Re: New daily reports - debugging alloc.c et al

* Szabolcs Nagy <> [2011-08-06 13:15:05 +0200]:
> pages, it would be better to do it in bigger chunks like:
>     /*tries to mmap even more now:*/
>     printf("Number of *additional* bytes mmap'd:\n");
>     most=0;
>     for(j=1<<20; j; j/=2) {
>         printf("%8zu ", j);
>         for(i=0; mmap(NULL, j*PAGE_SIZE, PROT_NONE, MAP_PRIVATE, fd, 0) != MAP_FAILED; ++i)

hm j=1<<20 is not the right choice, 1<<16 should be ok

> after this the last loop with malloc immediately
> fails (there is nothing to mmap anymore, but maybe
> if the allocator already has some area reserved
> then a few mallocs can succeed)

it seems if i add a small malloc at the begining of main
then the last loop can still allocate with glibc
(here glibc can allocate 32 pages worth of extra space)

interestingly /proc/self/smaps does not seem to
list all the successful mmaps.. i wonder why but
i did not investigate it further

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.