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 42BE4A0546; Sat, 1 May 2021 22:00:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D968440140; Sat, 1 May 2021 22:00:48 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 609894013F for ; Sat, 1 May 2021 22:00:47 +0200 (CEST) IronPort-SDR: kZNG8G7dv2QIZluTaWIkmbrtx3vP4u1srEHh1v+cMODXL1h7miHGVN168SKTE5NyJ0oVyXGNA+ 30L6mC3g5r0A== X-IronPort-AV: E=McAfee;i="6200,9189,9971"; a="177675540" X-IronPort-AV: E=Sophos;i="5.82,266,1613462400"; d="scan'208";a="177675540" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 May 2021 13:00:46 -0700 IronPort-SDR: vcbqPLZvN5Ik6OV01UBCr+1Li3icFFpatJPfYzEYMfaM/qf+tU3qFMAx/OmvxvHoFCAYUvk/oM oNN6qc8ltj+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,266,1613462400"; d="scan'208";a="456590420" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 01 May 2021 13:00:46 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sat, 1 May 2021 13:00:45 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Sat, 1 May 2021 13:00:45 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) 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.2106.2; Sat, 1 May 2021 13:00:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AuyGqI/LgFYhNdocy4vsmoVKAw/9zYVxujPGmWZNtzUWg93sokGuQPmnhmPp38O0uT3cH+ZHifFr8ue0q7Q6mRy3BSud4TQVwzF67v9xY5s+ThtCl/s49CRruLiovYYxOOpN74gma55Yeatm5H0uvfsVlp0eFbI7bD4f290EXOJPuWZL9TY4hoj4JgxvhOzL9yvl9qVHLlcMhkt9CiufPXu4TBrP9MGS4Q4hAK+YyqmEZmCkZCwA3O7Hla0s4sz3sNlGH6/Qcv/DZVyB47Zw8VA3RW/KLM4BZ/1w48bRUBA18GrS8UTDAkgzWemhVPMrW1eVa4dq7Oat5GOSRmuxHw== 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-SenderADCheck; bh=chvLteNtNM1EkN2ImqQ8Cvc07hSSViANbFku/O8dAPs=; b=UIqqAXIwHiOlo+twlWcaWzn9teHRDyP0OEJYTXq8s4fun2SwJjms1CiI5bx6FAd4DIVwUg45Sm8kBCyQARGoLGLpVe0AyDo0i1XInzB+9bbXkaJyU9rUo6AvMfp6eGJMGc3vk5srqCX/fNWvBfwd64ZNO2RIBKjpPGrYQ6YqXT5T+cZfG3LjJqXEHix5f4D1W4VdkcXf4CAiiQoJFhFmQLOjaq8an8ID0AJn6t1ncRnaOV/ZWNjLgiqsW/EwfXY0wDaJc0bOYF3NIVRdpmcaQRs26qVVBc0h8pHuL7ewAJ2SfbZ608gaeLzrvOeWsCZLrCPpV0gyRh96XclH9jExaA== 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=chvLteNtNM1EkN2ImqQ8Cvc07hSSViANbFku/O8dAPs=; b=o8a1Pz5Z8yxNzXZhtQ/4H+QCbLZxt3qhcpythO/3EugYH0FHr+lFxxU+1NEgb4Zotsni07eE38Ms/vQVVA+huMYDSk40p8ud+PX/Hufnd2kkvt2B39J5zwPSh+rF+gq4xbTn9DbJFIkS4+MJQQPks2UwaLL2PgFyQeHFSbCvbe0= Received: from SA2PR11MB5196.namprd11.prod.outlook.com (2603:10b6:806:119::18) by SN6PR11MB2703.namprd11.prod.outlook.com (2603:10b6:805:59::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.26; Sat, 1 May 2021 20:00:42 +0000 Received: from SA2PR11MB5196.namprd11.prod.outlook.com ([fe80::e5ae:2c7e:c1b4:c0ae]) by SA2PR11MB5196.namprd11.prod.outlook.com ([fe80::e5ae:2c7e:c1b4:c0ae%7]) with mapi id 15.20.4065.027; Sat, 1 May 2021 20:00:42 +0000 From: "Carrillo, Erik G" To: "Min Hu (Connor)" , "dev@dpdk.org" CC: "Yigit, Ferruh" , "rsanford@akamai.com" Thread-Topic: [PATCH] test/timer: fix memzone reserve failure check Thread-Index: AQHXN1iDIXZzOM2qBkmHJbMPtM6UmKrPGLzg Date: Sat, 1 May 2021 20:00:42 +0000 Message-ID: References: <1619083120-57343-1-git-send-email-humin29@huawei.com> In-Reply-To: <1619083120-57343-1-git-send-email-humin29@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [136.49.192.164] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 961a64ae-dd9e-4402-0366-08d90cdbccbc x-ms-traffictypediagnostic: SN6PR11MB2703: 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:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: y/UpL+eHJACxrjKyo4NhRZ84my4yJk6EclR6RR6y661vfMgXjDgswJE1tDOj4oGFz+BKCjvmjoNd74/SlAbO+oYDQqjt1MICoyS7Bzr23FBWMq39oIbwtuD7+JvVKOVhXlNZPWGNyBsFEkMf85AnTwo6pWc2vmHYZBnb5aWC4Rae35/5xDu7mHUNsQVDmf5ZZMkN/v6yGNWmVzBMY3Hh/CkTzSPjlrbBp9Uy5OPGMZAYp2Ffww5DcZZbNuB1sfWMkTAXDKO6qyu4gd+TY9NW8q1rkEZYLWsjR+zK9eu+5+HZR5oyc9Ul0U0cIYIzwb/5aanzsJGTzwhEvZcq2KE3O2dwiGLdSBczPrA1BjrFhABIuMtooduwu5YcoXpAQzADuxN4e0gv3w/xTKpbjV+0MJx8ixH82Z9iu51huxtxw6l9q7hUrO1CASrce04xB0a2xiLRtZALRnPJ5q8MlFyjpeOenkUi0zMKFV4NFdAiF+Y4PKw67vaTD0RpcqGpTw5dPreSbkNZ0zE5Fw5W/HD0RwIbDHFlC70gGiQJBXzerxPfxoS4BrOPiAv2vyx7dGjwgpoWsiXNbc8gKh17lVE+kQD/urRl8mIxUyc36/NfesI= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR11MB5196.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(366004)(396003)(376002)(136003)(39860400002)(53546011)(38100700002)(316002)(122000001)(8936002)(76116006)(54906003)(6506007)(83380400001)(7696005)(66446008)(66556008)(66476007)(64756008)(110136005)(55016002)(2906002)(26005)(186003)(4326008)(478600001)(71200400001)(86362001)(8676002)(52536014)(33656002)(5660300002)(9686003)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?W00KlIpEcCoDYnNguGkw70ttKd7D6kI0OzUSGFrWazwxf9s/IhLUJYMGkRNZ?= =?us-ascii?Q?IM+A53THD3xrlz6yFbJCVrNP3iEkiTzGCV19kpdlK8gAHcZPEtcAsYXJb/0r?= =?us-ascii?Q?YcxV+eDskzuOm1FAdkKHgERWG/Su39Be5ZXrm18Dm56XrUbY5fXXlAlJy8Im?= =?us-ascii?Q?9ZJMrkNLnzNRgsq1yNupfb8om5702SEpHFkaRNxwzVkqqc+VprWeOzj7EMJa?= =?us-ascii?Q?h5NLdfsnHT2/Lj2OX7SIzoex74g+9eJz4XDLaHdfdIP1y+g1NNHxdVtQUkIk?= =?us-ascii?Q?p1FcChIzQfQhjh+drNjsm7MhKBbtu3NsYmJp3PPLNotWxeoNoi/rf3U9nurg?= =?us-ascii?Q?IOnOqd9YTC12cV21ifdnV3OSZQAgfw7OjIqSIbj1jA2A45Cz5CGCRhad8FU3?= =?us-ascii?Q?HFTXOCcv0/0D/KFRQSHbUUlzt/STOG1HOjR9L5fwoB8LX1lC4ypc2p7DD15V?= =?us-ascii?Q?Wrjxj8mJoAYP23BWZs2P3u+laI3oo2Hm/rI7xZVs/gtMSC0MBNZDc8euJ3XQ?= =?us-ascii?Q?tWTtsvj57OyTi/iON/2l6HbiuhDj1ZHivKlvMKu7CtNo7ZRHxvWWgzFHR+pQ?= =?us-ascii?Q?gr/ilQ1woCF2hhDoF9445vMb7ADiqrm9P1KKfyTBDrp1aRanJ4wPddH4Yo25?= =?us-ascii?Q?K9Oq4sc4JzLHhR93oThG/rAPzvcPVSW15F7e9Jf1AYiFN5JwZWI4BY0k1I4I?= =?us-ascii?Q?5CZvncCGcE8w+Qvbkf825EhswdXeGAvwTP3pqMH0F50r8BhugrJr0fzk5O0a?= =?us-ascii?Q?uMm1TuGggp8ck8VeoVa+pdjJbQPPsMCU7bwz0ApuV0FwZ6LF8JsywvMxZKC7?= =?us-ascii?Q?bT8qdEU93kvSUltgC+9Y12DsCCUNIwi4/TML64Ehr84A55YajmL2VQGrtjh9?= =?us-ascii?Q?qZPbdNEZ/IV9omTFI35uwgs06F7qF8C67SgO396miXXQ20/fvvDhTRlTUobO?= =?us-ascii?Q?wC/6bI29sxD1nDnFla8ULiYzVwy+fCy40xZ/S2bMN1Dgn1gwWbtVy+/mv65t?= =?us-ascii?Q?H3OHxXxNG2yC1hbfxgO1FAeWRtKClUPUoI5AR7A0cS1mFs2ERjDlkaokWA3b?= =?us-ascii?Q?6b9YTMu23n4iVDyAPAPmSRiNhjq4QQSudlNSWcRcs0YShVmrFYS/OgAGIP6b?= =?us-ascii?Q?crukrt0KO2cO0bZa1lM9RnpSQEDAzav5OiulUZsC0C5MCxKRJQyC1VY78ol6?= =?us-ascii?Q?NLkC+A8MyIWrWu7bEGeB57LkSqti60uKZrWtllnV9MZ+v/KVs/jDP2lUOSvy?= =?us-ascii?Q?gOOELaQINpt4doJnebqosSFfbKbSW1xvK5rNSJj+81J00aTBN6xok+Qx2Uuf?= =?us-ascii?Q?rrhPd84X2KOWDcXW0D/piVO+?= 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: SA2PR11MB5196.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 961a64ae-dd9e-4402-0366-08d90cdbccbc X-MS-Exchange-CrossTenant-originalarrivaltime: 01 May 2021 20:00:42.1183 (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: 9MvjMaqNDFdqgY3rfJR9N8TSYTrmbzYcpcQx1VymJWgO5uXLeZV/11ZfZQYFk5ClssMFjX4HCJ5OxyQcYtU3S4pwdJqY8n3odn9CgRVNG9I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2703 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] test/timer: fix memzone reserve failure check 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: Min Hu (Connor) > Sent: Thursday, April 22, 2021 4:19 AM > To: dev@dpdk.org > Cc: Yigit, Ferruh ; rsanford@akamai.com; Carrillo= , > Erik G > Subject: [PATCH] test/timer: fix memzone reserve failure check >=20 > Segmentation fault may occur without checking if memzone reserves > succeed or not. >=20 > This patch fixed it. >=20 > Fixes: 50247fe03fe0 ("test/timer: exercise new APIs in secondary process"= ) > Cc: stable@dpdk.org >=20 > Signed-off-by: Min Hu (Connor) > --- > app/test/test_timer_secondary.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/app/test/test_timer_secondary.c > b/app/test/test_timer_secondary.c index 1e8f1d4..281f5bd 100644 > --- a/app/test/test_timer_secondary.c > +++ b/app/test/test_timer_secondary.c > @@ -125,6 +125,11 @@ test_timer_secondary(void) >=20 > mz =3D rte_memzone_reserve(TEST_INFO_MZ_NAME, > sizeof(*test_info), > SOCKET_ID_ANY, 0); > + if (mz =3D=3D NULL) { > + printf("Failed to reserve memzone\n"); > + return TEST_SKIPPED; > + } > + > test_info =3D mz->addr; > TEST_ASSERT_NOT_NULL(test_info, "Couldn't allocate > memory for " > "test data"); I think the TEST_ASSERT_NOT_NULL check here should be the area we update --= instead of checking the test_info pointer, we should check "mz", and that = will address the issue you have noted. We can then move the "test_info =3D= mz->addr" assignment below the assert. > @@ -171,6 +176,11 @@ test_timer_secondary(void) > int i; >=20 > mz =3D rte_memzone_lookup(TEST_INFO_MZ_NAME); > + if (mz =3D=3D NULL) { > + printf("Failed to lookup memzone\n"); > + return TEST_SKIPPED; > + } > + > test_info =3D mz->addr; > TEST_ASSERT_NOT_NULL(test_info, "Couldn't lookup > memzone for " > "test info"); Same thing here -- we can update the TEST_ASSERT_NOT_NULL call here instead= , and move it above the "test_info =3D mz->addr" assignment. Thanks, Erik > -- > 2.7.4