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 8B1FBA05D3 for ; Mon, 22 Apr 2019 08:43:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CFA131B467; Mon, 22 Apr 2019 08:43:30 +0200 (CEST) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by dpdk.org (Postfix) with ESMTP id 6CDC61B463 for ; Mon, 22 Apr 2019 08:43:29 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id v2so2980302pge.13 for ; Sun, 21 Apr 2019 23:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=csie-io.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=QLPmJmDF8MS8GHuW8f1wjB2K78xKOu4QsyEpIfCps1o=; b=mL4hPO8vXTkDubG2HdpjtyV5oCqg2HBJRlTmf2AYBjd7ufkmfF3FFwEnOeN6GD55Fl v0GlXEXEFLrtS8nKmF7d73CA30SGhj56dgF2S9d5nBklMdmPR2zGbxvpRUzhi6D8O+si U3s8cbl37GydFLbWHolD/DPruqRKw3YY4bTIXGz1+g0oy1yXrcUjDs7+fuuz+n5HYEDm 49v2pwkRo5U2Z9e6KVOprNSqfBm0avZH804/Vz0i9jYwAT/6f6BSYmeld6R6kAnVEfhG 7IzP4e2rVNdAKQrCUO0OhYrW+m7yOXEK55Hnfy7EAHvO0CD7RieDNDQ/ZSxLNyJmVUpJ XFdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=QLPmJmDF8MS8GHuW8f1wjB2K78xKOu4QsyEpIfCps1o=; b=IUI9kTiqsZLuY1KeFI3mjtkmBa0b8J8e/glVXQoQeb2tZYB1pvH1iDSd1+CuTdCVRL CGy0SnighgpvjF1A90G1Tf0ZFjjlrry81E5PXy0VXFeSoSqWJepi7RQynsN69H1iC8H0 qpqdqH+4ejj3P9wryHPnxS0qoqhUcnBCNrapyfb+KRXDgUJyyMfdZhSnOR8nGrdFRYPT vJNg+0QKVYfuiRg29r8GQ4+nXdjtjX5jqRp5h5yOfgKGuh2K8xBDAoQiODV4ro7lgR7q MhtTHihRbJ1VovdvmQ6V4dYwQxqhWb6e7c7ZXwH4/NYwe5um1uYSdfq0DH6B/m06Vdna P+NA== X-Gm-Message-State: APjAAAWE1U5jlas7XE53YNAI1u/9RSTywvc0hm3ZnH7/ctElRUhyN00+ SCjooRwa0Ff4xYX2bgki8VpXSA== X-Google-Smtp-Source: APXvYqyJHWghuRY8+z/g5qZpurS70cg8dayjviXp2bWuxYsrb3Ux0YQDB9HXwdyLwFyDUQtI4FMmag== X-Received: by 2002:a62:4ec8:: with SMTP id c191mr19157214pfb.138.1555915408749; Sun, 21 Apr 2019 23:43:28 -0700 (PDT) Received: from 2001-b400-e382-52a8-e175-0092-164d-a49a.emome-ip6.hinet.net (2001-b400-e382-52a8-e175-0092-164d-a49a.emome-ip6.hinet.net. [2001:b400:e382:52a8:e175:92:164d:a49a]) by smtp.gmail.com with ESMTPSA id v20sm15939422pfn.116.2019.04.21.23.43.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Apr 2019 23:43:28 -0700 (PDT) From: =?utf-8?B?5pu+5oe35oGp?= Message-Id: <774EEFED-F56A-426E-93FA-92BF9584DD4E@csie.io> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Date: Mon, 22 Apr 2019 14:43:19 +0800 In-Reply-To: Cc: Stephen Hemminger , "users@dpdk.org" To: "Wiles, Keith" References: <5BDADE86-3D04-4BE5-AC95-03BE123ED42B@csie.io> <20190418195944.04c4cec5@hermes.lan> X-Mailer: Apple Mail (2.3445.104.8) X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 Wiles, here is my sample code with just doing rte_eal_init() and rte_malloc() . -------------- next part -------------- -------------- next part -------------- And my start eal cmdline option is ./build/test -l 0-1 -n 4 Thank you very much for your reply > Wiles, Keith ? 2019?4?21? ??4:29 ??? > > > > Sent from my iPhone > >> On Apr 18, 2019, at 11:31 PM, ??? wrote: >> >> HI, Stephen, >> >> Yes, I set huge page in default_hugepagesz=1G hugepagesz=1G hugepages=4 >> >> and also did rte_eal_init at the beginning of my program. >> >> thanks for reply. > > 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. > > 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? >> >> >>> Stephen Hemminger ? 2019?4?19? ??10:59 ??? >>> >>> On Fri, 19 Apr 2019 09:11:05 +0800 >>> ??? wrote: >>> >>>> Hi all, >>>> >>>> i have 1 problem while using rte_malloc >>>> >>>> Every time I use this function and use the memory it returns, it shows segmentation fault(core dump) >>>> >>>> Is something wrong? >>>> >>>> thanks. >>>> >>>> >>>> rte init ? >>>> ???... >>>> unsigned char *str1; >>>> printf("str1 addr = %x\n", str1); >>>> str1 = rte_malloc(NULL,2,RTE_CACHE_LINE_SIZE); >>>> printf("str1 addr = %x\n", str1); >>>> str1[0] = 'a?; //segmentation fault here >>>> str1[1] = '\0'; >>> Do you have huge pages? >>> Did you do eal_init? >>