Skip to content

Fix (some) Vulkan renderer leaks

Kirill Primak requested to merge vyivel/wlroots:vulkan-leaks into master

backport for render/vulkan: fix texture clip region leak


There are also some thread-related(?) leaks this MR does not fix,


=================================================================
==1295264==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 128 byte(s) in 1 object(s) allocated from:
    #0 0x7f0e9f6d81e5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xd81e5) (BuildId: 2b657470ea196ba4342e3bd8a3cc138b1e200599)
    #1 0x7f0e89d4f483  (<unknown module>)
    #2 0x7f0e89d4fa22  (<unknown module>)
    #3 0x7f0e9e0b1b12 in __pthread_once_slow (/lib64/libc.so.6+0x93b12) (BuildId: 0d710e9d9dc10c500b8119c85da75004183618e2)
    #4 0x7f0e8a4f1a5e  (<unknown module>)
    #5 0x7f0e8a597026  (<unknown module>)
    #6 0x7f0e8a4f1d03  (<unknown module>)
    #7 0x7f0e89d037a1  (<unknown module>)
    #8 0x7f0e8a3917d6  (<unknown module>)
    #9 0x7f0e89d056b6  (<unknown module>)
    #10 0x7f0e89d0e144  (<unknown module>)
    #11 0x7f0e9fca12f0 in dri_screen_create_for_driver (/lib64/libgbm.so.1+0x52f0) (BuildId: 1c5a068c3232789be0a5636163eebc23bf2e5edf)
    #12 0x7f0e9fca1a47 in dri_device_create (/lib64/libgbm.so.1+0x5a47) (BuildId: 1c5a068c3232789be0a5636163eebc23bf2e5edf)
    #13 0x7f0e9fc9fc9b in find_backend (/lib64/libgbm.so.1+0x3c9b) (BuildId: 1c5a068c3232789be0a5636163eebc23bf2e5edf)
    #14 0x7f0e9fc9fded in gbm_create_device (/lib64/libgbm.so.1+0x3ded) (BuildId: 1c5a068c3232789be0a5636163eebc23bf2e5edf)
    #15 0x7f0e9ebd3928 in wlr_gbm_allocator_create ../render/allocator/gbm.c:205
    #16 0x7f0e9ebccf56 in allocator_autocreate_with_drm_fd ../render/allocator/allocator.c:110
    #17 0x7f0e9ebcd179 in wlr_allocator_autocreate ../render/allocator/allocator.c:157
    #18 0x40def2 in main ../tinywl/tinywl.c:931
    #19 0x7f0e9e046149 in __libc_start_call_main (/lib64/libc.so.6+0x28149) (BuildId: 0d710e9d9dc10c500b8119c85da75004183618e2)
    #20 0x7f0e9e04620a in __libc_start_main_impl (/lib64/libc.so.6+0x2820a) (BuildId: 0d710e9d9dc10c500b8119c85da75004183618e2)
    #21 0x4037e4 in _start (/home/kira/opt/gfx/wlroots/build/tinywl/tinywl+0x4037e4) (BuildId: 83229e7d5f027a174c61c24bf5bb8ba0f7df348c)

Direct leak of 128 byte(s) in 1 object(s) allocated from:
    #0 0x7f0e9f6d81e5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xd81e5) (BuildId: 2b657470ea196ba4342e3bd8a3cc138b1e200599)
    #1 0x7f0e98a4ada3  (<unknown module>)
    #2 0x7f0e98a4b342  (<unknown module>)
    #3 0x7f0e9e0b1b12 in __pthread_once_slow (/lib64/libc.so.6+0x93b12) (BuildId: 0d710e9d9dc10c500b8119c85da75004183618e2)
    #4 0x7f0e98a496ef  (<unknown module>)
    #5 0x7f0e98a6f3cb  (<unknown module>)
    #6 0x7f0e9e0ac896 in start_thread (/lib64/libc.so.6+0x8e896) (BuildId: 0d710e9d9dc10c500b8119c85da75004183618e2)

Direct leak of 128 byte(s) in 1 object(s) allocated from:
    #0 0x7f0e9f6d81e5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xd81e5) (BuildId: 2b657470ea196ba4342e3bd8a3cc138b1e200599)
    #1 0x7f0e8e911d53  (<unknown module>)
    #2 0x7f0e8e9122f2  (<unknown module>)
    #3 0x7f0e9e0b1b12 in __pthread_once_slow (/lib64/libc.so.6+0x93b12) (BuildId: 0d710e9d9dc10c500b8119c85da75004183618e2)
    #4 0x7f0e8ea7d43e  (<unknown module>)
    #5 0x7f0e8e85f648  (<unknown module>)
    #6 0x7f0e8e8cfb6c  (<unknown module>)
    #7 0x7f0e8e8cfad6  (<unknown module>)
    #8 0x7f0e8e8b3892  (<unknown module>)
    #9 0x7f0e8e8b4db7  (<unknown module>)
    #10 0x7f0e8e87b198  (<unknown module>)
    #11 0x7f0e8e87bd61  (<unknown module>)
    #12 0x7f0e9d8ed53d in setup_loader_term_phys_devs (/lib64/libvulkan.so.1+0x2753d) (BuildId: af0b60303b0b046be840496fba8bee587cdb4144)
    #13 0x7f0e9d8edc3c in terminator_EnumeratePhysicalDevices (/lib64/libvulkan.so.1+0x27c3c) (BuildId: af0b60303b0b046be840496fba8bee587cdb4144)
    #14 0x7f0e9c747aa4  (<unknown module>)
    #15 0x7f0e9d8f5b8c in vkEnumeratePhysicalDevices (/lib64/libvulkan.so.1+0x2fb8c) (BuildId: af0b60303b0b046be840496fba8bee587cdb4144)
    #16 0x7f0e9ebb9d6c in vulkan_find_drm_phdev ../render/vulkan/vulkan.c:263
    #17 0x7f0e9ebaa441 in wlr_vk_renderer_create_with_drm_fd ../render/vulkan/renderer.c:2467
    #18 0x7f0e9eb53a71 in renderer_autocreate ../render/wlr_renderer.c:249
    #19 0x7f0e9eb53ca5 in wlr_renderer_autocreate ../render/wlr_renderer.c:287
    #20 0x40ddc1 in main ../tinywl/tinywl.c:919
    #21 0x7f0e9e046149 in __libc_start_call_main (/lib64/libc.so.6+0x28149) (BuildId: 0d710e9d9dc10c500b8119c85da75004183618e2)
    #22 0x7f0e9e04620a in __libc_start_main_impl (/lib64/libc.so.6+0x2820a) (BuildId: 0d710e9d9dc10c500b8119c85da75004183618e2)
    #23 0x4037e4 in _start (/home/kira/opt/gfx/wlroots/build/tinywl/tinywl+0x4037e4) (BuildId: 83229e7d5f027a174c61c24bf5bb8ba0f7df348c)

Merge request reports