From patchwork Fri Jun 12 14:11:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 64477 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1jjkLH-009ve2-PQ; Fri, 12 Jun 2020 14:07:36 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726453AbgFLOLg (ORCPT + 1 other); Fri, 12 Jun 2020 10:11:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726449AbgFLOLf (ORCPT ); Fri, 12 Jun 2020 10:11:35 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6177BC03E96F for ; Fri, 12 Jun 2020 07:11:35 -0700 (PDT) Received: from jade.flets-east.jp (unknown [IPv6:2400:4051:61:600:b09c:6559:5445:7c98]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9215524F; Fri, 12 Jun 2020 16:11:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1591971091; bh=A0wo2yVIKVCYRdr8z3MFmtSJsX7sKzG4wyuAVO7BbkE=; h=From:To:Cc:Subject:Date:From; b=oZp+wqEAtRWpwiVw2kPVtSQDnm5UK0wLmFVezWBh8aB/hmeF5xoYtOPHfkm63x9FT 799qGAf8kL7ApiRtE1yPwGKkJD5Ns5dSyMfStxA3urJ4T/ohMZDBWvGQYKwcr2fw+K MCupiejva9oF/wK0aW7twcxMOP6/G5Xa6HLHD29A= From: Paul Elder To: linux-media@vger.kernel.org Cc: Paul Elder , hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com Subject: [PATCH] v4l2-compliance: Kill child after failed streamoff test blocks Date: Fri, 12 Jun 2020 23:11:07 +0900 Message-Id: <20200612141107.43344-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no The test to test that a forked child process can do VIDIOC_STREAMOFF without being blocked does not kill the child in the event of a failure (ie. the child process blocks on VIDIOC_STREAMOFF). This causes the video device node to still be in use even after v4l2-compliance completes execution. Kill the child process after this test fails. Signed-off-by: Paul Elder --- utils/v4l2-compliance/v4l2-test-buffers.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index fc49fff6..896e8e14 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -2282,6 +2282,8 @@ static int testBlockingDQBuf(struct node *node, cv4l_queue &q) usleep(250000); pid = waitpid(pid_streamoff, &wstatus_streamoff, WNOHANG); kill(pid_dqbuf, SIGKILL); + if (pid != pid_streamoff) + kill(pid_streamoff, SIGKILL); fail_on_test(pid != pid_streamoff); /* Test that the second child exited properly */ if (!pid || !WIFEXITED(wstatus_streamoff)) {