From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0061.outbound.protection.outlook.com [104.47.40.61]) by dpdk.org (Postfix) with ESMTP id 38B86D250 for ; Wed, 29 Mar 2017 14:49:42 +0200 (CEST) Received: from BN3PR03CA0100.namprd03.prod.outlook.com (10.174.66.18) by SN1PR0301MB1968.namprd03.prod.outlook.com (10.163.224.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Wed, 29 Mar 2017 12:49:38 +0000 Received: from BN1BFFO11FD047.protection.gbl (2a01:111:f400:7c10::1:173) by BN3PR03CA0100.outlook.office365.com (2603:10b6:400:4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10 via Frontend Transport; Wed, 29 Mar 2017 12:49:38 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD047.mail.protection.outlook.com (10.58.145.2) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Wed, 29 Mar 2017 12:49:37 +0000 Received: from [10.232.14.39] ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v2TCnYUM007336; Wed, 29 Mar 2017 05:49:35 -0700 To: Olivier Matz References: <1490004190-16892-1-git-send-email-shreyansh.jain@nxp.com> <20170324172227.5bdfac8c@platinum> <20170329101838.58162bf7@platinum> CC: , , From: Shreyansh Jain Message-ID: <806afd15-9556-797e-6493-b815aac41a2a@nxp.com> Date: Wed, 29 Mar 2017 18:25:31 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170329101838.58162bf7@platinum> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131352653780313243; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(336005)(39850400002)(39840400002)(39860400002)(39450400003)(39380400002)(39400400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(189002)(24454002)(377454003)(51914003)(199003)(9170700003)(50466002)(356003)(5660300001)(1720100001)(104016004)(305945005)(105606002)(65956001)(65806001)(106466001)(65826007)(64126003)(86362001)(31686004)(76176999)(93886004)(36756003)(33646002)(50986999)(19273905006)(47776003)(31696002)(54356999)(38730400002)(8936002)(8676002)(81166006)(966004)(229853002)(2906002)(230700001)(110136004)(6666003)(2950100002)(53936002)(6916009)(23746002)(53376002)(4001350100001)(83506001)(8656002)(6246003)(54906002)(77096006)(4326008)(85426001)(189998001)(6306002)(562404015)(563064011)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1968; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD047; 1:MjriMqnHVLOgwiHcsm6yRXSF9iowNBT+WNAwzCQsmqXGmM+PFQ+Z7vIkKfLxcdRASIU1DWmqwjKRqq40o59UUYePaSxexwlxl2kaoTvjj1N0bVnr4NUyjRr5hrqXZFhJgi2nvJVYnd5IRQ05KEt7hqAmDR0zhu+/a6nznslYMJVDN0AlEU/JQVHJG2BN0Gm71gJM0QJOYvAtmvM42fjaZMZr+81OKs+bJDza+qIgco2Gyv9Vno/E3I5Bn0RLGRhXOAIk4QPUQr79cka/dxRMAVyMaN/Cq/iUPClQrEVZ65xt2vK8RQwdJQMwPrzhWZOomkHUmr+9htZjj0LNBB2NT69Rs4zjg9RHPCakyVelYm4/VmZSAHJTFgMQfnIzd90eBu1BpcDQe007v40RVygkNJKaB1sYwJo5sb0aNlCz0erQ5rI/Lu9FwRVbIi/djjiM5/hbGtCCiQshg/IXs0oU16ekcXzDMO7WkhF+AjC5HnpOZdBqQ2Bx8wKb9+bcwecMV/zHZtdNOYIIOc7H7+R2j5rRgJKKkBFdw60OLRnPvHPNKvxLX8oYgNwYto0Hkpn0 X-MS-Office365-Filtering-Correlation-Id: 524ac7b0-5caf-43d1-59ab-08d476a20f45 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030255075)(201703131430075)(201703131517081); SRVR:SN1PR0301MB1968; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 3:93DqNXNpkH/FZjG5sERA9Riiw2yyOlqzZNe85Vv38H823NHhPqIljeDxoCUJErvkDWM5o1LiJ1qDF88wyDrLSF3fD74MXf+Wyn8RQj4R9W6VB3w7EcCWvfzF6JdOlgVyAl1Sylw42peKTzazuC/lqyUegTiDk8DogkQJOZeGTpG9Hy+eOVK3yzCHB3goSbM4KKzApAtq8LU4aaaxWik7pA+y90QQcz1d5kI4fXN3j2AG+K9N/+4jcgJZTfA9Hb/qn/Dm8RChxvsHpQg5leD9ZMBdrUjT6QPJKZPbL8gH1df3yorPFO/DZ7MCbRxPF7JUZrxcgMU5wG+vOHAXCBPVrKysfreui7qTIKADQmamVFTYM9WHKBfUh8Z+1T4WpH5hMj0AcSScEg13b1Z5VVNzB/2GXPuWPPNQ7njwgwxs+MA2SHzP7QP/DJwQ6qeKNvnCMpu6sV/4/MhaNiYop9s5sw== X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 25:BcCULivL5GlJrXPpd6XRqltCxw3NZxGYs9whVG71tV2/zfcvZyYQfWgs/0ljs2yaNxm8pIt3+Y4+hhJLZG510Q/ATKsgkOLJCwYavLyWUbIQT6eGLK1IgOkgud5xg3ztcXXZkxIXC3lP0ciiceTIjnQUevOjwFzaEImthj1hVN0pi4vmIz3+El+P6bbBjTSMINRyLwFyVsx106No4JSwwIRlbL8EYMDG8D8FCKBjgtvkQRGgCoyqCQfM1ZgmnAiYtOyBN/F8qwVib2qTIMTXGtJke818xC4++fBbz3rrbCrYjnZNvzOM3ccejNncHus8z0ssIQ7D1RO0RFWKPU+NTTz3qrJKjc97ze4NnrL7rEsPz5Ezbk6fpKhUibN1m8B3emBMJ/GDvOr+FXXTgY+az1j7Nf6fCR62/7AuGd0c430fZaMDKozO9jYM8Ja2pThD82uy9iLiP0zaMubKlBKUUw==; 31:+G8StzuL6tGTc5SKxxsDdDtRJk+C9c1lpeRomSqy/fqAWZeEFX0Sa0PhZ/Diu7tKRcUat2pWEq7JbMmfuEfy7vrGJI5WPTsD8VdSzpTHaiZ93f591J5bytKIj1g7EQAI/qoI4kz38g2+u9ZOaZos5EO67qfRV8xWObta7nsPXNO6EOzGdoiLxwqThwt1WdQ0Nk0BQtqA+4dqVgKkYghwoBnkNRAByH7ar+UQIxpqbo/p4Q3N8q2uLzHiNCAFITgYR8wAPMUt1Q5FE3iFhvm7vQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(8121501046)(13018025)(5005006)(13024025)(13023025)(13017025)(13015025)(3002001)(10201501046)(6055026)(6096035)(20161123559025)(20161123563025)(20161123561025)(20161123565025)(20161123556025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259075); SRVR:SN1PR0301MB1968; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB1968; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 4:zyWt5geMC7Sayth1d9mQIrBFdjP64Zlmj6iXk+gUM0J6U+QnikfGdOKR4wQnY/cLfd1+mUHN3m+LkDI6xSmynSHeLHt/0D/K+nvDYnj09URISSZtD1NURTwQIuu7naqMjoH02xn74VPrs3329vfxlsXk7L0mJAOvGTlCmRFvstc9eHVJp8c6SVGRkVf3bK/iSBB5xo92M5g63l2r/8P/E53sysgCzoo60GN6YC+PJR5LrRaiaKagw2PcEIW1/a7m1UoUAUVAwR4CN0ZPgVJNDxhUWY6Yh6OL6nu4SarHjta72jOHkUdx5/P8i4u/FBuzJ3FahQfrd6N/7XcThAYhfJkUVDL88TPMuwPenPpVntrunM5ji6ZlVi13SYgJ0grOjUjBWMXkTuOt4IpDJ8eCtpTXOR1H1HEbOF7L+sDo/6s72OWflK/vPGd8wiUuWRexedsgMhyZhtXyXxdDuK5R59LZ96wW6xzXhytCENa+9N2h6DBPcD7EaquEm/6CfeZ53R+k58CI+nXGBK3DzeEpIXbIEApql7BOb32SemopHF+wSnuc+42Bh1YtLeaTZxRqPxvFI3oX0/A0j+PyWGOtGyogxJQ0Kf2anBhBy8dm7M2lHHXKI4wcWA8t53haSFbsjhgDVobet+Dy1LSy91xfUWfyFHVBlj4DwwgX7FxFKqGbvkyQT6IDNCgNb0mVegsKhfwVGphF7LSyWeK8yDeRVhRoyUP4k4VVVdHol6iuC0uJtXgQTyYhubsCudXK+24dtjPm5uAvlFTyTKuDhhccv1c3nKi1fGzqK4JcKfRHbo9dENpnuINO284u/rhAbMsR/5jU5AUAzHN8tRhQw7GAyMrU/MOSDUOQAz3XORpRGjL2PnTf1rnpWMcLQ8xG+AlHCdU+APXSiSVUzvNo2QSuNZUfg5DsRr3O/Bw45nVuF99O0qURIe2x/YSUrjJKYG0U X-Forefront-PRVS: 0261CCEEDF X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; SN1PR0301MB1968; 23:xXRpHD8Qv11tPNqym4n15FNGxn2IKhjLq6n?= =?Windows-1252?Q?vKgCLr32vbgphcUQjHBv/sPeJq4QlL40j/Gvky503wNrtUoe+tmLER+Q?= =?Windows-1252?Q?41s3mFUs0DrB4u9OZsOu50/fdHTl4CLASCS1rgmU2U7FuqY8FmZrhU3Z?= =?Windows-1252?Q?yAMQBlZa5v6WXNkPUftUQfsm9FSuoT+osjTXa4puDctCtxHSwWKzDpia?= =?Windows-1252?Q?BIS+yeIblx/IxdHtHKuzpIGuwRd66S2238gRgHM2/lC/8guIqdEVqndz?= =?Windows-1252?Q?UoCeXk3YySxEwPTs2tcxxvWb4PRUwM5bduDBSRqVimT/lau2HjguLeHP?= =?Windows-1252?Q?+NT+yNUPDLvJVzc0sdKTL6cXduAnmXQT9DCe5fqmVHJ5LXPkhJm9mbsB?= =?Windows-1252?Q?hpiLK/kceVPJUtTPxom8fRoJGQXNLKlss+0nAJc6VzhpURE4R6Fksm+k?= =?Windows-1252?Q?aubN+Xv7V0rMLB0AlDuX541So2L/vQXjlemWqOkeClnZVaD2uwE+UoyP?= =?Windows-1252?Q?e8vzvmNjP4+kZNi76dablLkIM91sQaM9YSQ0zh3kxBE9KBqxjWedoj6a?= =?Windows-1252?Q?NKP38nEUTCyECvtmA3JasYpS6kg2bk7/nOPDTVoGknGYivic4zW+JFDf?= =?Windows-1252?Q?oL+csjhvVwYRF4wTnE5g2swmrsrEY9SIw5q2Mm2P4HJG95aTKkbGvAan?= =?Windows-1252?Q?bgVOzqlbd4il3sqkm9U+UN5y7hxom1Ci0SQxmbrTxNph8xveLlDWMm5O?= =?Windows-1252?Q?ZY60qGMXhfGqRJOrxe6eYQwUPpqJJECXUB64ec65UfsulZvPA9I6d1Qs?= =?Windows-1252?Q?m998SgEIvGnNaROGFhvT0EH6a5WwpEX2J4o9KLxeZeG0l5L1ZoQ1tSoE?= =?Windows-1252?Q?DlbRjqGToOsGNb46yPEBc6aR2g6qTakwZCfqqg8CUdlqXVWBiuE6/zan?= =?Windows-1252?Q?tKZDNBhunZ/1QRK8V2l/a87MZm2k/BzD8t9D6a9w/kjiCvpfY19gKjYV?= =?Windows-1252?Q?5BF+cKjVY3+5QCyPOiQAT3MQjOqnt8RPAYctOvvTfELON682RPnP4F99?= =?Windows-1252?Q?vIUWoC2vRHua7f89hQ6gSJ5lxHAiaTrcTMvLRxXWsQuDdOxwshoaXnWv?= =?Windows-1252?Q?yt9Q2MhNjOR7bbJZqOW3BpuqOsbBEs27wbHSdtcekrnW/9/6Lld1hzYw?= =?Windows-1252?Q?PtSvzRMafnmD0ujzDPnolobLxew1SFASqkC5rNYx7ZKPDSd1uDRWpf2p?= =?Windows-1252?Q?xl5m3ogdorkrWk8AGxWxrVyqbwTxR9GOI4kMbaEOxeCWLp3YpvYbsEAl?= =?Windows-1252?Q?Aq25IZ83GWmg75TfyH9mwcSfPedI3sNjN21OO2Fp85O9RJpoG18sSow6?= =?Windows-1252?Q?FahE+vk1TT+44IOHc1WvJTvSjeHeSJW5GF3a+Yu51MI5vqU/H6FQ99q/?= =?Windows-1252?Q?JH8HdvhQIAThy8VOtbc0IXlab9B8M95ESP2Sr1AdwY/q/F2Qvlkwopmi?= =?Windows-1252?Q?FJrZb3hXMwBTDj7Ln+znhmSN8w/k/VjdDPmU3Dpd3b3W07CY/I9880El?= =?Windows-1252?Q?R4CsHQOG5OP9GZOmjYveed2OlCA49btn5gua6wqEtY/5DRIZKH+l/aSi?= =?Windows-1252?Q?ixsuipiXk7cGG9LWtoEVrpUY1AJXdqdLMGLttO6bFQrhIUIMDImZPukG?= =?Windows-1252?Q?rcrVXrFmY0FV8Cs6yB3IypE5xbgeosTZCFD4nf1hYjoMWmiOKGFFnQL9?= =?Windows-1252?Q?T1vhv/TIO9SH8r9SYkJBult3Z/amn4HFFRyXLehf9fX6LEBnfCHXdl3g?= =?Windows-1252?Q?vBtjW0m6RYVl3ueXnxiRTC+PfFEdW+5LGHr/NamIAZqlhaOSj8/+P8KD?= =?Windows-1252?Q?qMC7/FiVZ21LUEVwom9TNhU4bTc1U0rLjBw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 6:nYL0CjQpS2TqNczHEin0yTpJsh0Psai6THSwG4D+jvKucNBCt9kMhrOAnF+aWLMZDT71BtfDTdDK2fk2QhfBOAHbrJ+sYFkAjGK9IqR0qXL8kYIIBkSrwWy7XGVxioSQYd3bkxQHd9uc1rYUqZjT2blUBU0DiJOvDrwHgIwJAyaKhmymlvnZppcSO/WFv1G5XpH8dUrLDTySSN66Pq6J8vLm+zxgSGHcGP4NxpkpeslDccDKAIy1ff9LVEoD6f7JkR7TAUzqQtRnim5N+qJENWsxE1yEZZO3IEqtRDdoRx+qTGFYUkKVltXhkeVwbEm+MyK602i+eeRsL0eN0ZIi7yshSJEA40koUt5YwHuxTXGwuzP6LaoTmfap1ej/+ea5TilpJVhA2vg5NGR4RpAHng==; 5:r3SW6mgTbGByq/iWdSTzWRW0Zh5wJ+ZPgMb0tIhBMRpRwTPUKV+Ll7CFoQM9kn9XT+C4oG6HyAH8yFCf1ph6N3ceNK/Z+W1XfM9l1s9+QUwB4choizMNfRQw4OZcY1SweXG485B1OL6lIfFCXp1VZdLx+eU/Qatc3XSG898b4CO4emJbozSiAOBKtXd16Nw7; 24:nuf8xU88jaijU6n4xCNN3sYDEoOsGv8zFq6VJupg8g/Xqam553WwRSEOXAA6TAMrsfzYBwBWBATKxzOz0zgkuS/pJUTI94cVXj+a/lfCq9Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 7:X5dyXQREtMdqLFpcivQbHjiboH+brilbcGHgTrH2SiVPnymvOw++yJfqvXMA3yOVQfKQQUh0Y/qjI8+JHXBNwjMSqwuVjkqcpjKdwUmzcI66dhP+OcNhw6PG55yBbLvqgm4RezEthjujp8GlUnwZVqwDWcW0KfAq5QaJtC8wNSLT9lEQYsRJWixhmtxVFhzg9RGcv/0vaHixbEKiSfoVWVUFli7og94cxp+weQpr9qBvXmmtA8Dp/HuEH4DLKsNsJntkVtycH7nmNEQNiw5wA4AVPx+Y60oqlfJKUvUugcWzWuxMZtEnFjgcyusbJ5Yqe+wPi+wdP5prJ2Ha1y6LRQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2017 12:49:37.7349 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1968 Subject: Re: [dpdk-dev] [PATCH 1/2] drivers/mempool: add stack mempool handler as driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 12:49:42 -0000 Hello Olivier, On Wednesday 29 March 2017 01:48 PM, Olivier Matz wrote: > On Tue, 28 Mar 2017 17:12:47 +0530, Shreyansh Jain wrote: >> Hello Olivier, >> >> On Friday 24 March 2017 09:52 PM, Olivier Matz wrote: >> [..] >> >>> I tried to pass the mempool autotest, and it issues a segfault. >>> I think the libraries are missing in rte.app.mk, so no handler is >>> registered. >> >> I have been trying to simulate the segfault that you are referring to >> above. But, I think it should not be the case. If a mempool handler is >> not registered (as librte_mempool_ring was not included in >> mk/rte.app.mk, so, no "ring_mp_mc"), the caller would get error. >> >> The mempool_autotest is reporting: >> >> --->8-- >> RTE>>mempool_autotest >> cannot allocate mp_nocache mempool >> Test Failed >> --->8-- > > Here are the reproduction steps: > > > git clone http://dpdk.org/git/dpdk > cd dpdk/ > wget -O - http://dpdk.org/dev/patchwork/patch/21986/mbox | git am - > wget -O - http://dpdk.org/dev/patchwork/patch/21985/mbox | git am - > make config T=x86_64-native-linuxapp-gcc > make -j32 test-build > echo 128 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages > mkdir -p /mnt/huge > mount -t hugetlbfs none /mnt/huge > echo mempool_autotest | ./build/app/test -- > # segfault Thanks for the steps. I was able to reproduce this. Don't know why it didn't work earlier. one more comment below... > > # replay with debug > make -j32 test-build > make -j32 EXTRA_CFLAGS="-O0 -g" test-build > ulimit -c unlimited > echo mempool_autotest | ./build/app/test -- > # segfault + core dump > gdb -c core ./build/app/test > > (gdb) bt > #1 0x000000000064dead in rte_mempool_ops_alloc (mp=0x7f8816abdb40) > at /root/dpdk/lib/librte_mempool/rte_mempool_ops.c:101 > #2 0x000000000064c1e7 in rte_mempool_populate_phys (mp=0x7f8816abdb40, > vaddr=0x7f880987a800 , > paddr=6958852096, len=26761152, free_cb=0x64c032 , > opaque=0x7f8822334d4c) at /root/dpdk/lib/librte_mempool/rte_mempool.c:359 > #3 0x000000000064c9db in rte_mempool_populate_default (mp=0x7f8816abdb40) > at /root/dpdk/lib/librte_mempool/rte_mempool.c:572 I think adding the code that you suggested is not the right place. The problem is not in rte_mempool_ops_alloc, where you had suggested the check for NULL. The problem is in rte_mempool_create where return value for rte_mempool_set_ops_byname is not being checked. When the libraries are not statically compiled in, rte_mempool_set_ops_byname is returning NULL, which rte_mempool_create doesn't handle and goes on to call rte_mempool_ops_alloc - eventually segfaulting. > #4 0x000000000064d3d4 in rte_mempool_create (name=0x9b1ff0 "test_nocache", n=12671, > elt_size=2048, cache_size=0, private_data_size=0, mp_init=0x0, mp_init_arg=0x0, > obj_init=0x49f309 , obj_init_arg=0x0, socket_id=-1, flags=0) > at /root/dpdk/lib/librte_mempool/rte_mempool.c:895 > #5 0x00000000004a20ed in test_mempool () at /root/dpdk/test/test/test_mempool.c:519 > #6 0x0000000000435189 in cmd_autotest_parsed (parsed_result=0x7ffe55006420, > cl=0x7c87090, data=0x0) at /root/dpdk/test/test/commands.c:103 > #7 0x00000000006749df in cmdline_parse (cl=0x7c87090, > buf=0x7c870d8 "mempool_autotest\n") > at /root/dpdk/lib/librte_cmdline/cmdline_parse.c:359 > (gdb) up > #1 0x000000000064dead in rte_mempool_ops_alloc (mp=0x7f8816abdb40) > at /root/dpdk/lib/librte_mempool/rte_mempool_ops.c:101 > 101 return ops->alloc(mp); > (gdb) print ops > $1 = (struct rte_mempool_ops *) 0x4e69c00 > (gdb) print *ops > $2 = {name = '\000' , alloc = 0x0, free = 0x0, enqueue = 0x0, > dequeue = 0x0, get_count = 0x0} > > > Regards, > Olivier > > >> >>> >>> Adding the following code in lib/librte_mempool/rte_mempool_ops.c >>> fixes the crash. >>> >>> ops = rte_mempool_get_ops(mp->ops_index); >>> + if (ops == NULL || ops->alloc == NULL) >>> + return -ENOTSUP; >>> return ops->alloc(mp); If you think above explanation suffices, I will push a patch for error handling in rte_mempool_create returned by rte_mempool_set_ops_byname rather than above change originally suggested by you. >> >> Can you tell me for which case did your code reach >> rte_mempool_ops_alloc() and segfault? >> >> In my case, librte_mempool_ring and librte_mempool_stack are not added >> to mk/rte.app.mk and it is static compilation. >> >>> >>> Now that drivers are not linked to the mempool library, it can >>> happen that there is no handler. Could you please add this patch in your >>> patchset? >> >> Yes, once I can get this issue reproduced. Because I think there is one >> more place similar code should go (rte_mempool_ops_getcount). >> As per what I can see, this would only happen if rte_mempool_xmem_create >> is called and then directly alloc is called. That is not happening for >> mempool_autotest. >> >> - >> Shreyansh >> > >