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 5F6E7A05D3 for ; Wed, 24 Apr 2019 16:22:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0FB271B52A; Wed, 24 Apr 2019 16:22:40 +0200 (CEST) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by dpdk.org (Postfix) with ESMTP id DEC451B3E8 for ; Wed, 24 Apr 2019 16:22:37 +0200 (CEST) Received: by mail-pg1-f171.google.com with SMTP id v12so9478970pgq.1 for ; Wed, 24 Apr 2019 07:22:37 -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=32DBLsFSWQDb4fXPjoq5CDDig+r2sts7csCzYd1dcIg=; b=oe7kca5XMLW8SVHTVJ6AdjFK1NZCYndBQxaPUych6LlYYLW8MNYEHIWDFr2V8L780K xhhUUOn1wLrm0BOY4BhSYqAwp1K9QZ+09Z/dwqhF89otaqk139uoKYzPcQbRIpW26LtO 15f1LDIZXkgvfJ3RZEEKq8cqY604CA8R60+QKyqlmxaJsLybPokhIKAALeNRDAsGxwRI a4BNZEo6016lW3kz6ZsPvm9q99FsNN6RqZkY5zqefnUs6I84MsP7eeiRGTBx8tcxHVDk IKF1C1oKKKRLehJ78LsWbYWG3dS2um5Di/SLkw7Nfvm5hr+sEWPrlFDbrdpdsVBPCjyE IWdQ== 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=32DBLsFSWQDb4fXPjoq5CDDig+r2sts7csCzYd1dcIg=; b=YJcnZsEPUlA5ESIupzyVLcn8SUdmVKgZU3S1vrByHoClDELmPZ4/wGOjXkudPEO3cC WMwp1HjUjKKTYMhz65U9BrVKyYRlQTaHGGmpEvzWd6q4v2rDmWuOvdPfF0Qebt+qs275 3GiJwIvi3/pD5ApaayYA1hO4DOgHKwL/8d94Vji/QpXxszDRGTTqhbhVjkgg54sE+QY8 oV0iumgyUs/qvNunZ+2+m7NmikvamBn+POUleW8QKbhjY+nARyfSpHjYHsMGkpkpKbCn 7gN8q7aBBcErRSKF3jpMtgFAkoXYlAfTstXwITi1M+SRIbwW1FuaeotKQjgNkuNyWtI0 h1Nw== X-Gm-Message-State: APjAAAVNKB8AR/Zutd2u5SImj8VsrCgxjDydGeEv9aV87RKCV+9wWLmj DsXIkRLp34tnRaU/EvMj7OAigA== X-Google-Smtp-Source: APXvYqyfObdTgSGLXn//TT21slQkzhbS4SRJqtvCIOqYtG6nWjKx9NzryauOl9A3/pHjGLHSIq74/g== X-Received: by 2002:a65:6490:: with SMTP id e16mr22612573pgv.13.1556115756779; Wed, 24 Apr 2019 07:22:36 -0700 (PDT) Received: from [192.168.0.136] (36-231-162-176.dynamic-ip.hinet.net. [36.231.162.176]) by smtp.gmail.com with ESMTPSA id r145sm43598629pgr.84.2019.04.24.07.22.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 07:22:36 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) From: =?utf-8?B?5pu+5oe35oGp?= In-Reply-To: <49831062-D811-42F2-A92C-AD8962039E7B@csie.io> Date: Wed, 24 Apr 2019 22:22:33 +0800 Cc: Stephen Hemminger , "users@dpdk.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7C65E563-6C35-4F09-A449-B7BD110AA57E@csie.io> References: <5BDADE86-3D04-4BE5-AC95-03BE123ED42B@csie.io> <20190418195944.04c4cec5@hermes.lan> <774EEFED-F56A-426E-93FA-92BF9584DD4E@csie.io> <49831062-D811-42F2-A92C-AD8962039E7B@csie.io> To: "Wiles, Keith" X-Mailer: Apple Mail (2.3445.6.18) 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, I have tried DPDK 19.05-rc2, 19.02, 18.11 on VMware e1000 driver, Dell = R630 with Mellanox Connectx-3 and Intel X520 However I still got segmentation fault with all above setting here are my settings :=20 With CX3=20 modprobe -a ib_uverbs mlx4_en mlx4_core mlx4_ib /etc/init.d/openibd restart ls -d /sys/class/net/*/device/infiniband_verbs/uverbs* | cut -d / -f 5 { for intf in ens3 ens8; do (cd "/sys/class/net/${intf}/device/" && pwd -P); done; } | sed -n 's,.*/\(.*\),-w \1,p' mount -t hugetlbfs nodev /mnt/huge With X520 and e1000: mount -t hugetlbfs nodev /mnt/huge modprobe uio insmod dpdk-18.11/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko /root/dpdk-18.11//usertools/dpdk-devbind.py --bind=3Digb_uio 00:0a.0 /root/dpdk-18.11//usertools/dpdk-devbind.py --bind=3Digb_uio 00:08.0 My OS is CentOS 7.5 in KVM with SRIOV enable hugepage size is set to 2MB Thanks for reply Best Regard, > =E6=9B=BE=E6=87=B7=E6=81=A9 =E6=96=BC 2019=E5=B9=B44=E6=9C= =8824=E6=97=A5 =E4=B8=8A=E5=8D=881:34 =E5=AF=AB=E9=81=93=EF=BC=9A >=20 > Hi Keith, >=20 > Yes I ran this program as root=20 >=20 > However I ran it with DPDK 18.11 release. >=20 > I will try 19.05 later. >=20 > Besides, my cpu is E5-2650 v4. > NICs are Intel x520 DA2 and Mellanox connectx-3 >=20 > thank you for reply >=20 > Best Regards, >=20 >=20 >=20 >=20 >> Wiles, Keith =E6=96=BC 2019=E5=B9=B44=E6=9C=882= 2=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 = wrote: >>>=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 to 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=88= 21=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 = hugepages=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 list on the command line. In other words the pthread doing the = allocation should 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 this cause a segfault? >>>>>=20 >>>>>=20 >>>>>> Stephen Hemminger =E6=96=BC = 2019=E5=B9=B44=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 = shows 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