Bug 41433 - [swrast] SIGSEGV swrast/s_texfetch_tmp.h:558
Summary: [swrast] SIGSEGV swrast/s_texfetch_tmp.h:558
Status: CLOSED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: medium critical
Assignee: Eric Anholt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-03 15:13 UTC by Vinson Lee
Modified: 2011-10-04 09:44 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2011-10-03 15:13:26 UTC
mesa: 669f1822d2a60865514faf37f9fde21e4567b3d2 (master)

Run piglit point-sprite on swrast.

$ ./bin/point-sprite -auto
Maximum point size is 60.000000, using 60.000000
Segmentation fault (core dumped)

(gdb) bt
#0  0x00601757 in fetch_texel_2d_f_rgba8888 (texImage=0x99d3310, i=0, j=1, k=0, texel=0x0) at swrast/s_texfetch_tmp.h:558
#1  0x0060d9a1 in sample_2d_nearest (ctx=0x97f5be8, tObj=0x99d30e0, img=0x99d3310, texcoord=0xb6ee9008, rgba=0x0) at swrast/s_texfilter.c:1085
#2  0x0060e5ba in sample_nearest_2d (ctx=0x97f5be8, tObj=0x99d30e0, n=60, texcoords=0xb6ee9008, lambda=0xb765d010, rgba=0x0) at swrast/s_texfilter.c:1311
#3  0x005fd34b in _swrast_texture_span (ctx=0x97f5be8, span=0xbfe42754) at swrast/s_texcombine.c:751
#4  0x005f6722 in shade_texture_span (ctx=0x97f5be8, span=0xbfe42754) at swrast/s_span.c:1018
#5  0x005f6ce0 in _swrast_write_rgba_span (ctx=0x97f5be8, span=0xbfe42754) at swrast/s_span.c:1163
#6  0x005f231e in sprite_point (ctx=0x97f5be8, vert=0xb6c6a020) at swrast/s_points.c:231
#7  0x005e9abe in _swrast_validate_point (ctx=0x97f5be8, v0=0xb6c6a020) at swrast/s_context.c:400
#8  0x005ea0c3 in _swrast_Point (ctx=0x97f5be8, v0=0xb6c6a020) at swrast/s_context.c:647
#9  0x0062ff31 in swsetup_points (ctx=0x97f5be8, first=0, last=1) at swrast_setup/ss_triangle.c:227
#10 0x005aec98 in _tnl_render_points_verts (ctx=0x97f5be8, start=0, count=1, flags=48) at tnl/t_vb_rendertmp.h:69
#11 0x005b187f in run_render (ctx=0x97f5be8, stage=0x9865b28) at tnl/t_vb_render.c:321
#12 0x005a2859 in _tnl_run_pipeline (ctx=0x97f5be8) at tnl/t_pipeline.c:163
#13 0x005a3d32 in _tnl_draw_prims (ctx=0x97f5be8, arrays=0x9853a04, prim=0x9852358, nr_prims=1, ib=0x0, min_index=0, max_index=0) at tnl/t_draw.c:538
#14 0x005a3a46 in _tnl_vbo_draw_prims (ctx=0x97f5be8, arrays=0x9853a04, prim=0x9852358, nr_prims=1, ib=0x0, index_bounds_valid=1 '\001', min_index=0, max_index=0) at tnl/t_draw.c:438
#15 0x0058b714 in vbo_exec_vtx_flush (exec=0x9852148, keepUnmapped=1 '\001') at vbo/vbo_exec_draw.c:379
#16 0x00585bbb in vbo_exec_FlushVertices_internal (exec=0x9852148, unmap=1 '\001') at vbo/vbo_exec_api.c:443
#17 0x005872b3 in vbo_exec_FlushVertices (ctx=0x97f5be8, flags=1) at vbo/vbo_exec_api.c:1048
#18 0x0052e4ec in _mesa_ReadnPixelsARB (x=18, y=48, width=1, height=1, format=6407, type=5126, bufSize=2147483647, pixels=0xbfe4323c) at main/readpix.c:196
#19 0x0052e8e0 in _mesa_ReadPixels (x=18, y=48, width=1, height=1, format=6407, type=5126, pixels=0xbfe4323c) at main/readpix.c:277
#20 0x0808f481 in piglit_probe_pixel_rgb (x=18, y=48, expected=0x8091cd0) at piglit/tests/util/piglit-util-gl.c:223
#21 0x0806a62f in piglit_display () at piglit/tests/bugs/point-sprite.c:119
#22 0x0806ad27 in display () at piglit/tests/util/piglit-framework.c:56
#23 0x00125820 in fghRedrawWindow (window=0x97f2fe8, enumerator=0xbfe433a8) at freeglut_main.c:210
#24 fghcbDisplayWindow (window=0x97f2fe8, enumerator=0xbfe433a8) at freeglut_main.c:227
#25 0x00129660 in fgEnumWindows (enumCallback=0x125790 <fghcbDisplayWindow>, enumerator=0xbfe433a8) at freeglut_structure.c:394
#26 0x00125cdb in fghDisplayAll () at freeglut_main.c:249
#27 glutMainLoopEvent () at freeglut_main.c:1450
#28 0x00126605 in glutMainLoop () at freeglut_main.c:1498
#29 0x0806b415 in main (argc=1, argv=0xbfe43634) at piglit/tests/util/piglit-framework.c:292
(gdb) frame 0
#0  0x00601757 in fetch_texel_2d_f_rgba8888 (texImage=0x99d3310, i=0, j=1, k=0, texel=0x0) at swrast/s_texfetch_tmp.h:558
558	   texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 24)        );
(gdb) l
553	/* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLfloats */
554	static void FETCH(f_rgba8888)( const struct swrast_texture_image *texImage,
555	                               GLint i, GLint j, GLint k, GLfloat *texel )
556	{
557	   const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
558	   texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 24)        );
559	   texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
560	   texel[BCOMP] = UBYTE_TO_FLOAT( (s >>  8) & 0xff );
561	   texel[ACOMP] = UBYTE_TO_FLOAT( (s      ) & 0xff );
562	}
(gdb) print texel
$1 = (GLfloat *) 0x0
Comment 1 Vinson Lee 2011-10-03 15:38:47 UTC
617cdcd4c7b1cffb584c829c35bdf9c9bf04627b is the first bad commit
commit 617cdcd4c7b1cffb584c829c35bdf9c9bf04627b
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Sep 22 12:52:43 2011 -0700

    mesa: Delay s_texcombine.c memory allocation until it's used.
    
    Generally we're using fragment programs in all our drivers, so wasting
    4MB for code that's never called is pretty lame.  Reduces i965 memory
    allocation for a short shader program from 21,932,128B to 17,737,816B.

:040000 040000 54a98b0eafae2c7ce172a0f4ab632426745add13 b77a01ce4a336147bd7737c5cfc59f8dadf809c3 M	src
bisect run success
Comment 2 Brian Paul 2011-10-03 16:52:47 UTC
Fixed with commit 9119269ca14ed42b51c7d8e2e662500311b29fa3
Comment 3 Vinson Lee 2011-10-04 09:44:37 UTC
mesa: 5506f6ef966b8883e575a3f60ce96ad42ee6ffd2 (master)

Verified fixed.


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.