Bug 12082

Summary: [i915]segment fault with BASE_LEVEL set to 5 for MipMap
Product: Mesa Reporter: Shuang He <shuang.he>
Component: Drivers/DRI/i915Assignee: haihao <haihao.xiang>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: medium CC: brice.goglin, dri-devel, pabs3
Version: git   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: test case
test case

Description Shuang He 2007-08-21 01:53:02 UTC
on 945g(64bit) and 945gm(32bit)
for Mipmap, when BASE_LEVEL is set to 5 for MipMap
it will get a segment fault when glFlush() is called after drawing some texture
Comment 1 Shuang He 2007-08-21 01:56:26 UTC
Created attachment 11189 [details]
test case

following is the backtrace from gdb:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1211016496 (LWP 4289)]
intelUploadTexImages (intel=0x8056b10, t=0x8070518, face=0) at intel_tex.c:765
765        /* Can we texture out of the existing client data? */
(gdb) bt
#0  intelUploadTexImages (intel=0x8056b10, t=0x8070518, face=0) at intel_tex.c:765
#1  0xb7b1c1a7 in enable_tex_2d (ctx=Variable "ctx" is not available.
) at i915_texstate.c:849
#2  0xb7b1c6c7 in i915UpdateTextureState (intel=0x8056b10) at i915_texstate.c:941
#3  0xb7b3ccbe in intelRunPipeline (ctx=0x8056b10) at intel_tris.c:753
#4  0xb7bca478 in _tnl_draw_prims (ctx=0x8056b10, arrays=0x808b5d0, prim=0x808a12c, nr_prims=1, ib=0x0, min_index=0, max_index=3) at tnl/t_draw.c:403
#5  0xb7bc32ae in vbo_exec_vtx_flush (exec=0x808a008) at vbo/vbo_exec_draw.c:215
#6  0xb7bbef20 in vbo_exec_FlushVertices (ctx=0x8056b10, flags=1) at vbo/vbo_exec_api.c:685
#7  0xb7b4a8f6 in _mesa_Flush () at main/context.c:1719
#8  0xb7fcc588 in glFlush () at ../../../src/mesa/glapi/glapitemp.h:1170
#9  0x08048d43 in test () at texlod.c:110
#10 0x08048d85 in display () at texlod.c:119
#11 0xb7f624cf in processWindowWorkList (window=0x804ece8) at glut_event.c:1302
#12 0xb7f62fa2 in glutMainLoop () at glut_event.c:1349
#13 0x08048e01 in main (argc=1, argv=0xbfd42744) at texlod.c:132
Comment 2 Brice Goglin 2007-11-24 01:28:35 UTC
Paul Wise reported the same with mesa 7.0.2 at 
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=451339

He was enabling rendered+fresnel reflection in foobillard.

We probably need the output of 'bt full' in gdb here.
Comment 3 Paul Wise 2007-11-24 01:43:19 UTC
bt full from mesa 7.0.2 (compiled with optimisation). I'd try with out optimisation, but the Debian mesa packages don't seem to support DEB_BUILD_OPTIONS=noopt

(gdb) bt full
#0  intelUploadTexImages (intel=0x8131508, t=0x86fb018, face=0) at intel_tex.c:763
        firstImage = (const struct gl_texture_image *) 0x0
        __PRETTY_FUNCTION__ = "intelUploadTexImages"
#1  0xb743fe66 in i915UpdateTextureState (intel=0x8131508) at i915_texstate.c:835
        ctx = <value optimized out>
        i = 0
