Skip to content

libweston/renderer-gl/gl-renderer.c: use glDeleteTextures() if num_textures is decrased

Andreas Heynig requested to merge ahe/weston:ensure-less into main

This patch resolves the following problem:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==21652==ERROR: AddressSanitizer: FPE on unknown address 0x7f3e325c0644 (pc 0x7f3e325c0644 bp 0x7ffdb5e6d250 sp 0x7ffdb5e6d150 T0)
    #0 0x7f3e325c0643 in gl_renderer_flush_damage ../libweston/renderer-gl/gl-renderer.c:1625
    #1 0x7f3e352b0ff9 in surface_flush_damage ../libweston/compositor.c:2406
    #2 0x7f3e352b9df0 in compositor_accumulate_damage ../libweston/compositor.c:2478
    #3 0x7f3e352be89b in weston_output_repaint ../libweston/compositor.c:2716
    #4 0x7f3e352c6774 in weston_output_maybe_repaint ../libweston/compositor.c:2798
    #5 0x7f3e352c69c2 in output_repaint_timer_handler ../libweston/compositor.c:2865
    #6 0x7f3e352353da in wl_event_source_timer_dispatch src/event-loop.c:236
    #7 0x7f3e35236643 in wl_event_loop_dispatch src/event-loop.c:641
    #8 0x7f3e35233544 in wl_display_run src/wayland-server.c:1293
    #9 0x7f3e35876297 in wet_main ../compositor/main.c:3361
    #10 0x40113a in main ../compositor/executable.c:33
    #11 0x7f3e356c0b8d in __libc_start_main (/nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libc.so.6+0x22b8d)
    #12 0x401089 in _start (/mnt/Lokale_Daten/ahe/meetwise/mdi2/git_nix/playground/bin/weston+0x401089)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE ../libweston/renderer-gl/gl-renderer.c:1625 in gl_renderer_flush_damage
==21652==ABORTING
terminate called after throwing an instance of 'std::system_error'
  what():  wl_display_read_events failed: Broken pipe

gs->num_textures seems to have incorrect (too large) value.

It occurs when

  • A planar YUV444 buffer was attached to a surface
  • Subsequently, a packed RGB buffer is attached to the same surface

Merge request reports

Loading