mesa/src
Dave Airlie b88468f15c radv: return binary code_size not variant code size to cache
The code sizes return here get passed to the cache shader insert function,
which then memcpy from the code ptr, and causes all sorts of valgrind
errors like:
==6755== Invalid read of size 8
==6755==    at 0x4C32FEE: memcpy@GLIBC_2.2.5 (vg_replace_strmem.c:1021)
==6755==    by 0x2305D4C7: radv_pipeline_cache_insert_shaders (radv_pipeline_cache.c:416)
==6755==    by 0x2305791D: radv_create_shaders (radv_pipeline.c:2158)
==6755==    by 0x2305C523: radv_pipeline_init (radv_pipeline.c:3404)
==6755==    by 0x2305C890: radv_graphics_pipeline_create (radv_pipeline.c:3515)
==6755==    by 0x230188AB: radv_device_init_meta_blit_color (radv_meta_blit.c:871)
==6755==    by 0x2301D50E: radv_device_init_meta_blit_state (radv_meta_blit.c:1278)
==6755==    by 0x23011893: radv_device_init_meta (radv_meta.c:352)
==6755==    by 0x2300744B: radv_CreateDevice (radv_device.c:1576)
==6755==    by 0x5187D0F: ??? (in /usr/lib64/libvulkan.so.1.1.77)
==6755==    by 0x518F6A3: ??? (in /usr/lib64/libvulkan.so.1.1.77)
==6755==    by 0x5192A42: vkCreateDevice (in /usr/lib64/libvulkan.so.1.1.77)
==6755==  Address 0x22a58548 is 4 bytes after a block of size 116 alloc'd
==6755==    at 0x4C2EBAB: malloc (vg_replace_malloc.c:299)
==6755==    by 0x23089DC4: ac_elf_read (ac_binary.c:144)
==6755==    by 0x23090A60: ac_compile_module_to_binary (ac_llvm_helper.cpp:162)
==6755==    by 0x23053F06: compile_to_memory_buffer (radv_llvm_helper.cpp:58)
==6755==    by 0x23053F06: radv_compile_to_binary (radv_llvm_helper.cpp:98)
==6755==    by 0x23052769: ac_llvm_compile (radv_nir_to_llvm.c:3394)
==6755==    by 0x23052823: ac_compile_llvm_module (radv_nir_to_llvm.c:3418)
==6755==    by 0x23053C05: radv_compile_nir_shader (radv_nir_to_llvm.c:3542)
==6755==    by 0x23061B4E: shader_variant_create (radv_shader.c:580)
==6755==    by 0x23061CFD: radv_shader_variant_create (radv_shader.c:634)
==6755==    by 0x23057765: radv_create_shaders (radv_pipeline.c:2123)
==6755==    by 0x2305C523: radv_pipeline_init (radv_pipeline.c:3404)
==6755==    by 0x2305C890: radv_graphics_pipeline_create (radv_pipeline.c:3515)

Since we are just inserting the code into the cache, we can avoid these
bad reads and data in the cache by just using the binary code size here.

Fixes: 939e5a382 (radv: add padding for the UMR disassembler)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2018-07-28 06:20:20 +10:00
..
amd radv: return binary code_size not variant code size to cache 2018-07-28 06:20:20 +10:00
broadcom v3d: Drop the VG support from the XML. 2018-07-27 12:56:36 -07:00
compiler glsl: use only copy_propagation_elements 2018-07-27 10:51:25 -07:00
egl egl: Fix missing clamping in eglSetDamageRegionKHR 2018-07-24 14:46:21 +01:00
gallium v3d: Drop the use of the semaphores. 2018-07-27 12:56:36 -07:00
gbm meson: Remove various completed todos 2018-06-13 10:07:03 -07:00
getopt
glx glx: Don't allow glXMakeContextCurrent() with only one valid drawable 2018-07-09 12:03:18 -04:00
gtest autotools: include meson build files in tarball 2018-01-19 16:30:51 -08:00
hgl meson: Add Haiku platform support v4 2018-02-16 16:56:34 -06:00
intel i965/icl: Disable binding table prefetching 2018-07-27 11:05:04 -07:00
loader dri3: Stricter SBC wraparound handling 2018-05-22 17:59:53 +02:00
mapi mesa: GL_MESA_framebuffer_flip_y extension [v4] 2018-07-27 12:32:25 -07:00
mesa i965: implement GL_MESA_framebuffer_flip_y [v3] 2018-07-27 12:33:32 -07:00
util python: Better check for keys in dicts 2018-07-24 11:07:04 -07:00
vulkan vulkan/wsi: fix incorrect assignment in assert() 2018-07-25 20:55:35 +01:00
git_sha1.h.in
Makefile.am egl: rewire the build systems to use libwayland-egl 2018-06-06 12:11:57 -07:00
meson.build meson: only build mesa_st tests when build-tests is true 2018-04-24 14:08:15 -07:00
SConscript