Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3552018pxj; Mon, 21 Jun 2021 00:59:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+6bbLJoSoTEuyaJSF20Oc6nIcCSEkpuAkz2fO9WpQHrNCyL4XGInAT2moliFRB2xznKTc X-Received: by 2002:a05:6402:51d1:: with SMTP id r17mr19708546edd.91.1624262386814; Mon, 21 Jun 2021 00:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624262386; cv=none; d=google.com; s=arc-20160816; b=vQKH2ZoPnqK33ove9WGeGU7NxYHkwqT10km/wfEwvLvJMXBvL1546oed/6etFDi8r3 RyHNImfLozmcZeoYHYQAFp69/DJHyL3AWJax1czP7zmy9tsNOiwbM1Jg2Q8Dq/NmcYSR tt1iOjAOV3zimSNK5RUnOhxdoDUxmqe7CbuWJiso/xDud8vatxNihPjbSXnzolEJdgQy tUKf5I158ThJdDiPOANZq3lcZ1a4IKeMhlU2O4xOnfOXg1UyIF07NyBhRR5Lar3tpu98 lNZ+N1Pj+3igFTsdMeqEBZ0TJK18Ct5n48Q6oO2emyr+ZzobAKTeWbgqAG0vNzUoqWHC yK+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=UY792cC/d7d1DMgD9iBuiHu/NOwzgk7RurwH5JgZgcM=; b=nO/aFt5w19CDeLG/8P/BJPmCw8fiZjifXxrxz5kEP6UsgwKvpw8kijyxWlhM1CZoKr gK7ZU5sQzNThquywzOYQWOtS4o8QPvCte/LZjocUfzgqplJlr2V0llmYzU5p4u/4Q4iH ZCqKI6MaVwJjZNwl9fPgqqr0iHcLV+41/7cr0SbrlRbhXfvRl4pmBjPWADVz5Ji/Mltf 5STO+BURpBuZvU5sWj71Hc1KzZVplvORUKaZm3qkcNkvcJ9oAJgZMYrwI4/rCAp9HNuf xGzlfXLnm5O4GNuC21Fo1VkGi7iV/BSDkrETqDtZ6aa9pCt4/lYFRD8ANMzmdmqsXp59 n8hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=VTKTklKT; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=VTKTklKT; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd28si9686390ejc.701.2021.06.21.00.59.14; Mon, 21 Jun 2021 00:59:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=VTKTklKT; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=VTKTklKT; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229641AbhFUIB1 (ORCPT + 99 others); Mon, 21 Jun 2021 04:01:27 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:40352 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbhFUIBZ (ORCPT ); Mon, 21 Jun 2021 04:01:25 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C901B1FD2A; Mon, 21 Jun 2021 07:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1624262350; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UY792cC/d7d1DMgD9iBuiHu/NOwzgk7RurwH5JgZgcM=; b=VTKTklKTSO/kHlZ3Ffq2YKEc9DJ982asc2Jim/iDgMZMnR1atVr8xhE9NbrlHA+pSek1p5 try5zvcDJbiNm23EmFzIcRfGE9ht0nHTbyzs2M0EnsSW8t/JEALdch7hqXTGNGEU2Bzpua dY1OP4o8Y1JKqP7k2y+Yq1QjD0NtEMc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1624262350; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UY792cC/d7d1DMgD9iBuiHu/NOwzgk7RurwH5JgZgcM=; b=jNnna9nKpEjZvP/qijcMn7mHCWm89sMb9iQkVNz/8fmh4B5qSY8s7qYJHb3Vo9F62Mkqg3 o6CF5j4dNcxrNYAw== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 92708118DD; Mon, 21 Jun 2021 07:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1624262350; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UY792cC/d7d1DMgD9iBuiHu/NOwzgk7RurwH5JgZgcM=; b=VTKTklKTSO/kHlZ3Ffq2YKEc9DJ982asc2Jim/iDgMZMnR1atVr8xhE9NbrlHA+pSek1p5 try5zvcDJbiNm23EmFzIcRfGE9ht0nHTbyzs2M0EnsSW8t/JEALdch7hqXTGNGEU2Bzpua dY1OP4o8Y1JKqP7k2y+Yq1QjD0NtEMc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1624262350; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UY792cC/d7d1DMgD9iBuiHu/NOwzgk7RurwH5JgZgcM=; b=jNnna9nKpEjZvP/qijcMn7mHCWm89sMb9iQkVNz/8fmh4B5qSY8s7qYJHb3Vo9F62Mkqg3 o6CF5j4dNcxrNYAw== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id ykQHIs5G0GDfFgAALh3uQQ (envelope-from ); Mon, 21 Jun 2021 07:59:10 +0000 Date: Mon, 21 Jun 2021 09:59:09 +0200 From: Petr Vorel To: dongshijiang Cc: ltp@lists.linux.it, Alexey Kodanev , Steve Dickson , libtirpc-devel@lists.sourceforge.net, linux-nfs@vger.kernel.org Subject: Re: [LTP] [PATCH] fix rpc_suite/rpc:add check returned value Message-ID: Reply-To: Petr Vorel References: <20210617070806.174220-1-dongshijiang@inspur.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210617070806.174220-1-dongshijiang@inspur.com> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi all, [Cc libtirpc ML and Steve] > "Segmentation fault (core dumped)" due to the failure of svcfd_create during the rpc test, so you need to check the return value of the "svcfd_create" function I'm not sure what is the value of TI-RPC tests. IMHO really messy code does not in the end cover much of libtirpc functionality. That's why I'm thinking to propose deleting whole testcases/network/rpc/rpc-tirpc/. libtirpc is being used in nfs-utils, thus it'd deserve to have some testing, but IMHO this should be libtirpc. I'm not planning to dive into the technology to understand it enough be able to written the tests from scratch and I'm not aware of anybody else planning it. > Signed-off-by: dongshijiang > --- > .../rpc/rpc_createdestroy_svc_destroy/rpc_svc_destroy.c | 5 +++++ > .../rpc_createdestroy_svc_destroy/rpc_svc_destroy_stress.c | 5 +++++ > .../rpc/rpc_regunreg_xprt_register/rpc_xprt_register.c | 5 +++++ > .../rpc/rpc_regunreg_xprt_unregister/rpc_xprt_unregister.c | 5 +++++ > 4 files changed, 20 insertions(+) > diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svc_destroy/rpc_svc_destroy.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svc_destroy/rpc_svc_destroy.c > index 60b96cec3..3557c0068 100644 > --- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svc_destroy/rpc_svc_destroy.c > +++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svc_destroy/rpc_svc_destroy.c > @@ -46,6 +46,11 @@ int main(void) > //First of all, create a server > svcr = svcfd_create(fd, 0, 0); > + > + //check returned value > + if ((SVCXPRT *) svcr == NULL) { > + return test_status; > + } > //Then call destroy macro > svc_destroy(svcr); > diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svc_destroy/rpc_svc_destroy_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svc_destroy/rpc_svc_destroy_stress.c > index ecd145393..5a4331f4d 100644 > --- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svc_destroy/rpc_svc_destroy_stress.c > +++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svc_destroy/rpc_svc_destroy_stress.c > @@ -55,6 +55,11 @@ int main(int argn, char *argc[]) > //First of all, create a server > for (i = 0; i < nbCall; i++) { > svcr = svcfd_create(fd, 0, 0); > + > + //check returned value > + if ((SVCXPRT *) svcr == NULL) > + continue; > + svcr = NULL; man svc_destroy(3) states that it deallocates private data structures, including xprt itself. Kind regards, Petr > //Then call destroy macro > svc_destroy(svcr); > diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_register/rpc_xprt_register.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_register/rpc_xprt_register.c > index da3b93022..de4df15f1 100644 > --- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_register/rpc_xprt_register.c > +++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_register/rpc_xprt_register.c > @@ -48,6 +48,11 @@ int main(void) > //create a server > svcr = svcfd_create(fd, 1024, 1024); > + > + //check returned value > + if ((SVCXPRT *) svcr == NULL) { > + return test_status; > + } > //call routine > xprt_register(svcr); > diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_unregister/rpc_xprt_unregister.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_unregister/rpc_xprt_unregister.c > index d0b7a20d4..fbaec25ad 100644 > --- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_unregister/rpc_xprt_unregister.c > +++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_unregister/rpc_xprt_unregister.c > @@ -52,6 +52,11 @@ int main(int argn, char *argc[]) > //create a server > svcr = svcfd_create(fd, 1024, 1024); > + > + //check returned value > + if ((SVCXPRT *) svcr == NULL) { > + return test_status; > + } > xprt_register(svcr); > //call routine