[Mesa-dev] [PATCH 18/20] mesa: Rewrite the way uniforms are tracked and handled

Vadim Girlin vadimgirlin at gmail.com
Tue Nov 8 10:45:27 PST 2011


Hi, 

Not sure if it's directly related to this patch, but I got memory
corruption with 32-bit Lightsmark, bisected to corresponding commit.
I'm attaching related part of the valgrind log.

Vadim
-------------- next part --------------
==2800== Invalid write of size 4
==2800==    at 0x4D7C510: memcpy (mc_replace_strmem.c:643)
==2800==    by 0x8EE132A: _mesa_propagate_uniforms_to_driver_storage (uniform_query.cpp:422)
==2800==    by 0x8EE1A92: _mesa_uniform (uniform_query.cpp:677)
==2800==    by 0x8FB73A0: _mesa_Uniform4fARB (uniforms.c:165)
==2800==    by 0x807EA9B: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x3FEFFFFF: ???
==2800==  Address 0xc1a9150 is 96 bytes inside a block of size 128 free'd
==2800==    at 0x4D79EED: free (vg_replace_malloc.c:366)
==2800==    by 0x8E1E039: _mesa_align_free (imports.c:181)
==2800==    by 0x8E1E0E3: _mesa_align_realloc (imports.c:208)
==2800==    by 0x8ECF212: _mesa_add_parameter (prog_parameter.c:132)
==2800==    by 0x8ECFA97: _mesa_add_state_reference (prog_parameter.c:412)
==2800==    by 0x8F02C63: emit_wpos_adjustment(st_translate*, gl_program const*, unsigned char, float, float*) (st_glsl_to_tgsi.cpp:4370)
==2800==    by 0x8F03611: emit_wpos(st_context*, st_translate*, gl_program const*, ureg_program*) (st_glsl_to_tgsi.cpp:4529)
==2800==    by 0x8F03AF2: st_translate_program (st_glsl_to_tgsi.cpp:4637)
==2800==    by 0x8EB73FA: st_translate_fragment_program (st_program.c:653)
==2800==    by 0x8EB7616: st_get_fp_variant (st_program.c:728)
==2800==    by 0x8FF4AF2: update_fp (st_atom_shader.c:86)
==2800==    by 0x8FF006A: st_validate_state (st_atom.c:177)
==2800==    by 0x8EB11AE: st_draw_vbo (st_draw.c:933)
==2800==    by 0x8FEF511: vbo_save_playback_vertex_list (vbo_save_draw.c:293)
==2800==    by 0x8DD9325: ext_opcode_execute (dlist.c:601)
==2800==    by 0x8DF301B: execute_list (dlist.c:7467)
==2800==    by 0x8DF9715: _mesa_CallList (dlist.c:8884)
==2800==    by 0x805B391: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x805320A: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x8056862: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x8056A01: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x8056C05: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x805A2D1: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x4F533C2: ??? (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x4F56DC6: fgEnumWindows (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x4F5386D: glutMainLoopEvent (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x4F54103: glutMainLoop (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x8057C08: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0xFEEE9043: ???
==2800== 
==2800== Invalid write of size 4
==2800==    at 0x4D7C510: memcpy (mc_replace_strmem.c:643)
==2800==    by 0x8EE132A: _mesa_propagate_uniforms_to_driver_storage (uniform_query.cpp:422)
==2800==    by 0x8EE1A92: _mesa_uniform (uniform_query.cpp:677)
==2800==    by 0x8FB72DA: _mesa_Uniform3fARB (uniforms.c:152)
==2800==    by 0x807EE89: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x3FEFFFFF: ???
==2800==  Address 0xc1a9130 is 64 bytes inside a block of size 128 free'd
==2800==    at 0x4D79EED: free (vg_replace_malloc.c:366)
==2800==    by 0x8E1E039: _mesa_align_free (imports.c:181)
==2800==    by 0x8E1E0E3: _mesa_align_realloc (imports.c:208)
==2800==    by 0x8ECF212: _mesa_add_parameter (prog_parameter.c:132)
==2800==    by 0x8ECFA97: _mesa_add_state_reference (prog_parameter.c:412)
==2800==    by 0x8F02C63: emit_wpos_adjustment(st_translate*, gl_program const*, unsigned char, float, float*) (st_glsl_to_tgsi.cpp:4370)
==2800==    by 0x8F03611: emit_wpos(st_context*, st_translate*, gl_program const*, ureg_program*) (st_glsl_to_tgsi.cpp:4529)
==2800==    by 0x8F03AF2: st_translate_program (st_glsl_to_tgsi.cpp:4637)
==2800==    by 0x8EB73FA: st_translate_fragment_program (st_program.c:653)
==2800==    by 0x8EB7616: st_get_fp_variant (st_program.c:728)
==2800==    by 0x8FF4AF2: update_fp (st_atom_shader.c:86)
==2800==    by 0x8FF006A: st_validate_state (st_atom.c:177)
==2800==    by 0x8EB11AE: st_draw_vbo (st_draw.c:933)
==2800==    by 0x8FEF511: vbo_save_playback_vertex_list (vbo_save_draw.c:293)
==2800==    by 0x8DD9325: ext_opcode_execute (dlist.c:601)
==2800==    by 0x8DF301B: execute_list (dlist.c:7467)
==2800==    by 0x8DF9715: _mesa_CallList (dlist.c:8884)
==2800==    by 0x805B391: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x805320A: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x8056862: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x8056A01: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x8056C05: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x805A2D1: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x4F533C2: ??? (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x4F56DC6: fgEnumWindows (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x4F5386D: glutMainLoopEvent (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x4F54103: glutMainLoop (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x8057C08: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0xFEEE9043: ???
==2800== 
==2800== Invalid write of size 4
==2800==    at 0x4D7C510: memcpy (mc_replace_strmem.c:643)
==2800==    by 0x8EE132A: _mesa_propagate_uniforms_to_driver_storage (uniform_query.cpp:422)
==2800==    by 0x8EE1A92: _mesa_uniform (uniform_query.cpp:677)
==2800==    by 0x8FB78EE: _mesa_Uniform4fvARB (uniforms.c:233)
==2800==    by 0x807ED4B: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x3FEFFFFF: ???
==2800==  Address 0xc1a90f0 is 0 bytes inside a block of size 128 free'd
==2800==    at 0x4D79EED: free (vg_replace_malloc.c:366)
==2800==    by 0x8E1E039: _mesa_align_free (imports.c:181)
==2800==    by 0x8E1E0E3: _mesa_align_realloc (imports.c:208)
==2800==    by 0x8ECF212: _mesa_add_parameter (prog_parameter.c:132)
==2800==    by 0x8ECFA97: _mesa_add_state_reference (prog_parameter.c:412)
==2800==    by 0x8F02C63: emit_wpos_adjustment(st_translate*, gl_program const*, unsigned char, float, float*) (st_glsl_to_tgsi.cpp:4370)
==2800==    by 0x8F03611: emit_wpos(st_context*, st_translate*, gl_program const*, ureg_program*) (st_glsl_to_tgsi.cpp:4529)
==2800==    by 0x8F03AF2: st_translate_program (st_glsl_to_tgsi.cpp:4637)
==2800==    by 0x8EB73FA: st_translate_fragment_program (st_program.c:653)
==2800==    by 0x8EB7616: st_get_fp_variant (st_program.c:728)
==2800==    by 0x8FF4AF2: update_fp (st_atom_shader.c:86)
==2800==    by 0x8FF006A: st_validate_state (st_atom.c:177)
==2800==    by 0x8EB11AE: st_draw_vbo (st_draw.c:933)
==2800==    by 0x8FEF511: vbo_save_playback_vertex_list (vbo_save_draw.c:293)
==2800==    by 0x8DD9325: ext_opcode_execute (dlist.c:601)
==2800==    by 0x8DF301B: execute_list (dlist.c:7467)
==2800==    by 0x8DF9715: _mesa_CallList (dlist.c:8884)
==2800==    by 0x805B391: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x805320A: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x8056862: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x8056A01: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x8056C05: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x805A2D1: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0x4F533C2: ??? (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x4F56DC6: fgEnumWindows (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x4F5386D: glutMainLoopEvent (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x4F54103: glutMainLoop (in /usr/lib/libglut.so.3.9.0)
==2800==    by 0x8057C08: ??? (in /home/vg/Lightsmark2008.2.0/bin/pc-linux32/backend)
==2800==    by 0xFEEE9043: ???



More information about the mesa-dev mailing list