On 12.08.21 14:39, Bezdeka, Florian (T RDA IOT SES-DE) wrote:
> Hi all,
> 
> I just noticed that the posix_select test of smokey is leaking one
> registry element:
> 
> $ cat /proc/xenomai/registry/usage
> 8/512
> 
> $ <path>/smokey --run=posix_select
> posix_select OK
> 
> $ cat /proc/xenomai/registry/usage
> 9/512
> 
> The following diff would fix that, but I assume the resource cleanup
> should happen on process/task exit anyway. For some reason it does not.
> Any ideas where to look at? Where (code location) should the cleanup
> take place?
> 
> 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);
> 

The change is likely correct. I'm now wondering if we are cleaning up a
process-shared resource here that the core may not be able to simply
destroy when the creator terminates. Needs to be checked if that is the
case or if we are truly leaking via the kernel as well.

Jan

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

Reply via email to