Alchemy API queue size issue

Merckx, Sebastiaan (Nokia - BE/Antwerp) sebastiaan.merckx at nokia.com
Tue Mar 17 11:26:39 CET 2020


Hello,

We noticed a bug in the alchemy API of xenomai library. The allocated memory for queues seemed too big.
I assume that below is the fix (and we are using the patch internally).
Let me know if you need more info or if this would not be correct.

Best Regards,
Sebastiaan Merckx

diff --git a/lib/alchemy/queue.c b/lib/alchemy/queue.c
--- a/lib/alchemy/queue.c
+++ b/lib/alchemy/queue.c
@@ -261,7 +261,7 @@ int rt_queue_create(RT_QUEUE *queue, con
                                   poolsize + (poolsize * 5 / 100));
        else
                ret = heapobj_init_array(&qcb->hobj, qcb->name,
-                                        (poolsize / qlimit) *
+                                        (poolsize / qlimit) +
                                         sizeof(struct alchemy_queue_msg),
                                         qlimit);
        if (ret)


More information about the Xenomai mailing list