fix(lvgl_port_disp): rgb panel callback bad ctx param (BSP-582) #439
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ESP-BSP Pull Request checklist
Change description
Fix a crash when using https://github.com/lvgl/lv_port_espressif_esp32-s3-lcd-ev-board with ESP IDF >= v5.1.2. Versions of ESP IDF older than v5.1.2 are not effected by the bug because the dependencies are solved in such a way that the file
components/esp_lvgl_port/src/lvgl9/esp_lvgl_port_disp.c
(where the issue is) is not compiled.The issue occurs when the callback
lvgl_port_flush_rgb_vsync_ready_callback
receives auser_ctx
which is&disp_ctx->disp_drv
which islv_display_t **
when the function expects it to belv_display_t *
. A hardfault happens at the dereference here:esp-bsp/components/esp_lvgl_port/src/lvgl9/esp_lvgl_port_disp.c
Line 424 in 4bbe669
The hardfault could also happen 3 lines earlier inside
lv_display_get_user_data
if the struct layout aliasing lottery plays out that way.Reproduce by:
idf.py flash monitor
A boot loop will occur with a crash at the line I linked.
Specific board:
Mainboard "ESP32-S3-LCD_Ev_Board_MB_V1.0" with the sub-board "ESP32-S3-LCD_Ev_Board_SUB3_V1.0"
cc @espzav