Merge branch 'bugfix/uninitialized_tasknumber' into 'master'

fix(FreeRTOS): Initialize uxTaskNumber at task initialization

Closes IDFGH-1815

See merge request espressif/esp-idf!14620
This commit is contained in:
Mahavir Jain
2021-08-04 12:12:08 +00:00

View File

@@ -917,6 +917,13 @@ UBaseType_t x;
} }
#endif /* tskSET_NEW_STACKS_TO_KNOWN_VALUE */ #endif /* tskSET_NEW_STACKS_TO_KNOWN_VALUE */
#if( configUSE_TRACE_FACILITY == 1 )
{
/* Zero the uxTaskNumber TCB member to avoid random value from dynamically allocated TCBs */
pxNewTCB->uxTaskNumber = 0;
}
#endif /* ( configUSE_TRACE_FACILITY == 1 ) */
/* Calculate the top of stack address. This depends on whether the stack /* Calculate the top of stack address. This depends on whether the stack
grows from high memory to low (as per the 80x86) or vice versa. grows from high memory to low (as per the 80x86) or vice versa.
portSTACK_GROWTH is used to make the result positive or negative as required portSTACK_GROWTH is used to make the result positive or negative as required