I have occurrence of error using fifoObject api when I stress it a bit
where internal assert fails in chGuardedPoolAllocI (called by chFifoTakeObjectI) :
Code: Select all
chDbgAssert(chSemGetCounterI(&gmp->sem) >= (cnt_t)0, // ** gdb show that gmp->sem = -1 **
"semaphore out of sync");
To trigger the bug, I have
° a sender thread that does regular but slow pace take(TIME_INFINITE)
° ISR that does takeI->sendI at high rate (so most of the time takeI return null so no sendI are made)
° a receiver thread that receive(TIME_INFINITE) in infinite loop, but is speed limited by I/O
it seems that this condition trigger the bug :
°the sender thread is blocked on the take(TIME_INFINITE)
°the receiver thread return an object
°at the same time and ISR does a takeI
problem occurs in a C++ library, but I can write a small C program that exhibit behavior if it helps.
I have checked that it's not a stack overflow.
Alexandre