All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cobalt: Fix resource leak of cobalt_monitor
@ 2022-01-17 16:53 Florian Bezdeka
  2022-01-20  8:12 ` Philippe Gerum
  2022-02-15  8:23 ` Jan Kiszka
  0 siblings, 2 replies; 5+ messages in thread
From: Florian Bezdeka @ 2022-01-17 16:53 UTC (permalink / raw)
  To: xenomai

We have a test within the smokey testsuite which actually does
something like

   cobalt_monitor_init()
   cobalt_monitor_wait()
       cobalt_monitor_enter()
         -> timeout
       cobalt_monitor_exit()
   cobalt_monitor_destroy()

If the posix_mutex tests were run right after this scenario the mutex
tests failed. The wrong mutex state was caused by the monitor in the
previous test not being cleaned up properly.

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---

I'm not 100% sure about this fix. Maybe we should move it into
cobalt_monitor_reclaim, maybe I'm using the monitor in a wrong way
inside the y2038 tests. Everything is possible...

@Philippe: It would be very nice if you could have a look as well.
Thanks!

I triggered a CI run on all of our supported platforms. Looks good so far and
the testsuite does no longer fail in the compat case as well. The compat tests
were manually run. 64 bit kernel but 32 bit userland.


 kernel/cobalt/posix/monitor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cobalt/posix/monitor.c b/kernel/cobalt/posix/monitor.c
index 91396955c..c266b8b3b 100644
--- a/kernel/cobalt/posix/monitor.c
+++ b/kernel/cobalt/posix/monitor.c
@@ -425,6 +425,7 @@ COBALT_SYSCALL(monitor_destroy, primary,
 		goto fail;
 	}
 
+	xnsynch_release(&mon->gate, curr);
 	cobalt_monitor_reclaim(&mon->resnode, s); /* drops lock */
 
 	xnsched_run();
-- 
2.30.2



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

end of thread, other threads:[~2022-02-15  8:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-17 16:53 [PATCH] cobalt: Fix resource leak of cobalt_monitor Florian Bezdeka
2022-01-20  8:12 ` Philippe Gerum
2022-01-20 11:35   ` Bezdeka, Florian
2022-01-22 18:16     ` Philippe Gerum
2022-02-15  8:23 ` Jan Kiszka

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.