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 99151A00C4; Thu, 23 Apr 2020 14:22:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7AE671C1F6; Thu, 23 Apr 2020 14:22:46 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 1978D1C1BC for ; Thu, 23 Apr 2020 14:22:44 +0200 (CEST) IronPort-SDR: os0hOjtEKw058jgfICRfaQhwFvwDAW5fGygXP0AScXsU9UxMc+UCiDxqzHDgUR4URjwDX2bH/2 iHIa1EyjLRiA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2020 05:22:44 -0700 IronPort-SDR: LU3Ws+tbFibTuRVwPDBjyHNG1Ikfy3rC/yGTdHQJ3S8X0OtJj1EsJ51vG2k6eDukHORFialY8W oLyTDInouD5A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,307,1583222400"; d="scan'208";a="280385416" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.241.89]) ([10.213.241.89]) by fmsmga004.fm.intel.com with ESMTP; 23 Apr 2020 05:22:42 -0700 To: Feng Li Cc: Li Feng , David Marchand , Kyle Zhang , dev , Yang Fan References: <20200420070508.645533-1-fengli@smartx.com> <4d2145b0-91bd-23a9-d1f0-26b60585b003@intel.com> From: "Burakov, Anatoly" Message-ID: <2c84372f-00c3-ed09-2cf5-fed1dff4b2bd@intel.com> Date: Thu, 23 Apr 2020 13:22:42 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.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 23-Apr-20 7:36 AM, Feng Li wrote: > Hi, > I have tested as follows, the core dump file is ~ 200KB. > It should generate one core dump file each crash. > > #include > #include > #include > #include > #include > #include > > int main(int argc, char** argv) { > // FIXME(fengli): XXXXX > uint64_t size = 1<<30; > void* ptr = mmap(0, size , PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); > if (ptr == (void*)-1) { > perror("[-] mmap failed with MAP_PRIVATE | MAP_ANONYMOUS"); > exit(1); > } > if (madvise(ptr, size , MADV_DONTDUMP) != 0) > perror("[-] madvise failed"); > while(1) > sleep(1); > return 0; > } > That's odd, your code works. Mine, even though it did the same thing, didn't work the same way. My compiler must like you more than it likes me :) (or perhaps i had a typo...) Anyway, i can see that this indeed prevents core dumps on madvise'd memory (i've also tested it with PROT_NONE). I'll go ahead and ack the original patch then. -- Thanks, Anatoly