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(lvgl_port_disp): rgb panel callback bad ctx param (BSP-582) #439

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liamHowatt
Copy link

ESP-BSP Pull Request checklist

Note: For new BSPs create a PR with this link.

  • Version of modified component bumped
  • CI passing

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 a user_ctx which is &disp_ctx->disp_drv which is lv_display_t ** when the function expects it to be lv_display_t *. A hardfault happens at the dereference here:

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:

  1. clone https://github.com/lvgl/lv_port_espressif_esp32-s3-lcd-ev-board
  2. 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

@CLAassistant
Copy link

CLAassistant commented Nov 22, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot changed the title fix(lvgl_port_disp): context pointer bug fix(lvgl_port_disp): context pointer bug (BSP-581) Nov 22, 2024
@github-actions github-actions bot changed the title fix(lvgl_port_disp): context pointer bug (BSP-581) fix(lvgl_port_disp): context pointer bug (BSP-582) Nov 22, 2024
@DamienEspitallier
Copy link

I have the same issue and was working on a PR at the same time ! (DamienEspitallier@8b186fa)

Please note that this also affect lvgl8

@liamHowatt
Copy link
Author

Thanks for the Info! Updated!

@liamHowatt liamHowatt changed the title fix(lvgl_port_disp): context pointer bug (BSP-582) fix(lvgl_port_disp): rgb panel callback bad ctx param (BSP-582) Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants