All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] testsuite/smokey: Fixing a registry leak of the posix_select test
@ 2021-08-12 16:38 Florian Bezdeka
  2021-08-13  6:59 ` Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Bezdeka @ 2021-08-12 16:38 UTC (permalink / raw)
  To: xenomai

According to POSIX message queues have kernel persistence, which means
they are not cleaned up until the next reboot.

The test has a mq_unlink() as "precondition", so it will clean up
failed test runs silently but /proc/xenomai/registry/usage will still
report a "leak" once the test has completed.

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
 testsuite/smokey/posix-select/posix-select.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testsuite/smokey/posix-select/posix-select.c b/testsuite/smokey/posix-select/posix-select.c
index e9bf938b3..0a59e4968 100644
--- a/testsuite/smokey/posix-select/posix-select.c
+++ b/testsuite/smokey/posix-select/posix-select.c
@@ -138,6 +138,8 @@ static int run_posix_select(struct smokey_test *t, int argc, char *const argv[])
 	usleep(300000);
 	smp_rmb();
 	ret = test_status;
+
+	mq_unlink("/select_test_mq");
 out:
 	pthread_join(tcb, NULL);
 	
-- 
2.30.2



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

* Re: [PATCH] testsuite/smokey: Fixing a registry leak of the posix_select test
  2021-08-12 16:38 [PATCH] testsuite/smokey: Fixing a registry leak of the posix_select test Florian Bezdeka
@ 2021-08-13  6:59 ` Jan Kiszka
  2021-08-13 13:03   ` Bezdeka, Florian
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2021-08-13  6:59 UTC (permalink / raw)
  To: Florian Bezdeka, xenomai

On 12.08.21 18:38, Florian Bezdeka wrote:
> According to POSIX message queues have kernel persistence, which means
> they are not cleaned up until the next reboot.
> 
> The test has a mq_unlink() as "precondition", so it will clean up
> failed test runs silently but /proc/xenomai/registry/usage will still
> report a "leak" once the test has completed.
> 
> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> ---
>  testsuite/smokey/posix-select/posix-select.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/testsuite/smokey/posix-select/posix-select.c b/testsuite/smokey/posix-select/posix-select.c
> index e9bf938b3..0a59e4968 100644
> --- a/testsuite/smokey/posix-select/posix-select.c
> +++ b/testsuite/smokey/posix-select/posix-select.c
> @@ -138,6 +138,8 @@ static int run_posix_select(struct smokey_test *t, int argc, char *const argv[])
>  	usleep(300000);
>  	smp_rmb();
>  	ret = test_status;
> +
> +	mq_unlink("/select_test_mq");
>  out:
>  	pthread_join(tcb, NULL);
>  	
> 

Why only cleaning up on successful runs, ie. why doing this before the
"out:" label?

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


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

* Re: [PATCH] testsuite/smokey: Fixing a registry leak of the posix_select test
  2021-08-13  6:59 ` Jan Kiszka
@ 2021-08-13 13:03   ` Bezdeka, Florian
  0 siblings, 0 replies; 3+ messages in thread
From: Bezdeka, Florian @ 2021-08-13 13:03 UTC (permalink / raw)
  To: xenomai, jan.kiszka

On Fri, 2021-08-13 at 08:59 +0200, Jan Kiszka wrote:
> On 12.08.21 18:38, Florian Bezdeka wrote:
> > According to POSIX message queues have kernel persistence, which means
> > they are not cleaned up until the next reboot.
> > 
> > The test has a mq_unlink() as "precondition", so it will clean up
> > failed test runs silently but /proc/xenomai/registry/usage will still
> > report a "leak" once the test has completed.
> > 
> > Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> > ---
> >  testsuite/smokey/posix-select/posix-select.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/testsuite/smokey/posix-select/posix-select.c b/testsuite/smokey/posix-select/posix-select.c
> > index e9bf938b3..0a59e4968 100644
> > --- a/testsuite/smokey/posix-select/posix-select.c
> > +++ b/testsuite/smokey/posix-select/posix-select.c
> > @@ -138,6 +138,8 @@ static int run_posix_select(struct smokey_test *t, int argc, char *const argv[])
> >  	usleep(300000);
> >  	smp_rmb();
> >  	ret = test_status;
> > +
> > +	mq_unlink("/select_test_mq");
> >  out:
> >  	pthread_join(tcb, NULL);
> >  	
> > 
> 
> Why only cleaning up on successful runs, ie. why doing this before the
> "out:" label?

You are right, that's wrong. And we should wait for the tcb thread to
finish as well. So kind of double fault. Testing v2...

Florian

> 
> Jan
> 


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

end of thread, other threads:[~2021-08-13 13:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 16:38 [PATCH] testsuite/smokey: Fixing a registry leak of the posix_select test Florian Bezdeka
2021-08-13  6:59 ` Jan Kiszka
2021-08-13 13:03   ` Bezdeka, Florian

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.