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 9A202A0597; Tue, 21 Apr 2020 14:19:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D8D71C2EF; Tue, 21 Apr 2020 14:19:12 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 53FED1C2BC for ; Tue, 21 Apr 2020 14:19:10 +0200 (CEST) IronPort-SDR: Oy5RgpRfkNnX9j/evwAdyUfkVfJ8qD/wwGFK05O+YBUd9EZbFlKlYQAl6Ur9qZRLk6TA1ZxR7t jygrUyMi3Y0Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2020 05:19:09 -0700 IronPort-SDR: URsSJGybhrWljvo6Fp2NkCjFRiPjDV9pAKC9C31fquF4ZSNFjGxtP+HppsrtAmlIKZv6VDcDX3 JDa9HXSOieOw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,410,1580803200"; d="scan'208";a="255278552" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.208.123]) ([10.213.208.123]) by orsmga003.jf.intel.com with ESMTP; 21 Apr 2020 05:19:07 -0700 To: Feng Li , David Marchand Cc: Li Feng , Kyle Zhang , dev , fanyang@smartx.com References: <20200420070508.645533-1-fengli@smartx.com> From: "Burakov, Anatoly" Message-ID: Date: Tue, 21 Apr 2020 13:19:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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" 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 = 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; > } 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