chVTSetI infinite loop
Posted: Wed May 08, 2013 2:15 am
I am not yet sure how I got there, but my app gets into an infinite loop inside chVTSetI.
So, I have a piece of code
(actually, there is a parameter check time != TIME_IMMEDIATE anyway)
and sometimes my code was hanging. Debugger showed an infinite loop inside chVTSetI, I have added an asserting an it did fail!
putput:
I use 2.4.3 and I have some DBG checks enabled:
CH_DBG_ENABLE_ASSERTS=1
CH_DBG_ENABLE_CHECKS=1
CH_DBG_SYSTEM_STATE_CHECK=1
CH_DBG_ENABLE_STACK_CHECK=1
Would this be considered a bug in ChibiOS that I can get in such a state? Any hints on how I could have broken the internal constraint?
So, I have a piece of code
Code: Select all
if (offset == 0) {
xxx;
return;
}
chSysLockFromIsr();
chVTSetI(&signal->signalTimer, offset, &outCallback, signal);
chSysUnlockFromIsr();
}
(actually, there is a parameter check time != TIME_IMMEDIATE anyway)
and sometimes my code was hanging. Debugger showed an infinite loop inside chVTSetI, I have added an asserting an it did fail!
Code: Select all
while (p->vt_time < time) {
int isOk = p->vt_time!=0 || p!=p->vt_next;
chDbgCheck(isOk, "timer constraint");
if(!isOk)
break;
time -= p->vt_time;
p = p->vt_next;
}
putput:
Code: Select all
FATAL "timer constraint"()
I use 2.4.3 and I have some DBG checks enabled:
CH_DBG_ENABLE_ASSERTS=1
CH_DBG_ENABLE_CHECKS=1
CH_DBG_SYSTEM_STATE_CHECK=1
CH_DBG_ENABLE_STACK_CHECK=1
Would this be considered a bug in ChibiOS that I can get in such a state? Any hints on how I could have broken the internal constraint?