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 CAE44A0C46; Mon, 6 Sep 2021 07:52:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9057140E32; Mon, 6 Sep 2021 07:52:03 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 7FF2740C35; Mon, 6 Sep 2021 07:52:01 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10098"; a="219909366" X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="219909366" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2021 22:52:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="522937609" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga004.fm.intel.com with ESMTP; 05 Sep 2021 22:52:00 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) 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; Sun, 5 Sep 2021 22:51:59 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Sun, 5 Sep 2021 22:51:59 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.175) 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.10; Sun, 5 Sep 2021 22:51:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JqMk0J5ADnIdG5JrmcvtYwahIV3nfu2rL45dGZDuX6MjY/ooYvxCF+1oWwU26srvwNhiOoA/NyvLlIhsKlzbKgwGUt5isEDslXxcVCrrYaopNL4/2wpbV5qlZzB9smudIwZ0eX9rvdIf5GssELahE1Tyy+oCle5DDr3BXnm4qL9fSXhQW2Mo0dis9HiYG+7jp3VYvp9oA83rNq24dygSj6eGwTwQmqBnf4IcoDmluWmoc/SgjnqxCV98cg5EMcMnWSil+0kyYaZfDuYcwaL9whyGo3+XEtoy9CH73a46+3StnG6R3h5DBkgi6DDz3t/Uf7amG1+FXqbN2pbK+lm+xQ== 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=M4qe2ON8dE146eyhRw2xozjGF2a8/zhPBbiJ4gBzbcY=; b=U7DO0IfQhYry6HOVD+PpRPYvqhOAalCVdsLqyjRJ5SBOWn3/LCNmJ/wXQUvf0NvKAcjFzsbHvmcRhjsEY5myJj/G6JU60HYK8QAtzh++yBpwrievaqNZQCEYJua9FBDR2sj2VQUvOPZ5UhKqvJUzeKx3uVBSR70g6LimROCDIhhJ11/gvHZXzbQPjUMnfzuXbWNPJKkchFl57LgqPmB/EZ/dmHB4QmF5lomWSAnZ9TQuLOt/1uJRakmil71FESq6wro9EEtxQBXlkkE+gXM3i9KDKNqGNJ0S8xChhzdJHfJIeFKbw/4P+2J3gUTefWmt4M6lm9MNGq3I9IBYxrwETQ== 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=M4qe2ON8dE146eyhRw2xozjGF2a8/zhPBbiJ4gBzbcY=; b=WKuTbX75M2PgjnkWI5zx6GVx9DfHUCWUkMfAtflzj480zYL8Ug6equf2kBRU3gu4PcRafV2FgUcW81ug6RzdXCF2IbbFktv2VJroSUhvrfv6aEb35tx7f5hbntiyHw/sjnFMMh7bZzM6ojceDAfUFHLIupCva8Tc8tg2k4VitFk= Received: from DM8PR11MB5591.namprd11.prod.outlook.com (2603:10b6:8:38::23) by DM8PR11MB5606.namprd11.prod.outlook.com (2603:10b6:8:3c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20; Mon, 6 Sep 2021 05:51:58 +0000 Received: from DM8PR11MB5591.namprd11.prod.outlook.com ([fe80::904:ace8:b3b:c1a2]) by DM8PR11MB5591.namprd11.prod.outlook.com ([fe80::904:ace8:b3b:c1a2%3]) with mapi id 15.20.4478.025; Mon, 6 Sep 2021 05:51:58 +0000 From: "Peng, ZhihongX" To: Dmitry Kozlyuk CC: "olivier.matz@6wind.com" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline exit Thread-Index: AQHXnhC381HXo9uzAU2Gt5tm0Dvog6uN5cYAgAikmsA= Date: Mon, 6 Sep 2021 05:51:58 +0000 Message-ID: References: <20210831022844.18057-1-zhihongx.peng@intel.com> <20210831205224.14ddb447@sovereign> In-Reply-To: <20210831205224.14ddb447@sovereign> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b57c8636-1a61-4e8f-ca77-08d970fa7099 x-ms-traffictypediagnostic: DM8PR11MB5606: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fAiT9dw8+0uDK1XTOQ546VdG7HEqgYdel1ij5v4qX2xkSoDJojt1I1s2OggjJVEa1DYI/3sMrGGbfvYgLznZ64U5Bv8QBPF2a9RtcXXUUGJzWOfxf3DEg1jYp/GUZgJ8dQQeklwHb5Mq4OTE3uiK0S9vSc6Ua2NvrIJxANAPaGrisFMROTNqsv/tYmdI+yafg6nq/Zk5YjInMIaexyP6BgtRTeF5fA7gSOgARhK57gr5wb9K0KXniZUXoKaA6rjgrlXmX8fOvBuX0MEYzoAa4wWGSxtc/+wLYQxHYDT8F/Yveg9PU6359XdNoRWy+TsSNcUQnL/ssTSvCUudTCh/vegkyVtg3LZdgdtW4ls6jQWdlivLn+kjmsyzEMSh1/TWidjrwKO31r43NJh4n+Q5AAudFaHjIhbOazoQMMBWN1WjIWlf3uNg5wo6yyoFDljbCNfRZf5zq682B5w7bnAaJH3jmJUQOG1miFEICpX4nm8Zhzyoem6QxK3KnQlfztBwCUNAgwaXIgBbm8cHh8pPVWS3EpzoSPWS2EkmUIolFmhsBX5DXk3k7Aj83hsmyG+a2F3j9mzE+knwaku2jHhr5qGSn7PV+XY76SVjVitNIJ8MfyJVTDSJ454Ny8x/csP63wcSFCfA6Xb0fAD5upKLSZHKMBhh5njR4rhpitGia5eIAZFf6aP5BiWf44R09YAplJZoq0W8ox0BEblRAZXe9w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5591.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(396003)(39860400002)(346002)(366004)(136003)(316002)(55016002)(66946007)(66476007)(54906003)(52536014)(7696005)(71200400001)(86362001)(53546011)(66446008)(38100700002)(186003)(9686003)(478600001)(26005)(6506007)(38070700005)(76116006)(8676002)(122000001)(2906002)(4326008)(33656002)(83380400001)(5660300002)(8936002)(6916009)(64756008)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BCMa5TTnL7kIH7NyVR8rxtF/FJGiQZyAubnp2n4/2bDm4p0Y+Wut5T/1B1k1?= =?us-ascii?Q?qLBN3zaxIQJL098NMUdD/F8HUD34QyELfLWg3uBWeBW8DG9CAyygYExI6kbr?= =?us-ascii?Q?bs39UHt6qg/pzc/sDRUUgh/XtUA99K5pQlWa6k/Un4SaJK5k/SvJmDdVC418?= =?us-ascii?Q?qWwd2JUJGMykmU7YVvrc62nfH9AopHQQ0QR7N+wVjM2zd4YE2eFbnlcPr5uU?= =?us-ascii?Q?QuqtGBZs2xi1p7wLWEkemJB4ki3ct8eJPH4RdIY9uWxZQOgAhMakZMRXRe9V?= =?us-ascii?Q?pFW3Xt5gJhhYw7CLXQRHh52gQdP7tgGQ6BQgxZI+aq55A/8N8XI0nhtHRp4t?= =?us-ascii?Q?KOVpDsGVtdC54f1hOyWVX7laSp9ghnZP2rbI3qsYFWv8ouhdMJLU9wc4PR65?= =?us-ascii?Q?8qMETRMA7dEI4dMHFSBxRxvK+Z0eoF64rQTq6w3eUDed4AuvbM6KbbB0QMpG?= =?us-ascii?Q?Ea0asJQZn45a0zCTxBpqh+cV9O8vCkAcAPp7PuDqfQBIeawK9JCIBFZG0qjY?= =?us-ascii?Q?jbLz3rbgrX1hUsM+Cp8gBun0bP7Lj0b1rwEe6cAVD4fGdPTzxmVggw71+EBo?= =?us-ascii?Q?lIskWbtjTfzrK3qOocAhB4031mZMyL6m68GRZRsDucE+zxb0UvCDoWdrdisL?= =?us-ascii?Q?kvIZDFP2PSR/nqNcr7Lx2o2KAh/zQ3TUQkdCdUSgorJXZqJ42gPvx8ulcMKU?= =?us-ascii?Q?BrlISbJUJ4eN/GUKmem8JKkn7kv+xdjf3n/+ay3gZVasrS5iOyC/cHlWLx1I?= =?us-ascii?Q?oLIdZfReNemqDjloU9h6PJCLOsvBPzytOYQaVC9qx7H0w3D4uyl0t3t5v9B6?= =?us-ascii?Q?H3XqfEjDCN2KQ01WaT9ioArXoqq40r1H3M5PXvdYrnXnvnlOXuSna7eRtfP3?= =?us-ascii?Q?UZktFYLxA1ZVIOkD4A2R63IrcB6WjLdZY5YsG1ahLmZJStfrq1UFyowmjMYx?= =?us-ascii?Q?uNKIPXjHH6byhP68RlXk7wmLkjL8UY3JoyZC4EWltcn8dM0xJ5EalrPyob3T?= =?us-ascii?Q?Nlno/BVnBnJsFklMOixsRSnuQmuquEm//wyqT9Gi47TzLZiG1E4QkeXtcmop?= =?us-ascii?Q?6oN25QEmitb871nMdVGNK49HOmYh11310Xz5M4b42A0mI6KJPVEZ+7TQpQff?= =?us-ascii?Q?WB1fwL+88tdK81gwz0bqxFNDVjcP/uGVqvV9MN444OIUUH3vqJO54dXrfxeA?= =?us-ascii?Q?Q89I6mTBoMQ2vmpi57e7JB45NIjShtPwmbVGwTWU4eg2JgLzcbma4V8xosgg?= =?us-ascii?Q?+8K1QZRf4FPqrD7yECaNQ4qyDwrVZmwnyuHVwG2U3itY8ggOLeEY55NhKs3E?= =?us-ascii?Q?y2E=3D?= x-ms-exchange-transport-forked: True 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: DM8PR11MB5591.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b57c8636-1a61-4e8f-ca77-08d970fa7099 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Sep 2021 05:51:58.1772 (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: ysBpYk8D2UmEDTC5XC3LhX7SSAI5rqELAM2jVMDqEkOaMr/U7xWnTn27oz/rhTFaSdHvl042vK1yhPHPx/Nstg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5606 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline exit 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: Dmitry Kozlyuk > Sent: Wednesday, September 1, 2021 1:52 AM > To: Peng, ZhihongX > Cc: olivier.matz@6wind.com; dev@dpdk.org; stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] lib/cmdline: release cl when cmdline exit >=20 > 2021-08-31 10:28 (UTC+0800), zhihongx.peng@intel.com: > > From: Zhihong Peng > > > > Malloc cl in the cmdline_stdin_new function, so release in the > > cmdline_stdin_exit function is logical, so that cl will not be > > released alone. > > > > Fixes: af75078fece3 (first public release) > > Cc: stable@dpdk.org > > > > Signed-off-by: Zhihong Peng > > --- > > lib/cmdline/cmdline_socket.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/lib/cmdline/cmdline_socket.c > > b/lib/cmdline/cmdline_socket.c index 998e8ade25..ebd5343754 100644 > > --- a/lib/cmdline/cmdline_socket.c > > +++ b/lib/cmdline/cmdline_socket.c > > @@ -53,4 +53,5 @@ cmdline_stdin_exit(struct cmdline *cl) > > return; > > > > terminal_restore(cl); > > + cmdline_free(cl); > > } >=20 > Now cmdline_free() may not be called after cmdline_stdin_exit(). > User code that does so needs to be changed to avoid double-free. > This behavior change must be documented in the release notes. > I'm not sure it should be backported because of the above. Using the asan tool, I found that many dpdk apps did not call cmdline_free,= only one app called.