#2  0xb7464cb0 in intelRunPipeline (ctx=0x8131508) at intel_tris.c:753
No locals.
#3  0xb74f6b61 in _tnl_draw_prims (ctx=0x8131508, arrays=0x8166920, prim=0x8581d48, nr_prims=6, ib=0x0, min_index=0, max_index=23) at tnl/t_draw.c:402
        bo = {0x81557e8, 0x0, 0x8131508, 0xb750bc08, 0xbffd6c48, 0xb7435b8c, 0x8131508, 0xb7a838ac, 0x1e01, 0xb7627640, 0x1, 0x18, 0xbffd6c88, 0xb7ca5ff4, 0x8131508, 0x18, 
  0xbffd6c68, 0xb7c42576, 0x80e7a50, 0xb7627640, 0xbffd6c88, 0xb74d11bd, 0x80e7a50, 0x858c088, 0x20, 0xb7627640, 0x8131508, 0xb7627640, 0xbffd6ca8, 0xb74bc572, 0x8131508, 
  0x858c088, 0x20}
        nr_bo = 1
        tnl = (TNLcontext *) 0x8177ac8
#4  0xb74f5905 in vbo_save_playback_vertex_list (ctx=0x8131508, data=0x8833a70) at vbo/vbo_save_draw.c:220
        node = <value optimized out>
#5  0xb748a9f3 in execute_list (ctx=0x8131508, list=<value optimized out>) at main/dlist.c:5754
        opcode = OPCODE_EXT_0
        i = <value optimized out>
        n = (Node *) 0x8833a6c
        done = <value optimized out>
#6  0xb748de25 in _mesa_CallList (list=15) at main/dlist.c:6842
        save_compile_flag = 0 '\0'
        ctx = (GLcontext *) 0x2
#7  0x08076134 in draw_ball (ball=0x8445210, cam_pos={x = 0, y = -2.88207197, z = 0.854846716}, cam_FOV=40, win_width=800, reflect=0) at ball.c:1093
        cnear = 0.600000024
        cfar = 7
        geomfact = 1
        i = 143497768
        detail = 2
        glballlist = {13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1}
        ballmatr = {0.0330920666, 0.714764893, 0.698581457, 0, 0.954326034, -0.23025389, 0.190381244, 0, 0.296928942, 0.660374343, -0.689738333, 0, 0, 0, 0, 1}
        maxdetail = 5
        array = {0xb21be008, 0xb215c008, 0xb20fa008, 0xb2098008, 0xb2036008, 0xb1fd4008, 0x0, 0x0, 0x0, 0x0, 0x0}
#8  0x080786ea in draw_balls (balls={nr = 16, gametype = GAME_8BALL, ball = 0x8445210}, cam_pos={x = 0, y = -2.88207197, z = 0.854846716}, cam_FOV=40, win_width=800, 
    spheretexbind=1, lightpos=0x80c4580, lightnr=2, cuberef_binds=0x870df08) at ball.c:1834
        texmat = {1, 0, 0, 0, 0, 0.342020154, 0.939692616, 0, 0, -0.939692616, 0.342020154, 0, 0, 0, 0, 1}
        i = 0
        j = -1218283968
        fact = 6.6930231154253156e-316
        v = {x = 0, y = 0, z = 0}
        vn = {x = 3.61535004e-43, y = 0, z = 0}
        stretch_matrix = {1.40129846e-45, 2.35098856e-38, 0, 1.40129846e-45, 7.49521097e-37, -1.98019505, -1.17380441e-05, 4.42609255e-34, 0, -1.98019123, -1.34981819e-05, 0, 
  3.61535004e-43, -1.98019886, -1.17384006e-05, 4.42609255e-34}
        init = 1
        fresnel_init = 0
