Bug 58548

Summary: [swrast] SIGSEGV src/mesa/swrast/s_texfetch.c:100
Product: Mesa Reporter: Vinson Lee <vlee>
Component: OtherAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: medium CC: brianp
Version: gitKeywords: have-backtrace, regression
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2012-12-20 01:18:17 UTC
mesa: fddcc67f5cb41f70d1d11827eb9190a5caec13c5 (master)

Run piglit getteximage-formats on swrast.

$ ./bin/getteximage-formats -auto
Mesa warning: failed to remap index 167
Mesa warning: failed to remap index 207
Mesa warning: failed to remap index 208
Mesa warning: failed to remap index 211
Mesa warning: failed to remap index 377
Using test set: Core formats
Segmentation fault (core dumped)


(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007f66f1228668 in fetch_compressed (swImage=0x1fa53e0, i=0, j=0, k=0, texel=0x7f66efa74010) at ../../../src/mesa/swrast/s_texfetch.c:100
#2  0x00007f66f122b7d2 in sample_2d_nearest (ctx=0x1daeed0, samp=0x1fa4e94, img=0x1fa53e0, texcoord=0x7f66f01b0010, rgba=0x7f66efa74010) at ../../../src/mesa/swrast/s_texfilter.c:1137
#3  0x00007f66f122c3db in sample_nearest_2d (ctx=0x1daeed0, samp=0x1fa4e94, tObj=0x1fa4e60, n=127, texcoords=0x7f66f01b0010, lambda=0x7f66f0d24020, rgba=0x7f66efa74010)
    at ../../../src/mesa/swrast/s_texfilter.c:1369
#4  0x00007f66f121b782 in _swrast_texture_span (ctx=0x1daeed0, span=0x7fffe3150d70) at ../../../src/mesa/swrast/s_texcombine.c:762
#5  0x00007f66f12153dc in shade_texture_span (ctx=0x1daeed0, span=0x7fffe3150d70) at ../../../src/mesa/swrast/s_span.c:1028
#6  0x00007f66f1215d47 in _swrast_write_rgba_span (ctx=0x1daeed0, span=0x7fffe3150d70) at ../../../src/mesa/swrast/s_span.c:1261
#7  0x00007f66f12499d3 in general_triangle (ctx=0x1daeed0, v0=0x7f66efe75040, v1=0x7f66efe75348, v2=0x7f66efe75958) at ../../../src/mesa/swrast/s_tritemp.h:819
#8  0x00007f66f120166f in _swrast_validate_triangle (ctx=0x1daeed0, v0=0x7f66efe75040, v1=0x7f66efe75348, v2=0x7f66efe75958) at ../../../src/mesa/swrast/s_context.c:363
#9  0x00007f66f1201e16 in _swrast_Triangle (ctx=0x1daeed0, v0=0x7f66efe75040, v1=0x7f66efe75348, v2=0x7f66efe75958) at ../../../src/mesa/swrast/s_context.c:630
#10 0x00007f66f124e695 in triangle_rgba (ctx=0x1daeed0, e0=0, e1=1, e2=3) at ../../../src/mesa/swrast_setup/ss_tritmp.h:176
#11 0x00007f66f124e6c5 in quadfunc_rgba (ctx=0x1daeed0, v0=0, v1=1, v2=2, v3=3) at ../../../src/mesa/swrast_setup/ss_tritmp.h:232
#12 0x00007f66f11dbb13 in _tnl_render_quads_verts (ctx=0x1daeed0, start=0, count=4, flags=55) at ../../../src/mesa/tnl/t_vb_rendertmp.h:383
#13 0x00007f66f11ddc37 in run_render (ctx=0x1daeed0, stage=0x1e2cdb0) at ../../../src/mesa/tnl/t_vb_render.c:321
#14 0x00007f66f11cbb8a in _tnl_run_pipeline (ctx=0x1daeed0) at ../../../src/mesa/tnl/t_pipeline.c:163
#15 0x00007f66f11cd49c in _tnl_draw_prims (ctx=0x1daeed0, arrays=0x1e19cb0, prim=0x7fffe3152750, nr_prims=1, ib=0x0, min_index=0, max_index=3) at ../../../src/mesa/tnl/t_draw.c:525
#16 0x00007f66f11cd149 in _tnl_vbo_draw_prims (ctx=0x1daeed0, prim=0x7fffe3152750, nr_prims=1, ib=0x0, index_bounds_valid=1 '\001', min_index=0, max_index=3, tfb_vertcount=0x0)
    at ../../../src/mesa/tnl/t_draw.c:425
#17 0x00007f66f11a83f7 in vbo_draw_arrays (ctx=0x1daeed0, mode=7, start=0, count=4, numInstances=1, baseInstance=0) at ../../../src/mesa/vbo/vbo_exec_array.c:619
#18 0x00007f66f11a84d0 in vbo_exec_DrawArrays (mode=7, start=0, count=4) at ../../../src/mesa/vbo/vbo_exec_array.c:649
#19 0x00007f66f4be9106 in piglit_draw_rect_tex (x=10, y=40, w=128, h=128, tx=0, ty=0, tw=1, th=1) at piglit/tests/util/piglit-util-gl.c:951
#20 0x000000000040284f in test_format (test=0x405328, fmt=0x4038e0) at piglit/tests/texturing/getteximage-formats.c:356
#21 0x0000000000402c65 in test_all_formats () at piglit/tests/texturing/getteximage-formats.c:448
#22 0x0000000000402cc6 in piglit_display () at piglit/tests/texturing/getteximage-formats.c:467
#23 0x00007f66f4b87180 in display () at piglit/tests/util/piglit-framework-gl/piglit_glut_framework.c:60
#24 0x00007f66f433e137 in fghRedrawWindow (window=0x1daae60) at freeglut_main.c:210
#25 fghcbDisplayWindow (window=0x1daae60, enumerator=0x7fffe3192a00) at freeglut_main.c:227
#26 0x00007f66f4341889 in fgEnumWindows (enumCallback=0x7f66f433e0d0 <fghcbDisplayWindow>, enumerator=0x7fffe3192a00) at freeglut_structure.c:394
#27 0x00007f66f433e5fa in fghDisplayAll () at freeglut_main.c:249
#28 glutMainLoopEvent () at freeglut_main.c:1450
#29 0x00007f66f433ef05 in glutMainLoop () at freeglut_main.c:1498
---Type <return> to continue, or q <return> to quit---
#30 0x00007f66f4b87358 in run_test (gl_fw=0x7f66f4e507c0, argc=1, argv=0x7fffe3192dc8) at piglit/tests/util/piglit-framework-gl/piglit_glut_framework.c:127
#31 0x00007f66f4b8549e in piglit_gl_test_run (argc=1, argv=0x7fffe3192dc8, config=0x7fffe3192cb0) at piglit/tests/util/piglit-framework-gl.c:127
#32 0x0000000000401ba0 in main (argc=2, argv=0x7fffe3192dc8) at piglit/tests/texturing/getteximage-formats.c:46
(gdb) frame 1
#1  0x00007f66f1228668 in fetch_compressed (swImage=0x1fa53e0, i=0, j=0, k=0, texel=0x7f66efa74010) at ../../../src/mesa/swrast/s_texfetch.c:100
100	   swImage->FetchCompressedTexel(swImage->Map,
(gdb) l
95	 */
96	static void
97	fetch_compressed(const struct swrast_texture_image *swImage,
98	                 GLint i, GLint j, GLint k, GLfloat *texel)
99	{
100	   swImage->FetchCompressedTexel(swImage->Map,
101	                                 swImage->ImageOffsets,
102	                                 swImage->RowStride,
103	                                 i, j, k, texel);
104	}
(gdb) print swImage->FetchCompressedTexel
$1 = (compressed_fetch_func) 0
(gdb) print *swImage
$2 = {Base = {InternalFormat = 35912, _BaseFormat = 6407, TexFormat = MESA_FORMAT_SRGB_DXT1, Border = 0, Width = 128, Height = 128, Depth = 1, Width2 = 128, Height2 = 128, Depth2 = 1, WidthLog2 = 7, 
    HeightLog2 = 7, DepthLog2 = 0, MaxNumLevels = 8, TexObject = 0x1fa4e60, Level = 0, Face = 0}, _IsPowerOfTwo = 1 '\001', WidthScale = 128, HeightScale = 128, DepthScale = 1, RowStride = 128, 
  ImageOffsets = 0x20608d0, Map = 0x203b200 "0", Buffer = 0x203b200 "0", FetchTexel = 0x7f66f1228614 <fetch_compressed>, FetchCompressedTexel = 0}
Comment 1 Vinson Lee 2012-12-20 05:30:36 UTC
7dc36a50de516d95fc6edc58cf1ab5cd7129e95a is the first bad commit
commit 7dc36a50de516d95fc6edc58cf1ab5cd7129e95a
Author: Brian Paul <brianp@vmware.com>
Date:   Sat Dec 8 15:19:44 2012 -0700

    swrast: use new core Mesa compressed texel fetch functions

:040000 040000 0405f735572be3a6db5629481683197ad8e8d0a8 d7a74fc7a39f46c45fbe4f6d128237167947f37a M      src
bisect run success
Comment 2 Brian Paul 2012-12-21 20:47:13 UTC
Patch posted for review.  I don't know how I missed this.  I'm positive I ran that piglit test earlier.
Comment 3 Brian Paul 2012-12-27 03:20:41 UTC
Fixed by commit 7c35521295e647978ed8e7ab9f490ef70d672cd3

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.