From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6655DA00BE for ; Fri, 12 Jun 2020 09:42:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BB0C22C12; Fri, 12 Jun 2020 09:42:05 +0200 (CEST) Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by dpdk.org (Postfix) with ESMTP id 8631F2BFA for ; Fri, 12 Jun 2020 09:42:03 +0200 (CEST) Received: by mail-pj1-f66.google.com with SMTP id ga6so3328105pjb.1 for ; Fri, 12 Jun 2020 00:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=csie-io.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=F3xJJCkCiD12WqIBt1hS4kWliTu+u8TwSzysl3AmLIs=; b=kX6D4e57Y5+Ea41wUyKYiOL/SdKOxM5Pn6hkvN1d7bLntof1sHJqGcdRIyEAFhdQJz pvgEB4Ll5ZnITN2SkvCOb3q81+HQklev8LlDzrDtEUanU+w2rYiJwaKDdGiOnd74xcJ3 OqRthIodVM/LZY6eglel4Dj5aITU8YlPdMmwX8oBKaQR5YX6Oqo09cY3UZ/qBBkfHyf1 leSN/CigIRcYoT6euAnbSlr89znIC3RkxpkR++PqMYWdBRVmrZaJi97os7bwsov4vqXo hm9omTWQKyHcgn/nj5ug7Pq0FgK0rfO2Y2tRHRq568zkHadn9hlUr8c2R0yHDjlBVRan mLhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=F3xJJCkCiD12WqIBt1hS4kWliTu+u8TwSzysl3AmLIs=; b=ZtSO7ipfVzlprLvAyChAzoIuGAQvv5npF2qexgS3mN2jDmOqR52uyQUs7ss4sg1qss z0Db4yxI1K59FWhzrP2TDQKKiVCbT4xsAd1r+MyjNYh8nYHF0NP8Rk3T6d8lwtb2CiC/ HZh9C4Td79kf6CgrJ+SCyYWd8gm1iDRv/kTs/WPgIKR0lqnN7lJay08u7/AROv3rOwH1 c131sSweAIc49aEwWcMg6QEDx0twbBqYnFFx5B9wWODZDbLCx1EzgdU7AH3RMWlveVWF KktN2TugErRT3PeSdMYVpckx5KNYmLjwsRz+/wfmADdteMB6wE+e00VeAWyf7Rob+gd4 ZJdQ== X-Gm-Message-State: AOAM533Zy9RleCp+RgTZ9jLpTayIkCn+OhJZeII3PijyCtViASaERWGD ZXFLGQlJp+2182qdjU3cr/bQTSpRKVg= X-Google-Smtp-Source: ABdhPJzkdsLOmPHDWuCHCFlu6yH1ATqQMS6ux3yImS2uAJm5Cggmg7KCTabMwzuprVIHNTRfCFNCQg== X-Received: by 2002:a17:90a:1308:: with SMTP id h8mr12692663pja.22.1591947722282; Fri, 12 Jun 2020 00:42:02 -0700 (PDT) Received: from [192.168.11.10] (114-25-132-144.dynamic-ip.hinet.net. [114.25.132.144]) by smtp.gmail.com with ESMTPSA id lt14sm4595040pjb.52.2020.06.12.00.42.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jun 2020 00:42:01 -0700 (PDT) From: Huai-En Tseng Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Message-Id: Date: Fri, 12 Jun 2020 15:41:58 +0800 To: users@dpdk.org X-Mailer: Apple Mail (2.3608.80.23.2.2) Subject: [dpdk-users] segmentation fault when calling rte_pktmbuf_alloc() after calling rte_pktmbuf_pool_create() 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 all, there is a weird problem as title,=20 When I use rte_pktmbuf_alloc(struct rte_mempool *) and already verify = the return value of rte_pktmbuf_pool_create() is not NULL, the process = receive segmentation fault. Following message is out of gdb: Thread 1 "osw" received signal SIGSEGV, Segmentation fault. 0x00000000005e9f41 in __mempool_generic_get (cache=3D0x1a7dfc000000000, = n=3D1, obj_table=3D0x7fffffffdec8, mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1449 1449 if (unlikely(cache =3D=3D NULL || n >=3D cache->size)) (gdb) p cache $1 =3D (struct rte_mempool_cache *) 0x1a7dfc000000000 (gdb) bt #0 0x00000000005e9f41 in __mempool_generic_get = (cache=3D0x1a7dfc000000000, n=3D1, obj_table=3D0x7fffffffdeb8, = mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1449 #1 rte_mempool_generic_get (cache=3D0x1a7dfc000000000, n=3D1, = obj_table=3D0x7fffffffdeb8, mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1517 #2 rte_mempool_get_bulk (n=3D1, obj_table=3D0x7fffffffdeb8, = mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1552 #3 rte_mempool_get (obj_p=3D0x7fffffffdeb8, mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1578 #4 rte_mbuf_raw_alloc (mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mbuf.h:586 #5 rte_pktmbuf_alloc (mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mbuf.h:896 And I dig into rte_mempool.h: and change line 1449-1450=20 1449 if (unlikely(cache =3D=3D NULL || n >=3D cache->size)) 1450 goto ring_dequeue; to=20 1449 if (unlikely(cache =3D=3D NULL)) 1450 goto ring_dequeue; 1451 if (unlikely(n >=3D cache->size)) 1452 goto ring_dequeue; and it also fail at line 1451 the gdb output message after changing:=20 Thread 1 "osw" received signal SIGSEGV, Segmentation fault. __mempool_generic_get (cache=3D0x1a7dfc000000000, n=3D1, = obj_table=3D0x7fffffffdeb8, mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1451 1451 if (unlikely(n >=3D cache->size)) (gdb) p cache $1 =3D (struct rte_mempool_cache *) 0x1a7dfc000000000 (gdb) bt #0 __mempool_generic_get (cache=3D0x1a7dfc000000000, n=3D1, = obj_table=3D0x7fffffffdeb8, mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1451 #1 rte_mempool_generic_get (cache=3D0x1a7dfc000000000, n=3D1, = obj_table=3D0x7fffffffdeb8, mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1519 #2 rte_mempool_get_bulk (n=3D1, obj_table=3D0x7fffffffdeb8, = mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1554 #3 rte_mempool_get (obj_p=3D0x7fffffffdeb8, mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1580 #4 rte_mbuf_raw_alloc (mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mbuf.h:586 #5 rte_pktmbuf_alloc (mp=3D0x101a7df00) at = /root/dpdk-20.05/x86_64-native-linuxapp-gcc/include/rte_mbuf.h:896 #6 main (argc=3D, argv=3D) at ofpd.c:150 (gdb) p cache->size Cannot access memory at address 0x1a7dfc000000000 It looks like the memory address =E2=80=9Ccache=E2=80=9D pointer stored = is not NULL but it actually is a NULL pointer. Does anyone know this issue? The DPDK version is 20.05, I also tried 18.11 and 19.11. OS is CentOS 8.1 kernel is 4.18.0-147.el8.x86_64. I have reduce my code in program to just calling rte_eal_init() then = rte_pktmbuf_pool_create() and rte_pktmbuf_alloc(). Thanks.