[dpdk-dev] [PATCH] eal: add madvise to avoid dump memory

Feng Li lifeng1519 at gmail.com
Tue Apr 21 13:06:55 CEST 2020


Hi David,

Mmap with PROT_NONE does not affected the core dump size.

Here is a simple test prog:

#include <sys/mman.h>
#include <time.h>
#include <stdint.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char** argv) {
    // FIXME(fengli): XXXXX
    uint64_t gb = atoi(argv[1]);
    void* ptr = mmap(0, gb << 30, PROT_NONE, MAP_PRIVATE |
MAP_ANONYMOUS, -1, 0);
    if (ptr == (void*)-1) {
        perror("[-] mmap failed with MAP_PRIVATE | MAP_ANONYMOUS");
        exit(1);
    }
    while(1)
        sleep(1);
    return 0;
}

Thanks.

David Marchand <david.marchand at redhat.com> 于2020年4月21日周二 下午3:41写道:
>
> On Mon, Apr 20, 2020 at 11:41 AM Feng Li <lifeng1519 at gmail.com> wrote:
> >
> > Thank you, Marchand,
>
> David is fine.
>
> >
> > I have just tested your patch, and it doesn't work.
> > The core dump file is still very very large, the same to virtual memory size.
>
> Please double check that the patch is in.
> I remember checking coredump size with my patch.
>
> This needs more investigation but I don't have time atm.
> Anatoly, opinion?
>
>
> --
> David Marchand
>


More information about the dev mailing list