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 A5E6AA0C45; Tue, 14 Sep 2021 05:17:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3288C4068F; Tue, 14 Sep 2021 05:17:21 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 58DDA40151 for ; Tue, 14 Sep 2021 05:17:19 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10106"; a="209091072" X-IronPort-AV: E=Sophos;i="5.85,291,1624345200"; d="scan'208";a="209091072" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2021 20:17:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,291,1624345200"; d="scan'208";a="432825422" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga006.jf.intel.com with ESMTP; 13 Sep 2021 20:17:18 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 13 Sep 2021 20:17:18 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 13 Sep 2021 20:17:18 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.43) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 13 Sep 2021 20:17:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LnaSLGxGWXUTxYPbpeBNz4fjTBhD6WBDu9T7E+J3bQIYSz+MYphGSWi3j+e1p6RcLzq3bjD4MqT6iYcbbdK/+nwWvDviynH4vyizk/9D5rWdCopcCQgpgI++IL9VmCintAzFByUNG6YiRF/+07KSU/L7V32azPsOZ+J8y2A7m9+oJl8M8pa9Qz/jgsRhr7EmOzIVCEf6v/BtXPaQMZGrXiO5w0h2h+FyEqjXsa6/+XbveSQKHwaNcNatrDFUWIbdBDRJUh+NiSNpIrSNUSvpo7iIJCrnXYjjcSG+fHHCQeb+t7ICoDXlODHTDmoDls4elUGBK4Irs2upzSar0ZV2NA== 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; bh=oIdg5LtkKxvFbIjf3XNatrvYAIqGE0hjnnGfj+JVr1E=; b=cHGCC/aE7e7eP94uu2vOCeTBxlRIke0+1K4araeQbAvW8Lq0+/rW7/vTLLe0oG58w5OWH629kf/fMpik+LIX6QS+VzieQinh+QqwRnhkBzKpooajfyIbtjW907u1iRaQtlGSoHxhSVuL+y1HUhGpyvGm/xK3YFTrlziA+HJlm/JXdX08mOAt5ljZZB9g3zCiuLno4JuKZGInmmKkeHTxJsY1864bc3aEZG4AVx7aJ/Tz4LZ6y9AX+K6k6rU9gMpOVr7oJcmqOv5i+PD/O7/rSh9XRJyczN74I9BxduFS/M7D0FXOfmNLtg0UJ1fiBnDxTWLXQOoyYEJzRulA86gkww== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oIdg5LtkKxvFbIjf3XNatrvYAIqGE0hjnnGfj+JVr1E=; b=YaZY+pybFb2g3Q3gI8JASDUbpk2Uyi1c8suHKy+xBHoErDVtJumuTIazpHszM14tFLFuIhnLz9fmD/h/bDivKE/rd1BbZqgjIEFYrDut8rTDG099XWwZPp+qTfne2ygvlBGvSRW+4dA/rs3yCsglRP2bEEyf2HCQNL0Q9h7Ee/U= Received: from BN7PR11MB2658.namprd11.prod.outlook.com (52.135.255.16) by BN6PR11MB3985.namprd11.prod.outlook.com (10.255.129.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20; Tue, 14 Sep 2021 03:17:15 +0000 Received: from BN7PR11MB2658.namprd11.prod.outlook.com ([fe80::dc53:d62d:2e6:2ee9]) by BN7PR11MB2658.namprd11.prod.outlook.com ([fe80::dc53:d62d:2e6:2ee9%6]) with mapi id 15.20.4500.019; Tue, 14 Sep 2021 03:17:15 +0000 From: "Lin, Xueqin" To: Stephen Hemminger , "Richardson, Bruce" CC: "Peng, ZhihongX" , "Burakov, Anatoly" , "Ananyev, Konstantin" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] Enable AddressSanitizer feature on DPDK Thread-Index: AQHXpekaTx4zf/rx3E2NQ2B/S5A12KuckLEAgATjfwCAAKG0AIAABIqAgAAGjYCAAL+dYA== Date: Tue, 14 Sep 2021 03:17:15 +0000 Message-ID: References: <20210910020147.148019-1-zhihongx.peng@intel.com> <20210909194756.6addfe73@hermes.local> <20210913080558.4a8b9ae4@hermes.local> <20210913084539.0f16146a@hermes.local> In-Reply-To: <20210913084539.0f16146a@hermes.local> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: networkplumber.org; dkim=none (message not signed) header.d=none;networkplumber.org; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 35447c98-de66-4fb0-d0b0-08d9772e2719 x-ms-traffictypediagnostic: BN6PR11MB3985: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eGWbmgkFzKZ+5KtN/ypI+5rKFPVYW5p2NHesvMO6y9XE3S/sJ0QEwtqF6JHxuUDT5LsyJyVEnwByZFax2aHtNLP0FASEWo2dmCZtLViq6K5s4I5ZDVN5hjaG/r3H4aSpPwYag9fg+gD1wfMTJoQnInplqqtF3d3aDb8ohyz4S8VIEkFJA8C+J5NPV8F5L9q5A8IhSitU45SWfhSx5VuyUWHTny2tkq6K3jc0/aFMS7XLE6Ix9rlqtvf8mK5DkPhbgp/jKVfvmCNI4+NYna4I6qSAF6WL6UC5tCOGggmvqDWcBartwI1egiRK+Rx5C0yJniTc3D+uOR+oJhD6SNJrHATyItUGyFuWu4rGGdIPpeKrzzglAHJ71YG2dJRhf/UZxEFqd5CP2dW9lclo1fBU9K4zAXgy6Y+HoncA9Tdd6RVbdUzNzPbBf4wzoXV/zPnFm8MslNlklGpfLieH/KR9cWNhEKphPyXOocliugyHRtqSfLLc0Ad2UwuA72kqq+NDTAxrxlai86cr2LfzBghNgwc5dhdyPRO8tqubXknL5ThsyZ98Zj22/wsTgEE8YEb1OHtHfLCywoFEb4MhQeA9lPSZzPM5s0dpVs/irgL7gusebqAr9GiN7oPv0TvxNRcpbn2Y6FzqAZRt60gVPmT+F42iaSzfTfTsH87tD7KFGRHKpyEV9/JpRkq5ereIf616WL8wEO5UoSGqYOtygpdtVo70AfLCn7tjgDIOohLlqqg= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN7PR11MB2658.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(136003)(376002)(366004)(39860400002)(346002)(186003)(83380400001)(8676002)(122000001)(38100700002)(26005)(33656002)(66446008)(64756008)(110136005)(4326008)(38070700005)(9686003)(66556008)(66476007)(6636002)(86362001)(8936002)(66946007)(76116006)(6506007)(316002)(53546011)(52536014)(5660300002)(7696005)(55016002)(71200400001)(54906003)(478600001)(2906002)(49343001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?m/0bhXDepcQ+N0lrM1qWoO42T81bJfk1Y/y+mlS35tqgbW/bbHjZ+J0SU4Kt?= =?us-ascii?Q?2cL9+I+ok4Ae67OnI6KRm3K7sTJBy75oEvw086Jgr5isrrJcnjcPpzsskqfe?= =?us-ascii?Q?881WmLHrDTfjiSSpNJkJfqLtXZFNftbwhOH9rwC+oHANUSjgs2lwvU7vRTjk?= =?us-ascii?Q?mCv+V2vd8Pd3uPG4stiYcHfY+UPKhRXFptktNh+2MbelJFAB8RPAUSmuoRsu?= =?us-ascii?Q?ihv6b7YhEjqayKuOjEf2dklLTBug8fi4BF/QcrhZY0K3+3lVeDRgkyLxNF3X?= =?us-ascii?Q?1pySDLlaY6UrK1M5bHPiJMcIrZheDCl5rBfTKKhKUAaAADxWfuLg7hvM6qgZ?= =?us-ascii?Q?CyCxnvMmNXeXlQiRr1F2sjSpOjpR9iiwnBRYms+LXKqdksJ9d5WCUnR4Pj/m?= =?us-ascii?Q?vHSvphiDC0Hj16CdzN0kP+HO/LCZrbwWyafoykPi2MFtAJtKaPZNkn82YXFy?= =?us-ascii?Q?cYBJy7u7U+bq0edv522xjlNFjwoKKMld/Q6a15xH6KEywtfee5aZ8XVxrMO7?= =?us-ascii?Q?apuXLglGO+rgXcbNp7ZXInLO0N+7XrHU60OhxIl91LY8psdDh7nOVAMSCSFV?= =?us-ascii?Q?QQj5umUYwkkJGFnELxBIuMHOslljG8rggZKsBP2lNSvD8sm3gSNxDlN0Fk/E?= =?us-ascii?Q?XT1xogZDTARLuzvXbiDt8ar5mtzkdJig0jTvSP8nLujHC7y5v6nYvmEngOVQ?= =?us-ascii?Q?UQfdS8qOlDpe3jGmaiK/dDqW6I5YpzCevxp1HaGtUBRELkjUfpR7z+ewXz1n?= =?us-ascii?Q?YiSeV4hdYnTnPLMEbU2LX8pCFskwEw7AzUBOT/toLEm8T7T3BhdINlV5WoiG?= =?us-ascii?Q?mwC7t5H9NTBjaS1ampb+Lr6OcEKaC+iiCK0NILViW5ugmUuY8Ol0LryMRj95?= =?us-ascii?Q?OJ3xdJG7ZE+sws5p2FEKWDbHYcK2Uvuy7RyWScekq6TRDcq0BR4JCCtTUfeb?= =?us-ascii?Q?YoZEuV00gbYRqTIZpO4+hwOzzpB67n0K/nm9mx7irHrDXkmURo11oN/DfLmW?= =?us-ascii?Q?XaDQl4C65QfhjQSunupUBRvtpgR37UAAWeya0lipOWwHW1g0OzB29LioXkN8?= =?us-ascii?Q?lC0QXERBOVnC2w/CihoQXCKER/ykqM4URC4kpchlZ81AiW0+AxdgAhniN2VZ?= =?us-ascii?Q?V+xBsy4ehqqJoFQe7vbONOsHg/xjWDAJG/y4xg8GctCTKt3NY3ejvL0F1Crj?= =?us-ascii?Q?BYwtdNGumUDDPI8s09XUDf+9i096nQhZm0+BVContkdsdGLxQQtX0vbNjS3t?= =?us-ascii?Q?FJSIO/1ppNh7xeLtvCLb8XHpXBnP5ukvNqrphHyUJgwTqXJqAJ2et8PyAOxk?= =?us-ascii?Q?1A3cKXu/lk52ixPU9QkM+b0H?= 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: BN7PR11MB2658.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35447c98-de66-4fb0-d0b0-08d9772e2719 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Sep 2021 03:17:15.5591 (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: qjI68STL3IDOOpLHXHJjQ+ICcgEr79qLyYdHL/k63F9Hey9R8kNeCAxafOzeKqV0LfmJV9pJHyeybaumlY7Qiw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB3985 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] Enable AddressSanitizer feature on DPDK 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 Sender: "dev" > -----Original Message----- > From: Stephen Hemminger > Sent: Monday, September 13, 2021 11:46 PM > To: Richardson, Bruce > Cc: Peng, ZhihongX ; Burakov, Anatoly > ; Ananyev, Konstantin > ; dev@dpdk.org; Lin, Xueqin > > Subject: Re: [dpdk-dev] [PATCH] Enable AddressSanitizer feature on DPDK >=20 > On Mon, 13 Sep 2021 16:22:13 +0100 > Bruce Richardson wrote: >=20 > > On Mon, Sep 13, 2021 at 08:05:58AM -0700, Stephen Hemminger wrote: > > > On Mon, 13 Sep 2021 05:27:12 +0000 > > > "Peng, ZhihongX" wrote: > > > > > > > > -----Original Message----- > > > > > From: Stephen Hemminger > > > > > Sent: Friday, September 10, 2021 10:48 AM > > > > > To: Peng, ZhihongX > > > > > Cc: Burakov, Anatoly ; Ananyev, > > > > > Konstantin ; dev@dpdk.org; Lin, > > > > > Xueqin > > > > > Subject: Re: [PATCH] Enable AddressSanitizer feature on DPDK > > > > > > > > > > On Fri, 10 Sep 2021 02:01:47 +0000 zhihongx.peng@intel.com > > > > > wrote: > > > > > > > > > > > > > > > > > +if get_option('b_sanitize').startswith('address') > > > > > > + cflags +=3D '-DRTE_MALLOC_ASAN' > > > > > > +endif > > > > > > + > > > > > > > > > > This looks great, but can we make it just do-the-right-thing and > > > > > get rid of the nerd knobs (i.e no meson configure). > > > > > > > > > There are no new meson options being added here. Turning on/off > > address sanitizing is a built-in meson option that is there already. > > > > > > > The address sanitizer already has a way to detect if enabled. > > > > > > > > > > GCC uses: > > > > > __SANITIZE_ADDRESS__ > > > > > > > > > > Clang uses: > > > > > #if defined(__has_feature) > > > > > # if __has_feature(address_sanitizer) > > > > > > > > Tried this method you said. It can run successfully. Because gcc > > > > and clang have different Methods for determining whether to turn > > > > on the asan function, so if you judge the two methods in the code, = it > feels not simple to judge in meson. > > > > > > There is already compiler specific #ifdef's why not do this contained= in > one header file? > > > > > > The point is DPDK is trying to get away from having configuration > > > settings if at all possible. Configuration creates dependency > > > nightmares and also leaves many code paths as never tested. > > > > Not sure I follow your point here. We need some macro to easily tell > > if we are running with address sanitization enabled or not, so as to > > avoid having the multi-compiler detection rules all over the place. > > The only question is where it's better to have this in a header file or= a > meson.build file. > > Given your objection and the fact that the meson.build code above > > looks a little awkward, I'd suggest putting the conditional checks in > malloc_elem.h. >=20 > NVM working of meson as commn base seems like good option. +1, good option for the tool enable, thanks a lot for your guide and positi= ve feedback.=20 We will update them in V2 and send V2 soon. High appreciate that you can ACK this feature patch if no other objection, = thanks.=20