Bug 16244 - [mesa_7_0_branch 855GM mesa core] glxinfo crash X
Summary: [mesa_7_0_branch 855GM mesa core] glxinfo crash X
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: high major
Assignee: haihao
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-05 20:23 UTC by Shuang He
Modified: 2008-06-16 18:36 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Shuang He 2008-06-05 20:23:22 UTC
System Environment:
--------------------------

--Platform: 855GM, all(when reverting to software rendering)

--Architecture(32-bit,64-bit,compatiblity): all

--2D driver:  beb72ae5aa053303f5cc419e9c9d7c6db964f160

--mesa(7_0 branch): 4b7147832678ab3014cf58da84f0962ed2b6c832

--Xserver(1.4 branch): 7982aaa7f071f9a21ad402da872d5328bd7e51ff

--Drm: ba7263b8c2f8c14c647da725ecbc73fcd456d63c

--Kernel:
2.6.23.1


Bug detailed description:
-------------------------
this issue happens on 855GM with direct rendering
this issue also happens on all other platforms when dri drivers are removed, and reverting to software rendering.

on 855GM, glxinfo will crash X
on other platform, after removing the dri drivers, start X, and run glxinfo will crash X

seems this is caused by _mesa_new_program recursively call it self without return, and following patch can fix this:

diff --git a/configs/linux-dri b/configs/linux-dri
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index e9b364e..31b317a 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -128,7 +128,7 @@ _mesa_init_driver_functions(struct dd_fu

    /* Vertex/fragment programs */
    driver->BindProgram = NULL;
-   driver->NewProgram = _mesa_new_program;
+   driver->NewProgram = NULL;
    driver->DeleteProgram = _mesa_delete_program;
 #if FEATURE_MESA_program_debug
    driver->GetProgramRegister = _mesa_get_program_register;
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index a240baf..0bc9c62 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -421,12 +421,12 @@ #if FEATURE_NV_vertex_program || FEATURE
 #endif

 #if FEATURE_ARB_vertex_program
-   ss->DefaultVertexProgram = ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0);
+   ss->DefaultVertexProgram = _mesa_new_program(ctx, GL_VERTEX_PROGRAM_ARB, 0);
    if (!ss->DefaultVertexProgram)
       goto cleanup;
 #endif
 #if FEATURE_ARB_fragment_program
-   ss->DefaultFragmentProgram = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
+   ss->DefaultFragmentProgram = _mesa_new_program(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
    if (!ss->DefaultFragmentProgram)
       goto cleanup;
 #endif



Reproduce steps:
----------------
on 855GM
just glxinfo will crash X

on other platforms:
1. remove dri drivers
2. start X
3. glxinfo
Comment 1 haihao 2008-06-11 02:01:49 UTC
Cherry pick Brian's fix (40133487dbdd14456a8a4f6a5716f57a36eb1ea7er) from master to fix this issue.
Comment 2 Shuang He 2008-06-16 18:36:32 UTC
verified, thanks


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.