[go: nahoru, domu]

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

feat(sdl_render): support all draw task types #6437

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

Conversation

kisvegabor
Copy link
Member
@kisvegabor kisvegabor commented Jun 27, 2024

Fixes #6410,

Description of the feature or fix

I'm working on adding support to all draw task types, but I'm facing a cache related issue. The current code crashes in lv_example_buttonmatrix_1() if this line is enabled:

==34516==ERROR: AddressSanitizer: heap-use-after-free on address 0x60600001e100 at pc 0x559d6a5c9864 bp 0x7ffeda3e96c0 sp 0x7ffeda3e96b0
READ of size 4 at 0x60600001e100 thread T0
    #0 0x559d6a5c9863 in lv_cache_entry_get_ref ../lvgl/src/misc/cache/lv_cache_entry.c:71
    #1 0x559d6a5c79f8 in get_victim_cb ../lvgl/src/misc/cache/_lv_cache_lru_rb.c:420
    #2 0x559d6a5c91df in cache_evict_one_internal_no_lock ../lvgl/src/misc/cache/lv_cache.c:319
    #3 0x559d6a5c9414 in cache_add_internal_no_lock ../lvgl/src/misc/cache/lv_cache.c:342
    #4 0x559d6a5c86ea in lv_cache_acquire_or_create ../lvgl/src/misc/cache/lv_cache.c:173
    #5 0x559d6a7dd55f in draw_from_cached_texture ../lvgl/src/draw/sdl/lv_draw_sdl.c:406
    #6 0x559d6a7de33e in execute_drawing ../lvgl/src/draw/sdl/lv_draw_sdl.c:479

I'd like to immediately drop the cache in some case. In this case with text_local = 1 the label_draw_dsc->text will be freed later, so we cannot keep a reference to it in the draw_dsc saved in the cache..

Other thing: In sdl_texture_cache_compare_cb I'd like to compare text of the label draw dsc-s with strcmp and not by pointer value. Can I simply return return strcmp_res > 0 ? 1 : -1;?

cc @W-Mai

Notes

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.

Draw arc not working if LV_DRAW_SDL is enabled.
1 participant