Problem with readyPendingList

skreyer wrote on Thursday, March 21, 2019:

Hi,

when xTaskResumeAll is called, I get a problem with the following code:

while( listLIST_IS_EMPTY( &xPendingReadyList ) == pdFALSE )
{
pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
( void ) uxListRemove( &( pxTCB->xEventListItem ) );
( void ) uxListRemove( &( pxTCB->xStateListItem ) );
pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) );

The problem is that xPendingReadyList->xListEnd->pxNext->pvOwner at this point in time has the value 1 => my application crashes.

Now my question is, is it normal that the pvOwner member of a tasklist item can have a value of 1?Because I noticed that somehow it contain an arbitrary type of object? And if yes what could lead to a condition that at the point of time the above code gets executed, there is a wrong listitem in the readypendinglist?

Any hints on this issue are very appreciated. If you need more info please let me know.

Thanks in advance,
Steve

rtel wrote on Thursday, March 21, 2019:

This sounds like you have a simple memory corruption. First place to
start is here: https://www.freertos.org/FAQHelp.html noting in
particular the comments about having configASSERT() defined (which will
be much more effective if you are using one of the last few FreeRTOS
releases), the comments about interrupt priorities, and stack overflow.
FreeRTOS can catch all these things for you.

skreyer wrote on Thursday, March 21, 2019:

Hi Richard,

thanks for your answer. Ok I see, yeah all of these macros I have enabled. The overwrite unfortunnatly just hits me without them beeing called or something. Iam using freertos version 10.1.1. is this recent enough for these improved exception catches you have mentioned?

Thanks for you help.
Steve