Skip to content

Conversation

@gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Jan 25, 2023

Backport of PR #19192

Contribution description

In syscalls_init() there is a call to malloc(), which will return NULL if the heap is not initialized before, causing the entire board to fail booting if module esp_idf_heap is used, for example if the WiFi network interface is used.

API of vTaskDelete() says, that if NULL is passed to vTaskDelete the calling task should be deleted.

This PR needs a backport to 2023.01.

Testing procedure

USEMODULE=esp_idf_heap BOARD=esp32-wroom-32 make -C tests/malloc

should work now but hangs in startup without the PR.

Issues/PRs references

Issue was introduced with PR #19146

In syscalls_init() there is a call to malloc(), which will return NULL if the heap is not initialized before, causing the entire board to fail booting if MODULE_ESP_IDF_HEAP is used.
@github-actions github-actions bot added Area: cpu Area: CPU/MCU ports Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Jan 25, 2023
@gschorcht gschorcht requested a review from benpicco January 25, 2023 13:32
@gschorcht gschorcht added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jan 25, 2023
@riot-ci
Copy link

riot-ci commented Jan 25, 2023

Murdock results

✔️ PASSED

14db253 cpu/esp_common/freertos: Handle NULL being passed to vTaskDelete

Success Failures Total Runtime
6770 0 6770 10m:09s

Artifacts

Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors merge

@bors
Copy link
Contributor

bors bot commented Jan 25, 2023

Build succeeded:

@bors bors bot merged commit 599e7fd into RIOT-OS:2023.01-branch Jan 25, 2023
@gschorcht gschorcht deleted the backport/2023.1/cpu/esp32_fix_boot_issue_wifi branch February 1, 2023 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants