From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D0B31470AE for ; Sun, 21 Dec 2025 16:02:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C92914025F; Sun, 21 Dec 2025 16:02:27 +0100 (CET) Received: from SA9PR02CU001.outbound.protection.outlook.com (mail-southcentralusazon11013001.outbound.protection.outlook.com [40.93.196.1]) by mails.dpdk.org (Postfix) with ESMTP id A43D04042C for ; Sun, 21 Dec 2025 16:02:25 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=avVeJiOy9+Mq/RSbLy2Z8nMjsW+EX11hJlUeS2rVxecsah1qvU75cjIv+aG/X+SdZD4+/6QNNoN9ULl+GWeoGe+ZkkS5lVm7CVacI3kMScU0BA6axvEGhIG40L9PgleSOxcY39R2n1PRfkpC3wxwHz6Hubs/WKiUy+rPO0FZgYNBXnYiw8U7dO9qXbgmFVdzN3YPK4uQVQ6fWxOwo+QWVrp+XQVEEvNMzS/iofRrB9yBmFJfq5O+SPISSuUdAVHtrlCb2ScHbvDoNDOrod6Edp7S4ScRjIFWAi0wuMEofioTH5JSRfwocYwk9xVOvJgZj7tWqhcVn4vWXzI0lzjDCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zVE2Gv76+jzCMSFRoHg7pJBMdrWlGSYUlsvnx8pKGYU=; b=qR9vxPnIg94JattfVQ8bvacv6XTen/L5oi6xzOG+BtxRGUEr+OB6fFmCSaHFqHqMWmfE11DEwhBSHTR/TOTt7CrxZMRGBxvNICGldxXP6m5s16r6vlU2YoSng1WYdragC0GFzqEP7KecAsHeogB9M+myilDtNRh2tzNqPzSaayg1t80lq1QO7xTDIKMJtEJol9OPzJceWFKmWbnpb4AJoVLrYMqREqVHwT9jGsY1BVGqIIGrwTimOVW04CEgCynd0+DYMuFlAl29R5iZB4S06zAmqHJCPVNeF1SyJ6FvgqAnsHHjAivCtYEPiBNDIVQW5QGpDh5BUaKnwfnpHQ3BAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zVE2Gv76+jzCMSFRoHg7pJBMdrWlGSYUlsvnx8pKGYU=; b=D4G8O04AHB4c/LFgAxfIrDVRqCHYPG1zblqfw0KQYw/u8Fwi3GcaAJsHGQk+EHUfKrHiCivvoQEFH8wTS9EEXpggRcDpQzpXhV4d+w/TGnfa31rsB7hWv4+vmGKnLnoUkfUrnlfu3sfaEKwwq94ofkKFq8c9HUfJfXd/U57bIah0c17CtPwRqfpDMNMiwc6TMGe5AkzkW170OI53voV7J3i6YJnDx0Ygii4jm1wJ42v+LS7SCTd0EwATLhpFxiVrG+gqId/i14uwfWhqgSaknmfsK5rYjbXh6UYVBMQ8v9Zb5WRC3Nl21P4ZLrlArx9ZYk6i2qTMLduXT0o9xX+3FQ== Received: from BY5PR20CA0022.namprd20.prod.outlook.com (2603:10b6:a03:1f4::35) by CH2PR12MB4072.namprd12.prod.outlook.com (2603:10b6:610:7e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9434.10; Sun, 21 Dec 2025 15:02:19 +0000 Received: from SJ1PEPF00001CE2.namprd05.prod.outlook.com (2603:10b6:a03:1f4:cafe::81) by BY5PR20CA0022.outlook.office365.com (2603:10b6:a03:1f4::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9434.10 via Frontend Transport; Sun, 21 Dec 2025 15:02:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SJ1PEPF00001CE2.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9456.9 via Frontend Transport; Sun, 21 Dec 2025 15:02:19 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 21 Dec 2025 07:02:18 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 21 Dec 2025 07:02:18 -0800 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Sun, 21 Dec 2025 07:02:17 -0800 From: Shani Peretz To: David Marchand CC: Bruce Richardson , Dariusz Sosnowski , dpdk stable Subject: patch 'test/debug: fix crash with mlx5 devices' has been queued to stable release 23.11.6 Date: Sun, 21 Dec 2025 16:56:39 +0200 Message-ID: <20251221145746.763179-51-shperetz@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251221145746.763179-1-shperetz@nvidia.com> References: <20251221145746.763179-1-shperetz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE2:EE_|CH2PR12MB4072:EE_ X-MS-Office365-Filtering-Correlation-Id: c506e4c2-efb6-4ae9-702a-08de40a1f000 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|82310400026|1800799024|13003099007|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Res07kSDY7lorE2Skh05pEDRSbO24qXUEvA8hv+/nVrpewloOhIHGd3SSPyb?= =?us-ascii?Q?AMd3Kzplkjl4S2ZkG/NlrXuQvqjl7EelJc3oqDNDOpkCEsAEFuTTbqNW0goB?= =?us-ascii?Q?4vmKTH4sdP5yW07v1pEgihRKo+snxVCClzu/fUDgN4bpdiW9hKvN3aa9y6Dl?= =?us-ascii?Q?074OWU1fSnTxi4ioGu76z+M3V1PpCigVXWAI+nvO8LGWEJF/stYk8relY1Zt?= =?us-ascii?Q?aQ+p0KI7xWRN1H4nDTFUZe2R6Ll1uN5jGIqrtdlTCWjtoPN02WJmfU3NY9s+?= =?us-ascii?Q?8T9i4zyp4BjPjF9eDIuYJjeXK/cX2h8U5LIsQBW6sw6G/HoBpdAQqgUj0rr2?= =?us-ascii?Q?2ohODpmAiRoqJVXP7qg3F3hjRF1d0tJ5N/2FbZOoBCkqZhUtDXSultKum/+T?= =?us-ascii?Q?xgpoNU3sL/MyZdQ1w9DTHqXo40LedKLzWrTmZw+gfyL2ljatzrwFyNvCubp/?= =?us-ascii?Q?JKfBALrGCn3AZQBR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?UDHFqU7apw6qlMt7qwRaNqFK8GYl2pjURngpkfeH4Tg91p8oyj6Nqyx0A4QI?= =?us-ascii?Q?aH4DT8FJl4bcdfMuDB9HIMfurjuB8zBc+rQi/OCTxPKWgSkYteiGFqXe6YxC?= =?us-ascii?Q?eKqRIocEWpR5k9qtg7r1gqxG75k1+A3wFMCkZ29u2CxS2Xmg66NDXYYZQtR8?= =?us-ascii?Q?BoZbpD87ZIVF/b+9NvjcB8vxO2G3RaZVLDHwjkW/?= X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024)(13003099007)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2025 15:02:19.2690 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c506e4c2-efb6-4ae9-702a-08de40a1f000 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4072 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 23.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/26/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/shanipr/dpdk-stable This queued commit can be viewed at: https://github.com/shanipr/dpdk-stable/commit/58ff3711baf9be7037876eb5851043a44fdc3003 Thanks. Shani --- >From 58ff3711baf9be7037876eb5851043a44fdc3003 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Thu, 2 Oct 2025 17:36:50 +0200 Subject: [PATCH] test/debug: fix crash with mlx5 devices [ upstream commit 2b403dd8fb37d0ba13723e44ffc7ee2c2795f838 ] Running rte_exit() in a forked process means that shared memory will be released by the child process before the parent process does the same. This issue has been seen recently when some GHA virtual machine (with some mlx5 devices) runs the debug_autotest unit test. Instead, run rte_panic() and rte_exit() from a new DPDK process spawned like for other recursive unit tests. Bugzilla ID: 1796 Fixes: af75078fece3 ("first public release") Signed-off-by: David Marchand Acked-by: Bruce Richardson Acked-by: Dariusz Sosnowski --- app/test/process.h | 2 +- app/test/test.c | 2 + app/test/test.h | 2 + app/test/test_debug.c | 92 ++++++++++++++++++++++++++++++------------- 4 files changed, 69 insertions(+), 29 deletions(-) diff --git a/app/test/process.h b/app/test/process.h index 9fb2bf481c..8e11d0b059 100644 --- a/app/test/process.h +++ b/app/test/process.h @@ -203,7 +203,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value) * tests attempting to use this function on FreeBSD. */ #ifdef RTE_EXEC_ENV_LINUX -static char * +static inline char * get_current_prefix(char *prefix, int size) { char path[PATH_MAX] = {0}; diff --git a/app/test/test.c b/app/test/test.c index 7b882a59de..da31d05e21 100644 --- a/app/test/test.c +++ b/app/test/test.c @@ -82,6 +82,8 @@ do_recursive_call(void) { "test_memory_flags", no_action }, { "test_file_prefix", no_action }, { "test_no_huge_flag", no_action }, + { "test_panic", test_panic }, + { "test_exit", test_exit }, #ifdef RTE_LIB_TIMER #ifndef RTE_EXEC_ENV_WINDOWS { "timer_secondary_spawn_wait", test_timer_secondary }, diff --git a/app/test/test.h b/app/test/test.h index 15e23d297f..fd8cc10b53 100644 --- a/app/test/test.h +++ b/app/test/test.h @@ -174,7 +174,9 @@ extern const char *prgname; int commands_init(void); int command_valid(const char *cmd); +int test_exit(void); int test_mp_secondary(void); +int test_panic(void); int test_timer_secondary(void); int test_set_rxtx_conf(cmdline_fixed_string_t mode); diff --git a/app/test/test_debug.c b/app/test/test_debug.c index 8ad6d40fcb..fe5dd5b02d 100644 --- a/app/test/test_debug.c +++ b/app/test/test_debug.c @@ -8,6 +8,18 @@ #include #ifdef RTE_EXEC_ENV_WINDOWS +int +test_panic(void) +{ + printf("debug not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} +int +test_exit(void) +{ + printf("debug not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} static int test_debug(void) { @@ -25,34 +37,31 @@ test_debug(void) #include #include #include -#include +#include + +#include "process.h" /* * Debug test * ========== */ -/* use fork() to test rte_panic() */ -static int +static const char *test_args[7]; + +int test_panic(void) { - int pid; int status; - pid = fork(); - - if (pid == 0) { + if (getenv(RECURSIVE_ENV_VAR) != NULL) { struct rlimit rl; /* No need to generate a coredump when panicking. */ rl.rlim_cur = rl.rlim_max = 0; setrlimit(RLIMIT_CORE, &rl); rte_panic("Test Debug\n"); - } else if (pid < 0) { - printf("Fork Failed\n"); - return -1; } - wait(&status); + status = process_dup(test_args, RTE_DIM(test_args), "test_panic"); if(status == 0){ printf("Child process terminated normally!\n"); return -1; @@ -62,27 +71,16 @@ test_panic(void) return 0; } -/* use fork() to test rte_exit() */ static int test_exit_val(int exit_val) { - int pid; + char buf[5]; int status; - /* manually cleanup EAL memory, as the fork() below would otherwise - * cause the same hugepages to be free()-ed multiple times. - */ - rte_service_finalize(); - - pid = fork(); - - if (pid == 0) - rte_exit(exit_val, __func__); - else if (pid < 0){ - printf("Fork Failed\n"); - return -1; - } - wait(&status); + sprintf(buf, "%d", exit_val); + if (setenv("TEST_DEBUG_EXIT_VAL", buf, 1) == -1) + rte_panic("Failed to set exit value in env\n"); + status = process_dup(test_args, RTE_DIM(test_args), "test_exit"); printf("Child process status: %d\n", status); if(!WIFEXITED(status) || WEXITSTATUS(status) != (uint8_t)exit_val){ printf("Child process terminated with incorrect status (expected = %d)!\n", @@ -92,11 +90,22 @@ test_exit_val(int exit_val) return 0; } -static int +int test_exit(void) { int test_vals[] = { 0, 1, 2, 255, -1 }; unsigned i; + + if (getenv(RECURSIVE_ENV_VAR) != NULL) { + int exit_val; + + if (!getenv("TEST_DEBUG_EXIT_VAL")) + rte_panic("No exit value set in env\n"); + + exit_val = strtol(getenv("TEST_DEBUG_EXIT_VAL"), NULL, 0); + rte_exit(exit_val, __func__); + } + for (i = 0; i < RTE_DIM(test_vals); i++) { if (test_exit_val(test_vals[i]) < 0) return -1; @@ -128,6 +137,33 @@ test_usage(void) static int test_debug(void) { +#ifdef RTE_EXEC_ENV_FREEBSD + /* BSD target doesn't support prefixes at this point, and we also need to + * run another primary process here. + */ + const char * prefix = "--no-shconf"; +#else + const char * prefix = "--file-prefix=debug"; +#endif + char core[10]; + + sprintf(core, "%d", rte_get_main_lcore()); + + test_args[0] = prgname; + test_args[1] = prefix; + test_args[2] = "-l"; + test_args[3] = core; + + if (rte_eal_has_hugepages()) { + test_args[4] = ""; + test_args[5] = ""; + test_args[6] = ""; + } else { + test_args[4] = "--no-huge"; + test_args[5] = "-m"; + test_args[6] = "2048"; + } + rte_dump_stack(); if (test_panic() < 0) return -1; -- 2.43.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-12-21 16:54:19.869475164 +0200 +++ 0051-test-debug-fix-crash-with-mlx5-devices.patch 2025-12-21 16:54:17.112063000 +0200 @@ -1 +1 @@ -From 2b403dd8fb37d0ba13723e44ffc7ee2c2795f838 Mon Sep 17 00:00:00 2001 +From 58ff3711baf9be7037876eb5851043a44fdc3003 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 2b403dd8fb37d0ba13723e44ffc7ee2c2795f838 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -42 +43 @@ -index fd653cbbfd..8a4598baee 100644 +index 7b882a59de..da31d05e21 100644 @@ -45 +46 @@ -@@ -80,6 +80,8 @@ do_recursive_call(void) +@@ -82,6 +82,8 @@ do_recursive_call(void) @@ -55 +56 @@ -index ebc4864bf8..c6d7d23313 100644 +index 15e23d297f..fd8cc10b53 100644