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 E2F44A0032; Fri, 24 Jun 2022 03:42:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A4B94069D; Fri, 24 Jun 2022 03:42:18 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id E0F3B4067B; Fri, 24 Jun 2022 03:42:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656034937; x=1687570937; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=u8NHMkCCSPy/ffjkIm1G+KiHDZXLxnCiho1K/3wauug=; b=BqmExmJj3yarE2yulpzw0q6EuCIpoc6kNE5kR9b5LHbBnqct4SHEXQtE sSQvT0GpQJkngxOgC/03ZarbQN5Uwn66A2KrQ8qO+bos7vaYxvfkJGc6J 8nMxdcJnTVHRzakHeQnn5RAFZsnzjhVOC4VVaxF4O3k8bbsQAZ1qIRIVb +njkbIrRYFvninnhyR/oRzEPBv7XQgDtmLrr+m4mYBohlLqjxgCgobx3t 2LgJu+CVQimrKHmYkFCtSGduvTYctkbPOPKfqx7qVUUU23TiEMoRnJdQE K5E6b9L0Vy4x98IwyaEd2kGeHgesOUW/TcJaxLNkpiLvUbP7YKRFcro5Z w==; X-IronPort-AV: E=McAfee;i="6400,9594,10387"; a="342580206" X-IronPort-AV: E=Sophos;i="5.92,217,1650956400"; d="scan'208";a="342580206" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 18:42:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,217,1650956400"; d="scan'208";a="563679880" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga006.jf.intel.com with ESMTP; 23 Jun 2022 18:42:15 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 23 Jun 2022 18:42:14 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Thu, 23 Jun 2022 18:42:14 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.43) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 23 Jun 2022 18:42:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dEzn0DTOLr15VK9bVgH47c/Ul9yAw3aHayJvLxZ/plkYu3HlmdKhld6OWOu1qTu+93rtmYpqMqb08nLKWp3qBMgMGaMBdrtje71HJKD6rz/7rNlEuyICoIEsHZRJlVBhMLAbrAn0/dQc8uIMDyonGRI4eAO3ohF69z3X3L6CaSxumLGQtClMFvxtcdfBlsImLSNIRjNnDe4Fb5juwtLHoEutNYfrO7eq3QikCppfuEgPQy3ubCVFBR22Jk4mHMTts9UBEDyKR2Z2t0YPNapPT2MpzHDgah/zKXDK8Vy2GeMOo5wsZdI/g13X+ud9k1FtzWUZCFjv8w2Y4viS3uXQTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=KU2Oq28FzbulrJZDGugN1qkY6t49hhicqjlOaIfys6g=; b=WafJtFXDOIBJIKKh+XggpuNg4Jp/UvJQh+pjSPlE+8TgNOzoIDoQK/G+dY/s78gBhDMjw5S6FVobbOaOmxMGG56KZ0/i69XIM3SiXnxk1NHiR1V4FSppe4vRAutFV/Ico87Tfup6Rd91h9he6M8G633sCSzqk3V5YrLmn0L0AD2gRbbAJh27issIQYBX+Di76W5Fa1WkNYHXnA6R8MCZYeR/TRHIR17M1R/sQP/juMCjGpBsxN0GlLAXKFXbxRY96VmvVPfFpIX+RcP09/jFUwavAZUcF0CT4gxzlNHGao20AG7698lsdnyRKGvQIk5TACLVa+/QBfqFOxCrs4UTgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from CO6PR11MB5602.namprd11.prod.outlook.com (2603:10b6:303:13a::5) by MWHPR11MB1519.namprd11.prod.outlook.com (2603:10b6:301:d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.20; Fri, 24 Jun 2022 01:42:12 +0000 Received: from CO6PR11MB5602.namprd11.prod.outlook.com ([fe80::38d5:6ff6:8771:8e8]) by CO6PR11MB5602.namprd11.prod.outlook.com ([fe80::38d5:6ff6:8771:8e8%5]) with mapi id 15.20.5373.015; Fri, 24 Jun 2022 01:42:12 +0000 From: "Zeng, ZhichaoX" To: "dev@dpdk.org" CC: "stable@dpdk.org" , "Yang, Qiming" , "david.marchand@redhat.com" , "stephen@networkplumber.org" , "mb@smartsharesystems.com" , "Richardson, Bruce" , Harman Kalra Subject: RE: [PATCH v4] lib/eal: fix segfaults due to thread exit order Thread-Topic: [PATCH v4] lib/eal: fix segfaults due to thread exit order Thread-Index: AQHYgH18tN9kGwPb3EKV1SOa9wjiCa1d0/FQ Date: Fri, 24 Jun 2022 01:42:12 +0000 Message-ID: References: <20220530134738.488602-1-zhichaox.zeng@intel.com> <20220615060154.6905-1-zhichaox.zeng@intel.com> In-Reply-To: <20220615060154.6905-1-zhichaox.zeng@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5876ace3-7f52-41d1-0643-08da5582c2c3 x-ms-traffictypediagnostic: MWHPR11MB1519:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: aB+ero7gCAaWudR6DoWXNNC7D6dKxCgb1v1ryKQ+YgcYQf7+cyzGH0b+6GYGF+qyMWQ8i6M/BrSEyD4+JqitmkLwr7E+ST5lKPz9tiuMDnsORysGyGvZ+vNnijdYmP8zbGk7WuYLlTln+sla43Jav8t6qopmfIga3gfi0OfnXWLHfb+d2pEygOHPKtx4T6WafkIbPC4H5z7CiYDTUObhYY1dmxv7SHUo47Nmkgi9g2MBV1fADpWztunp3TGQGayZo47ariYa7wlOIUo/sxg51+jpgtDLlFZZGAFr6OWZb5E3oy82b70dHxyEjYPjwNhbDOl3FXY36P1E/t5YWCQx0wrFpmQMKtqX7sNs//snXUIeS7/XzCWy+E3UmZAv1eKaOH94HqyQtX8MQfBplNvNuJ6ctfO7mLnlmJFgOeMHLj2hHU1c5ni13smpy9XQlc+uCajtymweefrbrMX0Q1cQ+J5uh2Ng3bEQSSgUmFOptT6ttZ6D9bXVL9LRPVR+5bgLTkRwzkYk2xfBC3WRPL+wZ9qqjG9Vc/hY2uZWjdT0E2+65EyKBDRnsRNk19A9MJZ2dAvTEXfghq5oTMTvKwgnbwoTswk1iUyYG9Ugw6aIyg2jx/ypNh9sUTtg9VyEM5tmyF5wkXRsvKD9uKij1JhhRMpgkXFST98VOKVlmK/N75K9NKKFWyICai0l8QEBJwKE9Qilff5UE/yzYuqPc+TTRRbUmtegwvvDJxwxW5P/l4mrvDNESDzN3PvwEwNWIchIbipv2o217rlBJWrhJXSLLZxkUNuhodk7nn+CTWTF+uo= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR11MB5602.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(366004)(396003)(376002)(346002)(66556008)(6506007)(38070700005)(66476007)(71200400001)(53546011)(4326008)(86362001)(9686003)(2906002)(8676002)(66446008)(64756008)(6916009)(5660300002)(82960400001)(7696005)(76116006)(122000001)(186003)(83380400001)(8936002)(66946007)(26005)(38100700002)(316002)(478600001)(54906003)(33656002)(52536014)(41300700001)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?37aB/Jc8Z/bgsSNI1TUgqM3YbTtI2yLPv273g9efHlSwGhxOMxV/9oYeyoAp?= =?us-ascii?Q?oP76RlPmJof0/K64NjBG5DoB7t5LLiIa1AJNTGmFQHCHJbgy2L9W2da4i2WI?= =?us-ascii?Q?+wG5N9xcvhBHBji3gh1e6SK05KbPIl6pO5zNdrxxyUR8x+MCDYGjQvPso+bD?= =?us-ascii?Q?CNWrzFjvTz9TKKvCj+umCjj3bm9iXE0Hj0tuz3AONM60IEeOqDD/UjrB0yud?= =?us-ascii?Q?8mqI9/pLec+L1nlJr6R8WR7vqWDe39QX6m7h1RSnCdoBjmygcj+HDN9Zdz/O?= =?us-ascii?Q?kFRvW/1oaLovC2c4fuX6eSCnsVh3NdkEDQzH6ppMSO8XCz1QODuwpxbGLghZ?= =?us-ascii?Q?/C6WFmzBQvmD2LLvkiIqPD2+iAIu2y2nwtwQ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k8DrYeR8Ev+DI29BeCI37yg4If/9BtOPvb9iCGC3WjaORI5S2eXgzM?= =?us-ascii?Q?H/Qy/aXpmetIXB0o6+8oXZ9zCOHsO71PYUSJJpmFhOCMpaZwk6WjqoADrTfR?= =?us-ascii?Q?Fs+t5Ez+LFAYGn/zRL/iF67rWHt7IknEpre5Oqjwo+jnJKiPWi3ZiX63wIVY?= =?us-ascii?Q?UT0bB3nvQVxV6k/y0xC2OU71gzIi3z07SA6pLnY8xjpv2TykCPBVUVc49xnC?= =?us-ascii?Q?aPdVsZ6B/X4GYYBMEhXmzNixRUvWBFKeujQeXndUusIHpii6lzx4cBIqfR8u?= =?us-ascii?Q?4sfU77FBPXPYP76iz7gR5F/RrmTetFYDk8MKa9JK?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR11MB5602.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5876ace3-7f52-41d1-0643-08da5582c2c3 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2022 01:42:12.7704 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yaD0cwF//+ntSHBXuCogmEpFDfra/HyM6K1ir9jRIhJsU3LfZpMHZ6O58Px1mHe86uttADKbmIT68JSK48nPJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1519 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi David, Harman Please review this patch at your convenience, it's been about a month s= ince the v1 version. Thanks! Best regards Zhichao > -----Original Message----- > From: Zeng, ZhichaoX =20 > Sent: Wednesday, June 15, 2022 2:02 PM > To: dev@dpdk.org > Cc: stable@dpdk.org; Yang, Qiming ; david.marchand= @redhat.com; stephen@networkplumber.org; mb@smartsharesystems.com; Zeng, Zh= ichaoX ; Richardson, Bruce > ; Harman Kalra > Subject: [PATCH v4] lib/eal: fix segfaults due to thread exit order > > From: Zhichao Zeng > > The eal-intr-thread is not closed before memory cleanup in the process of= exiting. There is a small probability that when the eal-intr-thread is abo= ut to use some pointers, the memory were just cleaned, which cause the > se= gment fault error caught by ASan. > > This patch close the eal-intr-thread before memory cleanup when exiting t= o avoid segment fault. And add some atomic operations to avoid executing rt= e_eal_cleanup in the child process spawned by fork() in some test > cases, = e.g. debug_autotest of dpdk-test. > > Cc: stable@dpdk.org > > --- > v2: > add the same API for FreeBSD > --- > v3: > fix rte_eal_cleanup crash in debug_autotest > --- > v4: > shorten the prompt message and optimize the commit log > > Suggested-by: David Marchand > Signed-off-by: Zhichao Zeng