All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] v4l2-compliance: Kill child after failed streamoff test blocks
@ 2020-06-12 14:11 Paul Elder
  2020-06-12 14:26 ` Paul Elder
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Elder @ 2020-06-12 14:11 UTC (permalink / raw)
  To: linux-media; +Cc: Paul Elder, hverkuil, laurent.pinchart

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 <paul.elder@ideasonboard.com>
---
 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)) {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] v4l2-compliance: Kill child after failed streamoff test blocks
  2020-06-12 14:11 [PATCH] v4l2-compliance: Kill child after failed streamoff test blocks Paul Elder
@ 2020-06-12 14:26 ` Paul Elder
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Elder @ 2020-06-12 14:26 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil, laurent.pinchart

On Fri, Jun 12, 2020 at 11:11:07PM +0900, Paul Elder wrote:
> 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.

As we just discussed on irc, I'll convert this test to pthreads, so this
patch can be disregarded.


Thanks,

Paul

> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> ---
>  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)) {
> -- 
> 2.27.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-12 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 14:11 [PATCH] v4l2-compliance: Kill child after failed streamoff test blocks Paul Elder
2020-06-12 14:26 ` Paul Elder

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.