#9  0x08055b58 in DisplayFunc () at billard3d.c:3089
        th = -1.2217304763960306
        ph = 0
        light_position = {0, 0, 0.699999988, 1}
        light0_position = {0, 0.699999988, 0.699999988, 1}
        light0_diff = {0.600000024, 0.600000024, 0.600000024, 1}
        light0_amb = {0.349999994, 0.349999994, 0.349999994, 1}
        light1_position = {0, -0.699999988, 0.699999988, 1}
        light1_diff = {0.600000024, 0.600000024, 0.600000024, 1}
        light1_amb = {0.349999994, 0.349999994, 0.349999994, 1}
        cam_pos = {x = 0, y = -2.88207197, z = 0.854846716}
        i = 0
        mv_matr = {m = {-2.41330126e-05, 8.59476654e-34, -1.98027706, -2.25266267e-05, -2.41330126e-05, 8.59476654e-34, 8.59444328e-34, 8.59492082e-34, -1.98027515, 
    8.59475919e-34, 8.59444328e-34, -1.34981819e-05, -1.98027897, -1.34981819e-05, 1.68155816e-44, 8.59515959e-34}}
        prj_matr = {m = {-2.39470392e-05, 8.56747303e-34, -1.98026943, 8.59453878e-34, -1.98026752, 8.56746568e-34, 2.52233724e-44, -2.41249581e-05, -2.41330126e-05, 
    8.59444328e-34, -1.98027325, 8.59518531e-34, -2.41330126e-05, 8.59444328e-34, 8.56747303e-34, -2.41249581e-05}}
        real_dist = 2.49942183
        fps = 41.666666666666664
        rg_eye_dist = 0.0500000007
#10 0x08097a29 in sys_main_loop () at sys_stuff.c:699
No locals.
#11 0x0805d17d in main (argc=1, argv=0xbffd7d34) at billard3d.c:5256
        auxnr = 0
        act_option = -1
        option_index = 42
        confc = 26
        confv = (char **) 0x80d0170
Comment 4 Shuang He 2008-03-11 22:32:48 UTC
seems this issue has gone
Comment 5 Shuang He 2008-03-11 22:35:04 UTC
Created attachment 15056 [details]
test case

and seems there's problem with my previous test case.
Comment 6 Shuang He 2008-03-11 22:35:34 UTC
verified
Comment 7 Paul Wise 2008-03-11 22:44:31 UTC
Both the updated test case and foobillard segfault with mesa 7.0.3~rc2 for me.
Comment 8 Shuang He 2008-03-11 23:14:07 UTC
(In reply to comment #7)
> Both the updated test case and foobillard segfault with mesa 7.0.3~rc2 for me.
> 

I just tried both mesa git tip with drm git tip, and mesa 7.0.3-rc2 with drm 2.3, both are working for me.
can you tell us which version of other component you're using, like drm
Comment 9 Paul Wise 2008-03-11 23:21:40 UTC
libdrm 2.3.0
linux 2.6.24

00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)

00:02.0 0300: 8086:27a2 (rev 03)
00:02.1 0380: 8086:27a6 (rev 03)
Comment 10 Shuang He 2008-03-11 23:46:19 UTC
(In reply to comment #9)
> libdrm 2.3.0
> linux 2.6.24
> 
> 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS,
> 943/940GML Express Integrated Graphics Controller (rev 03)
> 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML
> Express Integrated Graphics Controller (rev 03)
> 
> 00:02.0 0300: 8086:27a2 (rev 03)
> 00:02.1 0380: 8086:27a6 (rev 03)
> 

you're correct, it's still get same segment fault on 945GM with mesa 7.0.3-rc2 but working for git tip now.
Comment 11 Paul Wise 2008-03-11 23:54:23 UTC
If it is fixed in mesa git, I guess it can be closed? There doesn't seem to be any way to mark it as fixed in a particular version though.
Comment 12 Shuang He 2008-03-11 23:59:24 UTC
(In reply to comment #11)
> If it is fixed in mesa git, I guess it can be closed? There doesn't seem to be
> any way to mark it as fixed in a particular version though.
> 

then, I'll file a new one to track this issue for mesa 7.0.3-rc2
Comment 13 Shuang He 2008-03-12 00:22:42 UTC
bug #14966 is filed to track this issue for mesa 7.0.3-rc2
Comment 14 Adam Jackson 2009-08-24 12:27:49 UTC
Mass version move, cvs -> git

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.