From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 202BFA05A0; Tue, 21 Apr 2020 23:55:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 791F61D579; Tue, 21 Apr 2020 23:55:14 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 9D5A71D37E for ; Tue, 21 Apr 2020 18:39:08 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id w3so5431729plz.5 for ; Tue, 21 Apr 2020 09:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=eQgZbd527H9Gs6k4e5tVVpibCwUoEVkLlpJGJyTe440=; b=YF/QlHzcgtXxmbVX9l5WLPIEvWMbJDPQVviplsJH1mJU97nF9yvd0GlISOCu0Bb7OU i+++h/Nev2h+h0UGfc/e7FqlH6eFo10DD/umtOr1QUQ85PAyR7M4OESOMUJQuKqepskV Iet99Rx8D7/yrAl3zxzGmZ7wFbRDM7pu7BttL/5MNwjJXmztm3aAJUotXf7r10dKsG+S UybukGea5uxKAGCBjLlqhulJggCcxuvCERnqYNR7milY2JsYv8VOQxBiKyX5jauMH7Pb nELlEyScCMUlw2ghp1Z8tHljh3fljI5jluKXOoPpbkttjfMZUu94bjbz2kiSi39dzpUb 0SmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=eQgZbd527H9Gs6k4e5tVVpibCwUoEVkLlpJGJyTe440=; b=eyexL3ZRyYx+J6/3MwFAaLl9SEnomS3FhpcnhWDzwSs3ahCpDraqg093CVmfHz33pS RAGX4nS4/asOFLtK3rIC14FmX1rGRhZimFm/f2EoWsyWvOZ9msfyz3Nu18HtovPkeRIn 7kYYT9cNxrNZtDp2o4MqEZyxOhK005DBuNEjsR7saVWwSnv/2WPijJitQISA4V0Mx6LG uJQd9XeZLwGnXT/apNbyij/wu+rqB13gm+GYIbXiEZBtScGosO52NFio1Q269pZV4/h/ aH7Gcoe+rIyLYdGsAf9TDpS0DG+dHsAkaP+8tu+Z8X/13j/7cdu9pYTEPp7JBSHlw44c 6NTw== X-Gm-Message-State: AGi0PuZZwUwl7uHaCuIIaDfbX+v6kOaXDXOQe3smXa9KBXGqJN6ufALl 4JckoO5v4w4qEXvcFUT6OtRTPyHH9NbLiAiZz9A= X-Google-Smtp-Source: APiQypJNhVEZI+qgN/A7MqNmGUNrAhxWEA9G0qtI0TXCzYS6N5dx1VN4d+Rtiuq48NlLBbfXzVIjXE79waOJxVbL9/E= X-Received: by 2002:a17:902:6b86:: with SMTP id p6mr22218861plk.315.1587487147747; Tue, 21 Apr 2020 09:39:07 -0700 (PDT) MIME-Version: 1.0 References: <20200420070508.645533-1-fengli@smartx.com> In-Reply-To: From: Feng Li Date: Wed, 22 Apr 2020 00:38:41 +0800 Message-ID: To: "Burakov, Anatoly" Cc: David Marchand , Li Feng , Kyle Zhang , dev , fanyang@smartx.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Tue, 21 Apr 2020 23:55:10 +0200 Subject: Re: [dpdk-dev] [PATCH] eal: add madvise to avoid dump memory X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Anatoly, This program could run like this: gcc test_map.c ./a.out 2 & gcore `pidof a.out` You will get a core dump sized to 2GiB. Thanks, Feng Li Burakov, Anatoly =E4=BA=8E2020=E5=B9=B44=E6=9C= =8821=E6=97=A5=E5=91=A8=E4=BA=8C =E4=B8=8B=E5=8D=888:19=E5=86=99=E9=81=93= =EF=BC=9A > > On 21-Apr-20 12:06 PM, Feng Li wrote: > > #include > > #include > > #include > > #include > > #include > > #include > > > > int main(int argc, char** argv) { > > // FIXME(fengli): XXXXX > > uint64_t gb =3D atoi(argv[1]); > > void* ptr =3D mmap(0, gb << 30, PROT_NONE, MAP_PRIVATE | > > MAP_ANONYMOUS, -1, 0); > > if (ptr =3D=3D (void*)-1) { > > perror("[-] mmap failed with MAP_PRIVATE | MAP_ANONYMOUS"); > > exit(1); > > } > > while(1) > > sleep(1); > > return 0; > > } > > DONTDUMP is available since Linux 3.4. I presume our minimum kernel > version is higher than that. > > I have little idea of how dumping works, but reading the manpage for > madvise, DONTDUMP should be the way to go here. Also, reading up on > PROT_NONE, i can't find any references to this memory necessarily being > excluded from core dumps. > > That said, I've run the program above, and i got a core dump sized > ~100K. Do i need any special configuration to trigger core dump that > would include that anonymous memory? > > -- > Thanks, > Anatoly