From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id AEA1EA00E6 for ; Sat, 20 Apr 2019 22:30:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D8231B6C3; Sat, 20 Apr 2019 22:30:10 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id ECC661B682 for ; Sat, 20 Apr 2019 22:30:08 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Apr 2019 13:30:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,375,1549958400"; d="scan'208";a="152520062" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga002.jf.intel.com with ESMTP; 20 Apr 2019 13:30:07 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sat, 20 Apr 2019 13:30:06 -0700 Received: from fmsmsx117.amr.corp.intel.com ([169.254.3.26]) by FMSMSX119.amr.corp.intel.com ([169.254.14.214]) with mapi id 14.03.0415.000; Sat, 20 Apr 2019 13:29:01 -0700 From: "Wiles, Keith" To: =?iso-2022-jp?B?GyRCQT1YZzI4GyhC?= CC: Stephen Hemminger , "users@dpdk.org" Thread-Topic: [dpdk-users] segmentation fault after using rte_malloc() Thread-Index: AQHU9kzR3X3b+IXxAUykg+o/uxvgrqZDQKAAgAAI3ICAAjlKzQ== Date: Sat, 20 Apr 2019 20:29:00 +0000 Message-ID: References: <5BDADE86-3D04-4BE5-AC95-03BE123ED42B@csie.io> <20190418195944.04c4cec5@hermes.lan>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-users] segmentation fault after using rte_malloc() X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" Sent from my iPhone > On Apr 18, 2019, at 11:31 PM, =1B$BA=3DXg28=1B(B wrote: >=20 > HI, Stephen, >=20 > Yes, I set huge page in default_hugepagesz=3D1G hugepagesz=3D1G hugepage= s=3D4 >=20 > and also did rte_eal_init at the beginning of my program. >=20 > thanks for reply. Is the core doing the rte_malloc one of the cores listed in the core list o= n the command line. In other words the pthread doing the allocation should= be the master lcore or one of the slave lcores. Also I seems like a very simple test case, can you do the rte_eal_init() an= d then do the allocation as your sample code looks and then exit? Does this= cause a segfault? >=20 >=20 >> Stephen Hemminger =1B$B1w=1B(B 2019=1B$BG/= =1B(B4=1B$B7n=1B(B19=1B$BF|=1B(B =1B$B>e8a=1B(B10:59 =1B$BUmF;!'=1B(B >>=20 >> On Fri, 19 Apr 2019 09:11:05 +0800 >> =1B$BA=3DXg28=1B(B wrote: >>=20 >>> Hi all,=20 >>>=20 >>> i have 1 problem while using rte_malloc >>>=20 >>> Every time I use this function and use the memory it returns, it sho= ws segmentation fault(core dump) >>>=20 >>> Is something wrong? >>>=20 >>> thanks. >>>=20 >>>=20 >>> rte init =1B$B!D=1B(B >>> =1B$B!D!D!D=1B(B... >>> unsigned char *str1; >>> printf("str1 addr =3D %x\n", str1); >>> str1 =3D rte_malloc(NULL,2,RTE_CACHE_LINE_SIZE); >>> printf("str1 addr =3D %x\n", str1); >>> str1[0] =3D 'a=1B$B!G=1B(B; //segmentation fault here >>> str1[1] =3D '\0'; >> Do you have huge pages? >> Did you do eal_init? >=20