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 44145A0C45; Mon, 13 Sep 2021 17:45:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92EE640151; Mon, 13 Sep 2021 17:45:45 +0200 (CEST) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mails.dpdk.org (Postfix) with ESMTP id E27BB4014F for ; Mon, 13 Sep 2021 17:45:43 +0200 (CEST) Received: by mail-pj1-f42.google.com with SMTP id g13-20020a17090a3c8d00b00196286963b9so6886585pjc.3 for ; Mon, 13 Sep 2021 08:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fwS+sA80i0i58+k66knMfA1LTl+I2IpEUhgfwcmvrtA=; b=P41HzSk5TRax0t50oK7MQO/MpxXphHp9fqBFY7dd9dweAS8Pm5ZbD/pxqR9v3bRJNj OCjg7YEdEAVohPwB9n8JhzIPJf5NvL4s+VniYInnNsLDPERBkGD9cHWfqpe0D2L3+Feh QvzGJr20oEr5o63dbYylT0J+ae3Uzriff0tiPWzPRSZOPqqbFxhK6x7fxpzeWjWVu1lc MSJUuCPw1GO7xBCR/pHKwPvyquuYAGlcLU/Vn3ewcXCt6lTahZFouB4mY7+LROFE9lC/ wqj2UHNE/71lFxDXnGZBJg4/1FL9KL69/N2RJBRvLrnv2wYtA1C68k95NPPDSONRXsiE 7nYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fwS+sA80i0i58+k66knMfA1LTl+I2IpEUhgfwcmvrtA=; b=gSKD6sbCiJpebIOsJl4ZkR8FWbILKx580glnhSuzjxtKzYbAIJ3luxdO2k0Pb75Zh5 9YDqwGKE5XxL5dKPDAWM354IlUW349Xd8Jjx6YHTl+fEdoFSjooHT2AeLgEVuAbpu5LF bjXat84iAB3zAMuHnRG7Ix0nDN99G8hhfDs6cim4U0XgHyHXaq5A01Ya4h7d8KA9ZUx/ RBm/kHW7M2GCwHgUc4XWTaG17C6a8ycC7s/De3pm08MIG65v62G/7ip+nMChXYnRrmim PxJuDDAQM7cQuh4bwtGdRyYl35lXAiZ1sgwuB8hz+80Pwnnj20wlrDl3w8WCeYVqRdmc 72Og== X-Gm-Message-State: AOAM531qg1eJnzzkbnZJBYNdBpylJ0tIFZEQtUnezJUemDE9xzbaTKeo gdEnvgQ/a4Nt/u2r8vAKMl+v4A== X-Google-Smtp-Source: ABdhPJxOwWoHBzKErcnnBTqFnwUjuKrrxD7ezVOyuP+q9C+bi3VSejqk5JvinQHyA7zORaWFOWS8rw== X-Received: by 2002:a17:90b:2344:: with SMTP id ms4mr226032pjb.3.1631547942927; Mon, 13 Sep 2021 08:45:42 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id t23sm7092561pjs.16.2021.09.13.08.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 08:45:42 -0700 (PDT) Date: Mon, 13 Sep 2021 08:45:39 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: "Peng, ZhihongX" , "Burakov, Anatoly" , "Ananyev, Konstantin" , "dev@dpdk.org" , "Lin, Xueqin" Message-ID: <20210913084539.0f16146a@hermes.local> In-Reply-To: References: <20210910020147.148019-1-zhihongx.peng@intel.com> <20210909194756.6addfe73@hermes.local> <20210913080558.4a8b9ae4@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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" On Mon, 13 Sep 2021 16:22:13 +0100 Bruce Richardson wrote: > 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 += '-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. NVM working of meson as commn base seems like good option.