crash in Semaphore enqueuing test Topic is solved

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

crash in Semaphore enqueuing test  Topic is solved

Postby wild-boar » Sun Aug 15, 2021 3:10 pm

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: crash in Semaphore enqueuing test

Postby Giovanni » Mon Aug 16, 2021 7:36 am

Hi,

Fixed as bug #1172.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 21 guests