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 75E5EA0C41; Thu, 30 Sep 2021 15:59:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED7DD410E5; Thu, 30 Sep 2021 15:59:10 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 602CF40DDA for ; Thu, 30 Sep 2021 15:59:09 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10122"; a="286209409" X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="286209409" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2021 06:59:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="539438616" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga004.fm.intel.com with ESMTP; 30 Sep 2021 06:59:08 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) 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.2242.12; Thu, 30 Sep 2021 06:59:07 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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 via Frontend Transport; Thu, 30 Sep 2021 06:59:07 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.41) 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; Thu, 30 Sep 2021 06:59:07 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Piz37Y6opiEcfwLHy7NQt78KYNofzr5/B7tHKWOJpya7cV02NEhoLvvvjF+DfQGSmKddntweeTIpI2nj6tHOQbHSFQUGnZNhfiydUBg1AcwsByYsLl92gIy5XvM6DIoQscu8KSt+fJeMw6ggBVIFqx26KcllMTCTc5sytmSdH5j0mLtFN52AwMv+apJf7+e54Jn9GX3mJE+VPt2LYx2pWdakmfQLfKplZ2Xyplk3/yhF+2CgN6hERrU3k5xltQ6x96c4rRHj0PLHhWejPiK4bZq54Qsr5AMb42T08YEcpawqm7+wF1anKwufmFg6/F79NLwbamBa8c1h9p1aCz/+qA== 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=oN4+enZofa/DQ8M5ZUEW6uAVOxJaoccfusAs7k1Zz/M=; b=VDibGxvaqwB2REDXp8EQmh/52UPU3LyMVDRhRomBYUYoYStprZuNW892AutNITUJheXRLzyeX7313lVNX+57nifDzdKeoD+++H8y0wDFvgV+BsH8ye7OZIn9H1wgUWCYilzr3eqkHqYD3RJ2pscX7nrB0Pf0pc2ljpKIhJTZVBZE++ZgUusnJAfhlHbjQ5vfqpj6h5LyqCXB63x2Pj7A7AYvjhbL0ts1EqcQHQRGVarT+d2TG4UAX/emLEYEroafqyOb8HlBk9TL7VarZ26VrkBC4lyubHosfmcktjmHc++tcjHvfM60otj589BLvmzpg8CR0agUC9qH9mwyph0c/g== 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=oN4+enZofa/DQ8M5ZUEW6uAVOxJaoccfusAs7k1Zz/M=; b=ocugrWc4iMujQM5jjwT1L7FhpBc7lfVcgP9ZnsiVxhtYwUGjiT9cIVkax4d4Hyxkg9M6LHScaINqhRTN15ieR6INvKZqVs2R70nstLx3vUDEVoVM33O2s65a47NA+V+ZldjJxq10dQSGVABzJN6Ltml0/ewBMP9StkiK+Dtp7jI= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) by PH0PR11MB4983.namprd11.prod.outlook.com (2603:10b6:510:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 30 Sep 2021 13:59:06 +0000 Received: from PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::d145:710a:1bac:7e91]) by PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::d145:710a:1bac:7e91%9]) with mapi id 15.20.4566.014; Thu, 30 Sep 2021 13:59:06 +0000 To: , , CC: , References: <20210924100310.4278-1-zhihongx.peng@intel.com> <20210930125938.266731-1-zhihongx.peng@intel.com> From: "Burakov, Anatoly" Message-ID: <761ac2b9-6a0e-c7c5-116f-189fd5ef2794@intel.com> Date: Thu, 30 Sep 2021 14:59:00 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 In-Reply-To: <20210930125938.266731-1-zhihongx.peng@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DU2PR04CA0347.eurprd04.prod.outlook.com (2603:10a6:10:2b4::27) To PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) MIME-Version: 1.0 Received: from [192.168.1.10] (212.17.34.161) by DU2PR04CA0347.eurprd04.prod.outlook.com (2603:10a6:10:2b4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 13:59:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb56c144-b025-4071-deb1-08d9841a77c9 X-MS-TrafficTypeDiagnostic: PH0PR11MB4983: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8ABi0FAE2xkkL7nkcjNScFfJZErcij/jQIE4Ja1+2Ks6Fs6EiU5nb8OwNir3Ae1k11f+h/Q7F7F3HA4Ib9tqw3kSilf6O5NGLhwOarR9+jaoojeKVQGp7FZbTgVHyI4nKBSVrSj8tzbgvJzIvNOuHIW2C6Vji4eOd7UMpA/F6Po04fL+WGCC7DHF8DlhW40Q9jC2PosbsI5BRFb7827EJ+i/3z6eR/xAEN08n9rV8WPdKvL3RmVKzKPvpASVtlw44R+YtFOEkvKmHBa8FzTwnEVzTS7+rUFvQOsBsFmg6ESwbfLFjMHtMRnJV8TxkXSBsyDtYY5s9VFRka4iyEtXa+EE++kdIYU2GRxM95h0v5NPWKMcq8ikheRSmdgxc62X7ZUhMIHBBFzaw5JjCNXba9bkq8rjeJRNwDcu5KqRapEE8e0q80usVdQbBGgMSpLgHCwBXPFKXKVxLsz3IoUGSCcwhyD2K2QtxkTHodECdyOHI9h6mUSZ51pZxji+7f95TsPbLWgzP1TJZ+Ujvacmmfx7bk+McfGAtkaZLj3p57cGoPGplf3NLWg4GnZwu9KM3yZ2MjXmFbenURLHQqMUQryuIQPWxAqxVqahK4FnFyASTYhUJFthr3Z1ArukYtYydGCzo5XY/zJvALKe/6l6DmFIlswAOAZbywEvuvwkeLNNJHT+Kyer0l+gnWg1K8NFkyuwXeQf1a3OLAL0nk/zQoXpNhkW2/nLFiKsFqprWSBhTLjsUIBQBJKH3evJ8RYodLPughslW3FQzNn2hE9rIumJbfIfYf0elMKmkSvkUR/bqdu7M5JZL8Wip/l7LmIK X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5093.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(16576012)(36756003)(31686004)(53546011)(8936002)(2616005)(6666004)(31696002)(83380400001)(2906002)(956004)(66946007)(86362001)(8676002)(107886003)(38100700002)(6486002)(4326008)(26005)(5660300002)(66556008)(186003)(508600001)(66476007)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?LzBYcUVvejAvcHdUc2VxSFV0UWw5TjBDMVJqSnlSTFAyUVcvTkVCNU9jc0Q3?= =?utf-8?B?YzdBTzNXVzRENVRrUEJ4djBnZlo3aktFblAweW1aL3FkWWNEYS9ONndDdUo0?= =?utf-8?B?YzdRUmF2bnNFbE1EODR3bkRxaXRMNFlFNXI2dG9yS21rZ1c3Q3hjTlFxK040?= =?utf-8?B?NUQ4WGFiWGV0aW00akdXK0lzQlZqQ3FLVk5Ka2RIbGFOQWUvSlJBUlBRVlV2?= =?utf-8?B?NUp0eFB5MGtRdU9XcTBPSE0vMjVNcG10Q21aWWsvWnNsZkZWWXltOVl4bUY5?= =?utf-8?B?cnBhcUNOZUxaWnpNR1EyaXk3MFJvV2RiZ2NGa0RLRUlSRjFlYitCbFVDRjNM?= =?utf-8?B?MHN3dWI2SlMzZFZkNmdmUEdzaUpXYi9ET1RScTlHZlBpd0c0M2dpSEc0VnVs?= =?utf-8?B?ZTJGZExsdThwWUFVWjRHUkhCdUV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Zy8ycVRFZkIwZUEwVHRpMXRCK0N4NlNReGZCaW5KaldKUXdPWHhsYlM4?= =?utf-8?B?c0RNempiY2k2OXVNQjVOTE85RXdmRnVQM0IwYUZ0MklNU1V0QjQ0UHhqdEZE?= =?utf-8?B?UzlBeFhBU3dGSWhVRm83VFEvZFBqYmNPYWx4cm5CSGFzVWtOTEFDZkJxSEUy?= =?utf-8?B?Q3laa2ZWSnRFRkd0NkFjUnVuUkpEeVZzL1oyeVpMK01nbHU2S2FsMWloazR5?= =?utf-8?B?VUJtekNWRktkZ0Y0YTNwakRIcmFpNExZUm5ndFZBa3kzdXRPc1ZncWU5cExt?= =?utf-8?B?bmd3bm9WTFdlWHlHQVVpeTNVWGNqZ1VvRnh0ckhqeS9GNFU3amlFaG1lWUNM?= =?utf-8?B?QWRQWTBvbXd2L29PVStKV29RS2VKamx3VUVIL1JmQWxyVHdwMWFsTTZPOEQv?= =?utf-8?Q?ZwljbTegjxb2lK4Zw6zsG3AZ2kly6zvNt3AkXRN?= X-MS-Exchange-CrossTenant-Network-Message-Id: bb56c144-b025-4071-deb1-08d9841a77c9 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5093.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 13:59:06.4794 (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: YNzrDOvXbLmAKQmuZ/gIBc5PAPyX2wINkQCk4BRYB7j0NBUYuoeYLmJ6tdtaR5rQrNV9WuZrxZQxvB2XA+b8e7uw/I3MxnDz1MgoIJdASds= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4983 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v6 1/2] Enable ASan for memory detector 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" On 30-Sep-21 1:59 PM, zhihongx.peng@intel.com wrote: > From: Zhihong Peng > > AddressSanitizer (ASan) is a google memory error detect > standard tool. It could help to detect use-after-free and > {heap,stack,global}-buffer overflow bugs in C/C++ programs, > print detailed error information when error happens, large > improve debug efficiency. > > `AddressSanitizer > ` (ASan) > is a widely-used debugging tool to detect memory access errors. > It helps detect issues like use-after-free, various kinds of buffer > overruns in C/C++ programs, and other similar errors, as well as > printing out detailed debug information whenever an error is detected. > > DPDK ASan functionality is currently only supported Linux x86_64. > Support other platforms, need to define ASAN_SHADOW_OFFSET value > according to google ASan document. > > Here is an example of heap-buffer-overflow bug: > ...... > char *p = rte_zmalloc(NULL, 7, 0); > p[7] = 'a'; > ...... > > Here is an example of use-after-free bug: > ...... > char *p = rte_zmalloc(NULL, 7, 0); > rte_free(p); > *p = 'a'; > ...... > > If you want to use this feature, > you need to add below compilation options when compiling code: > -Dbuildtype=debug -Db_lundef=false -Db_sanitize=address > "-Dbuildtype=debug": This is a non-essential option. When this option > is added, if a memory error occurs, ASan can clearly show where the > code is wrong. > "-Db_lundef=false": When use clang to compile DPDK, this option must > be added. > > Signed-off-by: Xueqin Lin > Signed-off-by: Zhihong Peng > --- Acked-by: Anatoly Burakov -- Thanks, Anatoly