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 3B594A00E6 for ; Fri, 19 Apr 2019 05:31:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6DF3A1BA96; Fri, 19 Apr 2019 05:31:36 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by dpdk.org (Postfix) with ESMTP id 5D20C1BA92 for ; Fri, 19 Apr 2019 05:31:35 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id b3so2049690plr.7 for ; Thu, 18 Apr 2019 20:31:35 -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=+OoLwGGk/7OWEDlQHs2sUfpBgLwQULrotiHsYeB/cDM=; b=n13+h7djzyjw/cFrKgZZhntRi2vWPRYhr8EI7aRE1CRAb3tIpQKfTaUV0+eULqwNHu 5uqioIekyvEpLL1kLCdEgCC1tZpLEhXncuVGbavGIFO3akQ7BQPqIVjnWOe43p8myeVc 0F9jIgFEgMD0MkPC6aeOkFDAjz1zwTAWrOYc505zAXIL90ycA/NcKVwnQw7o8yaV78zu 0Na8NcWfFVsFZQ91b8jQk5coHQY3974VfyWrxGsleIBWKaUZ/NMsNdzfEvzy5hijOu18 aa9DHRZ+NTqCB1OnjYy/9HhFjPMwprLOyJyEaNptmR+HjG0KPPr1A4KAZSgCI6LUtrWM iqEQ== 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=+OoLwGGk/7OWEDlQHs2sUfpBgLwQULrotiHsYeB/cDM=; b=IhD5jGWOvDULVerh93uFAp3Gqo4zbNoKfJeWbaG0uMHXnBgKcMr1rJLLRJ0OKRx/zQ HXfD2dVJ+o5hIt4id8IpkB3ZRq6OI2R828or22sK6lMKQ8mXZ2T5XCAqxa4nI/idYbvm y5rMkxc6avEnBI36gGEf/MiC+/bgeFjxufm1HbzARiE39OqzNuG4kG0eq9Sk9V84IH50 viMGzEMF6ljO+d4zr/Glaj6A8BQfHVfqCi4YuMRY+c6vttoJEdpc7yPSOALeyYOYP/QG ftJoqHF7fzyKi7iJSBR4uri3K9sSZCyHuVzmb7AxYgH0ou9CljXrDn2R+iG1T/FeAkL3 zGaQ== X-Gm-Message-State: APjAAAVjRwAukfJzZtFKvMpflHYZVchx3Rs9JJDhFBt0M612Vi/ikc3j 6onLuZgANmVhIipsMGAEDxxqfwrI8/A= X-Google-Smtp-Source: APXvYqxVpBtxgW+kC1PPx0FrimYYyYcxlZRo48drft52X9gEgVWlZzV50wSG24jcsT8bnwU1ZJfygQ== X-Received: by 2002:a17:902:b407:: with SMTP id x7mr1381880plr.288.1555644694568; Thu, 18 Apr 2019 20:31:34 -0700 (PDT) Received: from 2001-b400-e357-d2bb-40d4-5faf-a632-27ec.emome-ip6.hinet.net (2001-b400-e357-d2bb-40d4-5faf-a632-27ec.emome-ip6.hinet.net. [2001:b400:e357:d2bb:40d4:5faf:a632:27ec]) by smtp.gmail.com with ESMTPSA id y8sm4770653pgk.20.2019.04.18.20.31.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 20:31:34 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) From: =?utf-8?B?5pu+5oe35oGp?= In-Reply-To: <20190418195944.04c4cec5@hermes.lan> Date: Fri, 19 Apr 2019 11:31:27 +0800 Cc: users@dpdk.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <5BDADE86-3D04-4BE5-AC95-03BE123ED42B@csie.io> <20190418195944.04c4cec5@hermes.lan> To: Stephen Hemminger X-Mailer: Apple Mail (2.3445.104.8) 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, Stephen, Yes, I set huge page in default_hugepagesz=3D1G hugepagesz=3D1G = hugepages=3D4 and also did rte_eal_init at the beginning of my program. thanks for reply. > 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?