radv: fix REPLAYED shader arena blocks not being marked as holes on free

Because free_list is always NULL for REPLAYED arenas, freed blocks were
never passed to add_hole() and freelist.prev was still NULL. So,
adjacent blocks were never merged together and that caused a memleak
with unreachable blocks.

This fixes a memleak detected by ASAN in
dEQP-VK.ray_tracing_pipeline.pipeline_library.configurations.singlethreaded_compilation.s0_l11_check_capture_replay_handles
and similar tests.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42012>
This commit is contained in:
Samuel Pitoiset 2026-06-04 10:07:45 +02:00 committed by Marge Bot
parent 44290e1899
commit d72d4666ba

View file

@ -1398,6 +1398,9 @@ radv_free_shader_memory(struct radv_device *device, union radv_shader_arena_bloc
free(arena);
} else if (free_list) {
add_hole(free_list, hole);
} else {
/* Mark it as a hole, allowing merges when adjacent blocks are freed later. */
list_inithead(&hole->freelist);
}
mtx_unlock(&device->shader_arena_mutex);