Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FreeRTOS): Initialize uxTaskNumber at task initialization (IDFGH-1815) #4025

Conversation

GautierAtWork
Copy link
Contributor

uxTaskNumber member of struct tskTaskControlBlock is not initialized at thread creation.
As the TCB can be dynamically allocated, uxTaskNumber might then get a value from the heap.
As a result, the user might get a seems-valid value when calling uxTaskGetTaskNumber() and then take wrong decisions.

This fix zeroes uxTaskNumber when the task is initialized.

@Alvin1Zhang
Copy link
Collaborator

@GautierAtWork Thanks for the contribution, we will look into this PR. Thanks.

@github-actions github-actions bot changed the title fix(FreeRTOS): Initialize uxTaskNumber at task initialization fix(FreeRTOS): Initialize uxTaskNumber at task initialization (IDFGH-1815) Sep 5, 2019
@CLAassistant
Copy link

CLA assistant check
All committers have signed the CLA.

0xFEEDC0DE64 pushed a commit to 0xFEEDC0DE64/esp-idf that referenced this pull request May 5, 2021
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally labels Aug 4, 2021
espressif-bot pushed a commit that referenced this pull request Oct 12, 2021
Signed-off-by: Laukik Hase <laukik.hase@espressif.com>

Closes #4025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants