Bug 31569 - [r300g] SIGSEGV src/mesa/main/api_loopback.c:1470
Summary: [r300g] SIGSEGV src/mesa/main/api_loopback.c:1470
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: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-11 18:21 UTC by Vinson Lee
Modified: 2010-12-10 23:33 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2010-11-11 18:21:41 UTC
mesa: d18df9e336b5d2e68a4a6185f7b9d0d0c095c3c4 (master)

chipset: RV530 71C5 (ATI Radeon X1600)
system architecture: i686
libdrm-dev: 2.4.21-1ubuntu2.1
kernel version: 2.6.35-22-generic
Linux distribution: Ubuntu 10.10 i386
Machine model: iMac4,1

Run piglit provoking-vertex test.

$ ./bin/provoking-vertex
radeon: Successfully grabbed chipset info from kernel!
radeon: DRM version: 2.5.0 ID: 0x71c5 GB: 1 Z: 2
radeon: GART size: 509 MB VRAM size: 128 MB
radeon: HyperZ: NO
Mesa: Mesa 7.10-devel DEBUG build Nov 11 2010 12:16:33
Mesa: User error: GL_INVALID_ENUM in vbo_VertexAttribI1ui
Segmentation fault (core dumped)

(gdb) bt
#0  0x017e0d43 in loopback_VertexAttribI1uiv (index=36430, v=0x96) at src/mesa/main/api_loopback.c:1470
#1  0x0804a5f0 in piglit_display () at piglit/tests/general/provoking-vertex.c:90
#2  0x0804c6a7 in display () at piglit/tests/util/piglit-framework.c:52
#3  0x006f5820 in fghRedrawWindow (window=0x9c02058, enumerator=0xbfa6e598) at freeglut_main.c:210
#4  fghcbDisplayWindow (window=0x9c02058, enumerator=0xbfa6e598) at freeglut_main.c:227
#5  0x006f9660 in fgEnumWindows (enumCallback=0x6f5790 <fghcbDisplayWindow>, enumerator=0xbfa6e598) at freeglut_structure.c:394
#6  0x006f5cdb in fghDisplayAll () at freeglut_main.c:249
#7  glutMainLoopEvent () at freeglut_main.c:1450
#8  0x006f6605 in glutMainLoop () at freeglut_main.c:1498
#9  0x0804c850 in main (argc=1, argv=0xbfa6e824) at piglit/tests/util/piglit-framework.c:118
(gdb) frame 0
#0  0x017e0d43 in loopback_VertexAttribI1uiv (index=36430, v=0x96) at src/mesa/main/api_loopback.c:1470
1470	   ATTRIBI_1UI(index, v[0]);
(gdb) l
1465	}
1466	
1467	static void GLAPIENTRY
1468	loopback_VertexAttribI1uiv(GLuint index, const GLuint *v)
1469	{
1470	   ATTRIBI_1UI(index, v[0]);
1471	}
1472	
1473	static void GLAPIENTRY
1474	loopback_VertexAttribI4bv(GLuint index, const GLbyte *v)
(gdb) print *v
Cannot access memory at address 0x96
Comment 1 Marek Olšák 2010-11-13 12:24:25 UTC
I can't reproduce this, but it looks like a Mesa core bug.
Comment 2 Brian Paul 2010-11-15 08:11:46 UTC
This looks bogus too.  Line 90 of provoking-vertex.c is a call to the glProvokingVertexEXT() function, not glVertexAttribI1uiv.

Vinson, how are you building Mesa in this case?  Maybe try a clean build, or a debug build and see what happens.
Comment 3 Vinson Lee 2010-11-19 18:22:11 UTC
mesa: a172368ef1500fd2c7c1e55133e8e098b73d97a5 (master)

A clean build still reproduces the crash.

I am building a debug r300g with scons.

$ scons
$ LIBGL_DRIVERS_PATH=build/linux-x86-debug/gallium/targets/dri-r300 provoking-vertex
Comment 4 Vinson Lee 2010-11-21 13:54:19 UTC
commit bb045d339b53f7ddd42bfca363e3d589b0ddcf20
Author: Chia-I Wu <olv@lunarg.com>
Date:   Sat Nov 20 17:47:11 2010 -0800

    scons: Define IN_DRI_DRIVER.
    
    The define is required for DRI drivers.  It is not needed for
    libgl-xlib, but the overhead it introduces should be minor.

diff --git a/src/mesa/SConscript b/src/mesa/SConscript
index 5fe5d39..08d731d 100644
--- a/src/mesa/SConscript
+++ b/src/mesa/SConscript
@@ -19,6 +19,10 @@ if env['platform'] == 'windows':
         'WIN32_THREADS', # use Win32 thread API
     ])
     env.Prepend(CPPPATH = ['#src/talloc'])
+else:
+    env.Append(CPPDEFINES = [
+        'IN_DRI_DRIVER', # enable the remap table (for DRI drivers)
+    ])
 
 #
 # Source files


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.