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 3CB99A034C for ; Thu, 30 Jun 2022 12:39:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2BD3141143; Thu, 30 Jun 2022 12:39:26 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 71B2C40A80; Thu, 30 Jun 2022 12:39:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656585562; x=1688121562; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Ggh4LWdYDsoU3/EWsWr98dpO/vf+LjIZgUY5bE8t1nA=; b=V1rr4GgY5zcYYDMvNdADhARHAr3DZVXfslOkSWK79sWF5gyow9IQ3n4L TuWPbDWukZY1ztAPcfSDC1OAM4Ey3HSKE/kesSJz41+xEFOfcUkHz5q1y toGIU46j2JBC68NV14Z+cIMzs/wdFLqROlttDeivcLc5zktp2iBXlnR6q TYqV2QDww4zspQfsaDRYSVIJFcSDwuwRwf3IultbtRR4wLd2mTdG/FqZn piww+bxijNd6e4Y9+U+E8LDfG50deZsXypC9mGZX+B8pZvie1xQe5t8S2 M6dShiqGNUKpKf9O+DET++JVnu93UkM/fcrybfSWqTbHJrCzjBxXrxFaA Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10393"; a="271080997" X-IronPort-AV: E=Sophos;i="5.92,234,1650956400"; d="scan'208";a="271080997" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 03:39:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,234,1650956400"; d="scan'208";a="733586268" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 30 Jun 2022 03:39:21 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 30 Jun 2022 03:39:20 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 30 Jun 2022 03:39:20 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx604.amr.corp.intel.com (10.18.126.84) 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, 30 Jun 2022 03:39:20 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.177) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 30 Jun 2022 03:39:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jx2ZB6QJM5SSOGEKz1QqukjMx31KbuXH6aAIt/XfC5Sm9Wtd0xMbzQUnPUndaGoTRdO5gK3xkfSq/E3Y3tVjHJFwNou9w9MLUuohi+JAJ/0/sbBq5Ht2iqY9oKlRZzB1/R5XAAGQh7H5y0dKJy9/nyTiv6TIaD2O9Dmil8ZmITnoalG5cc4AwEZWhodPlcUP1Py+i3mFDmj4zRRSaJMsWTAFAif9F+six29cR88FQcfTBqA1UUXoeCJJ73zz4jI1pfrb+rqDjjAFbeFow8YM5PW+C5vmNYbFn+vO8IxcnqLxQb03LUBptDerr6gUXJFrkKGJE36rbzMO/UeKKQMLFA== 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=AGvKObI7Qj9zju74J7gKU4zWFJUykUDBC8lWqQqMxGc=; b=I0hsPhZHhb6vViPpcaqotetec6dTfDEZvmkmS2XUWF0rodkCyI6HmQ/7/5dZ7TvVodE3H6NiG4cSCx9UHruTaDONw0ZV7GBkQXrW3GJ1ko6gYOnTDfAV5WYBWTGLudNOkmG5WXZ2MrNoU+80xSbFZ4ZjMUCy5WY1ciSlilzxBWJisJV2SCSHHB29RwzrFo8XlgAA678SJFrxujkbVfZpGwCEUmaU0WWQPSK7sg8J6X2I5p2rXCZ/7GesJSMCNPl/PwQsP0W9QjvrYld7IISfBX5vYUh/4O5n9WNUcYHsOjQYQBZ1wX82dEmOn8329qS/mVd9KMachCrJHlM1i8zMRg== 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 LV2PR11MB6069.namprd11.prod.outlook.com (2603:10b6:408:17a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Thu, 30 Jun 2022 10:38:37 +0000 Received: from CO6PR11MB5602.namprd11.prod.outlook.com ([fe80::c4dc:c0e7:a0f2:7a0f]) by CO6PR11MB5602.namprd11.prod.outlook.com ([fe80::c4dc:c0e7:a0f2:7a0f%6]) with mapi id 15.20.5395.014; Thu, 30 Jun 2022 10:38:37 +0000 From: "Zeng, ZhichaoX" To: Harman Kalra , "Richardson, Bruce" CC: "stable@dpdk.org" , "Yang, Qiming" , "dev@dpdk.org" , "Zeng, ZhichaoX" 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/FQgAoFEAA= Date: Thu, 30 Jun 2022 10:38:37 +0000 Message-ID: References: <20220530134738.488602-1-zhichaox.zeng@intel.com> <20220615060154.6905-1-zhichaox.zeng@intel.com> In-Reply-To: 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: 496fa1e1-db8d-4d99-8ec2-08da5a84b0c1 x-ms-traffictypediagnostic: LV2PR11MB6069: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: m/6GeEaEZpk3HVivwL0H5ewhMaeoz5zDKcjTLxGvo+Y6JERQvBbedIK3YEyalzy2yyxzADSMt97OyANqt5Vv1Om62SatPPzK91Axnlm/I3ZHF8ItSoAMHDox+9j+mTeU72nE0hdBWCLEcfjusnwi/Qw92VT7DJwxyRt+haNLnPL5vDi4rB9yp39Z4k95xgjsKK6ErKI1IgoahKq1Ym5CohvzeO+RMAuAwBhddxEl7IY/NZutZ6fJ24ggJPFsk+BR+MHVxoXBWaZvE0B+jDOU5vU7RCDKvHXB6jCrkZQloNccQRL2ocl8cIsfN46kkJ7P6xPSybergVTo2/0OLbw1Wsd0ip8TrezyyDhe4J1H8XqsQkpSvQ02zI9g1jTcHFRnUwRFtnamjWTY3LanoJqj+fj691A5FrAuWECde02zInY8eNvm23Zgw4AJ4W6ACNvh9hF3RzU3jPAY6Hht7J9fkJHG9ZhZu6zq22vm1g522D4ZJH0qe+nDVMforqnmMz4zwxJjpVE2PcAvqbyUkTWK3N65Tysdt7lFRjisl9jIUqDdvMFLIvBnWQutYtHidkJ/OrbkactFe/NBGkniYID0EZOUFHGXy/FpQZ4Hzhnpbr7aYeWUmXVPnxWuU3KngC1h38/kRPIkAgeuwBqb5c+Jao4uinq/pl777c2zvqA6xrzoGQEBqwy1CQR4Du1/UNxbMo1rsutjz45yroGveq7ZoRg2Lgl/F9l9Aew7pLC1oYUCtAVKF0qf53EX0VzfBkBH4knnc7u7xDFCkDpErdzrYpP5JnNM5FjT1ZX/BR4C0n2H64FkZ2ev/Xk+2d3m+TSt 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)(346002)(366004)(396003)(136003)(376002)(9686003)(186003)(83380400001)(107886003)(26005)(6506007)(55016003)(7696005)(53546011)(38100700002)(6636002)(66446008)(2906002)(110136005)(54906003)(38070700005)(5660300002)(41300700001)(52536014)(8936002)(478600001)(4326008)(71200400001)(66556008)(82960400001)(8676002)(76116006)(64756008)(66476007)(66946007)(316002)(33656002)(86362001)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9Wo/KixasJ2H2OhpXiizQKhuw33c0Zw6p5CuEIZ+4hzBsreS3rxWupXoNrfd?= =?us-ascii?Q?8Qe+leymTWxZvfmZYGjUjx0wbQ4DqhGRtizf127zp2wSet53c4ulvoNcQKXp?= =?us-ascii?Q?ffBlXEtPE5V8j6se2IFWGmLpj1WNs0r+1seUpbWTfFJT+4qqiRYKjVDlBEwp?= =?us-ascii?Q?/PkAq63Z+qmuXcAKLIJtcIGOsTYK3zRgiG1IDIGfjKGC/8ALgSBatsWLiDTr?= =?us-ascii?Q?eyDX6OWhUeUfjQ5j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J0v/?= =?us-ascii?Q?ms2d4eDmi8N+yJiH8cOfSW1yQueOdO3AQGruruuKb63V7aItif2fGVkrs/MG?= =?us-ascii?Q?DuxhSHcXacUBtIlj6+KpMooF2Dzx/QSwsyHil26ePjsWxPQM+GfYSuSKK6bW?= =?us-ascii?Q?V7NGgEiQMVS4zPgjM7072uUeXOrSStaXnj43+W4pHBSZ0pj8p3wHOB7ggube?= =?us-ascii?Q?+hWb892ZSkOm/+i/FuIAwJ8QLH4LtgiV0EAEfEcrzyCw7T94QiPp9IRU/ZyK?= =?us-ascii?Q?gu4jIi71zudUNRtik0QM6ysglvpiK8vIcbgsRKMb3t8Lgg44aBhyh+Gs2q/x?= =?us-ascii?Q?UaIPmNaZz0TtnkEisSe7KM3Q4NRscy0KLjVnhvKVp68Z0fgYH7QJ0XW7uHTM?= =?us-ascii?Q?rfladJJ1wh7PbpiqoKYJzsVrqYGxJAwYeT2xf3xAUq6RKlq8SLJ14l5Ud2gi?= =?us-ascii?Q?dpnggwUzn4rflUoIpisyKg09YOQ/wmuvdHmxECaU?= 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: 496fa1e1-db8d-4d99-8ec2-08da5a84b0c1 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jun 2022 10:38:37.3691 (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: ackcmloIL7D83BgI1Yoo+jw0xoaptl0ZJzElzH+sTkfTwonvEOJBWrMdIkLyruv9BtkUkwhg2pvMUaHka0fJmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR11MB6069 X-OriginatorOrg: intel.com 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 Harman, Bruce Could you please help to review this patch, thank you so much! 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