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 9BD39A05D3 for ; Tue, 23 Apr 2019 19:34:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 646FC1B3FC; Tue, 23 Apr 2019 19:34:11 +0200 (CEST) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 1AB2F1B3F0 for ; Tue, 23 Apr 2019 19:34:10 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id e24so7822948pfi.12 for ; Tue, 23 Apr 2019 10:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=csie-io.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=fIzvgWcXWnFLCxz9nOUKIdCeCGsQ7weXgcSuUG3KfM0=; b=1fuVoqJ0C4JhXfILvr+yCcIrR+oQsi3lwwRpMK/eDSEi8y2Zu+kKj+D4AsS83fe4Vj HElslv2Rg5FYlW6X7FQ4G8j9CNbM4fOx4bJE6e8wviHj4fDicsJWzcUE6jyDNIYNs7Ef vW99jHEfrV3ebL43SZ+klbNO5kjFpKrva8E74CbSZJh/vhOdKVQqX5/23eYaqHbSpOoe BOp67Y0jgleDEVJUwEwNYuY39NZhK8JusR+3wvYVCQR+F3lk5Oh1v23ip07UzduAkPzz 2bsJyFYdQvrJ+/3uX1odaNQVRR3x6Qg50AGGZ5zq/b83piaxPFLF4TEkyl7PEZCRwPCa 3fyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=fIzvgWcXWnFLCxz9nOUKIdCeCGsQ7weXgcSuUG3KfM0=; b=e3ywW+Z5mbslghVlsaLsTqJMJBJfg5ai5OkYtT5xW63l9CucwBYM+VRvM/Si5JF7bg dlNoBpLVZY08zpH0NzwG9XJ6Racdqnlcur3gSVVFSKrADRpFgoDoOQJdFYzbqmE46lR4 /wmwPvuinhN8NNLgMNCCOJrwwr9aDGglzh/H2XBp+CYeRZsuDFgj+Zhb2COW2T9V11D6 pzb9BsWVBjjMr0J+HEnDEjYlrmWnrH+s6Lp9uio70e11PBmCAP4Hfj9xzHJumWtgdKxW 5eM64dTSh3ZN7BqJGNjhPujj4LqlpfOjcJy1jfSTTNC5/T5jwK3GjSj+ohH03OzBpKpE 7tvg== X-Gm-Message-State: APjAAAUhMBWAD0BHSA5wM277uvvJWpfHGstwxNgsTnOIzwheNKcU90A6 9cEVsGKl1ACqAwDsw6ruiEK9nw== X-Google-Smtp-Source: APXvYqy/CcoxCResoWnMv6RwPmJzbihF6UgghoGFLXe0tf3zIyJlK5q2QCKSKxU11RnAj6AzVwXRxQ== X-Received: by 2002:aa7:920b:: with SMTP id 11mr27306456pfo.3.1556040849298; Tue, 23 Apr 2019 10:34:09 -0700 (PDT) Received: from [192.168.0.143] (36-231-162-176.dynamic-ip.hinet.net. [36.231.162.176]) by smtp.gmail.com with ESMTPSA id j22sm22805718pfn.129.2019.04.23.10.34.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 10:34:08 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) From: =?utf-8?B?5pu+5oe35oGp?= X-Mailer: iPhone Mail (16E227) In-Reply-To: Date: Wed, 24 Apr 2019 01:34:06 +0800 Cc: Stephen Hemminger , "users@dpdk.org" Content-Transfer-Encoding: quoted-printable Message-Id: <49831062-D811-42F2-A92C-AD8962039E7B@csie.io> References: <5BDADE86-3D04-4BE5-AC95-03BE123ED42B@csie.io> <20190418195944.04c4cec5@hermes.lan> <774EEFED-F56A-426E-93FA-92BF9584DD4E@csie.io> To: "Wiles, Keith" 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" Hi Keith, Yes I ran this program as root=20 However I ran it with DPDK 18.11 release. I will try 19.05 later. Besides, my cpu is E5-2650 v4. NICs are Intel x520 DA2 and Mellanox connectx-3 thank you for reply Best Regards, > Wiles, Keith =E6=96=BC 2019=E5=B9=B44=E6=9C=8822=E6= =97=A5 =E4=B8=8B=E5=8D=889:09 =E5=AF=AB=E9=81=93=EF=BC=9A >=20 >=20 >=20 >> On Apr 22, 2019, at 1:43 AM, =E6=9B=BE=E6=87=B7=E6=81=A9 wr= ote: >>=20 >> Hi Wiles, >>=20 >> here is my sample code with just doing rte_eal_init() and rte_malloc() . >>=20 >>=20 >>=20 >=20 > I tried the attached code and it works on my machine with something close t= o DPDK 19.05 release. >=20 > I only use 2 Meg pages, but I assumed it would not make any difference. >=20 > Did you run this example as root? >>=20 >> And my start eal cmdline option is ./build/test -l 0-1 -n 4 >>=20 >> Thank you very much for your reply >>> Wiles, Keith =E6=96=BC 2019=E5=B9=B44=E6=9C=8821= =E6=97=A5 =E4=B8=8A=E5=8D=884:29 =E5=AF=AB=E9=81=93=EF=BC=9A >>>=20 >>>=20 >>>=20 >>> Sent from my iPhone >>>=20 >>>> On Apr 18, 2019, at 11:31 PM, =E6=9B=BE=E6=87=B7=E6=81=A9 = wrote: >>>>=20 >>>> HI, Stephen, >>>>=20 >>>> Yes, I set huge page in default_hugepagesz=3D1G hugepagesz=3D1G hugepa= ges=3D4 >>>>=20 >>>> and also did rte_eal_init at the beginning of my program. >>>>=20 >>>> thanks for reply. >>>=20 >>> Is the core doing the rte_malloc one of the cores listed in the core lis= t on the command line. In other words the pthread doing the allocation shou= ld be the master lcore or one of the slave lcores. >>>=20 >>> Also I seems like a very simple test case, can you do the rte_eal_init()= and then do the allocation as your sample code looks and then exit? Does th= is cause a segfault? >>>>=20 >>>>=20 >>>>> Stephen Hemminger =E6=96=BC 2019=E5=B9=B4= 4=E6=9C=8819=E6=97=A5 =E4=B8=8A=E5=8D=8810:59 =E5=AF=AB=E9=81=93=EF=BC=9A >>>>>=20 >>>>> On Fri, 19 Apr 2019 09:11:05 +0800 >>>>> =E6=9B=BE=E6=87=B7=E6=81=A9 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 =E2=80=A6 >>>>>> =E2=80=A6=E2=80=A6=E2=80=A6... >>>>>> 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=E2=80=99; //segmentation fault here >>>>>> str1[1] =3D '\0'; >>>>> Do you have huge pages? >>>>> Did you do eal_init? >>>>=20 >>=20 >> >=20 > Regards, > Keith >=20