bsder wrote on Thursday, November 05, 2015:
I’m trying to hunt down a really pernicious bug, and could use a little advice.
I’m running on a PIC32MX on FreeRTOS 8.2.3 (problem exists in 8.0.1 which is what I was originally using but I upgraded just in case), and I’m seeing an assert fire when I plug in my USB–but only in release mode. If I’m in debug mode, everything works just dandy. I had to rig up special code to shove debug info out a port that I could actually probe while in full release mode.
This is really infuriating. Now, that kind of behavior screams “smasher” (stack/heap/runaway variable init). I am hitting a configASSERT( uxTopReadyPriority );
My questions:
- What is that ASSERT checking?
- What does failing that ASSERT mean?
- What in the world could cause that ASSERT to fire?
Any advice is appreciated.
Thanks,
-a
The code that is tripping is this from tasks.c:
#define taskSELECT_HIGHEST_PRIORITY_TASK() \
{ \
/* Find the highest priority queue that contains ready tasks. */ \
while( listLIST_IS_EMPTY( &( pxReadyTasksLists[ uxTopReadyPriority ] ) ) ) \
{ \
configASSERT( uxTopReadyPriority ); \
--uxTopReadyPriority; \
} \
\
/* listGET_OWNER_OF_NEXT_ENTRY indexes through the list, so the tasks of \
the same priority get an equal share of the processor time. */ \
listGET_OWNER_OF_NEXT_ENTRY( pxCurrentTCB, &( pxReadyTasksLists[ uxTopReadyPriority ] ) ); \
} /* taskSELECT_HIGHEST_PRIORITY_TASK */