crash in Semaphore enqueuing test Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
wild-boar
Posts: 17
Joined: Thu May 08, 2014 11:58 pm
Been thanked: 9 times

crash in Semaphore enqueuing test

Post by wild-boar »

I recently upgraded a project from 20.3.x to 21.6.x. The semaphore enqueuing test (7.2) consistently crashed when run with other code in my project. When I turned off CH_CFG_USE_SEMAPHORES_PRIORITY the problem went away. Looking at the code, I suspect this patch is the problem. With this patch, the test now passes.

Code: Select all

diff --git a/os/rt/src/chsem.c b/os/rt/src/chsem.c
index 51073fe89..7fae1779b 100644
--- a/os/rt/src/chsem.c
+++ b/os/rt/src/chsem.c
@@ -76,7 +76,7 @@
 /*===========================================================================*/
 
 #if CH_CFG_USE_SEMAPHORES_PRIORITY == TRUE
-#define sem_insert(qp, tp) ch_sch_prio_insert(&tp->hdr.queue, qp)
+#define sem_insert(qp, tp) ch_sch_prio_insert(qp, &tp->hdr.queue)
 #else
 #define sem_insert(qp, tp) ch_queue_insert(qp, &tp->hdr.queue)
 #endif


Thanks!
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: crash in Semaphore enqueuing test

Post by Giovanni »

Hi,

Fixed as bug #1172.

Giovanni
Post Reply