mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-20 06:58:16 +02:00
We've wanted to remove destructors from ralloc's API for a long time (it's
an extra storage cost per ralloc for a rarely-used feature), and for the
suballoc change we'd need to spend more storage on storing the tu_device
pointer per result since destructors don't get anything else but the
pointer passed into them.
Fixes use-after-frees:
=================================================================
==2383==ERROR: AddressSanitizer: heap-use-after-free on address 0xffff88fe1940 at pc 0xffff934f427c bp 0xfffff5481e90 sp 0xfffff5481ea8
WRITE of size 8 at 0xffff88fe1940 thread T0
#0 0xffff934f4278 in list_del ../src/util/list.h:108
#1 0xffff934f4278 in result_destructor ../src/freedreno/vulkan/tu_autotune.c:237
#2 0xffff9377793c in unsafe_free ../src/util/ralloc.c:300
#3 0xffff9377793c in ralloc_free ../src/util/ralloc.c:265
#4 0xffff934f4368 in history_destructor ../src/freedreno/vulkan/tu_autotune.c:229
#5 0xffff9377793c in unsafe_free ../src/util/ralloc.c:300
#6 0xffff9377793c in ralloc_free ../src/util/ralloc.c:265
#7 0xffff934f5990 in tu_autotune_on_submit ../src/freedreno/vulkan/tu_autotune.c:442
[...]
0xffff88fe1940 is located 80 bytes inside of 112-byte region [0xffff88fe18f0,0xffff88fe1960)
freed by thread T0 here:
#0 0xffff9c1c90d8 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127
#1 0xffff934f4368 in history_destructor ../src/freedreno/vulkan/tu_autotune.c:229
#2 0xffff9377793c in unsafe_free ../src/util/ralloc.c:300
#3 0xffff9377793c in ralloc_free ../src/util/ralloc.c:265
#4 0xffff934f5990 in tu_autotune_on_submit ../src/freedreno/vulkan/tu_autotune.c:442
#5 0xffff935cf2ac in tu_queue_submit_locked ../src/freedreno/vulkan/tu_drm.c:997
[...]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15038>
|
||
|---|---|---|
| .. | ||
| deqp-freedreno-a307.toml | ||
| deqp-freedreno-a530.toml | ||
| deqp-freedreno-a618-vk-full.toml | ||
| deqp-freedreno-a618-vk.toml | ||
| deqp-freedreno-a630-vk-asan.toml | ||
| deqp-freedreno-a630-vk-full.toml | ||
| deqp-freedreno-a630-vk.toml | ||
| deqp-freedreno-a630.toml | ||
| freedreno-a307-fails.txt | ||
| freedreno-a307-flakes.txt | ||
| freedreno-a307-skips.txt | ||
| freedreno-a420-fails.txt | ||
| freedreno-a420-flakes.txt | ||
| freedreno-a420-skips.txt | ||
| freedreno-a530-fails.txt | ||
| freedreno-a530-flakes.txt | ||
| freedreno-a530-skips.txt | ||
| freedreno-a618-fails.txt | ||
| freedreno-a618-flakes.txt | ||
| freedreno-a618-premerge-skips.txt | ||
| freedreno-a618-skips.txt | ||
| freedreno-a630-asan-fails.txt | ||
| freedreno-a630-asan-skips.txt | ||
| freedreno-a630-bypass-flakes.txt | ||
| freedreno-a630-fails.txt | ||
| freedreno-a630-flakes.txt | ||
| freedreno-a630-premerge-skips.txt | ||
| freedreno-a630-skips.txt | ||
| freedreno-a630-skqp-gl_rendertests.txt | ||
| freedreno-a630-skqp_unittests.txt | ||
| gitlab-ci.yml | ||
| restricted-traces-freedreno.yml | ||
| traces-freedreno.yml | ||