← Back to team overview

ubuntu-x-swat team mailing list archive

[Bug 788730] [NEW] Random freeze when using gl application

 

Public bug reported:

The following bug don't impact me directly because i'm a nvidia user.
But i got lot of people complaining about a random freeze when using
opengl application. I've been able to track down the bug. It's actually
reported at :

https://bugs.freedesktop.org/show_bug.cgi?id=35603

Ubuntu ship Mesa 7.10.2, and it seem they got a bug when reading builtin.
1. in src/glsl/builtin_functions.cpp:38, they are creating a fakeCtx, but never initialize it, except API
2. 4 lines after, this unitialized context is used by _mesa_glsl_parse_state()
3. in src/glsl/glsl_parser_extras.cpp:98, the highest_version is read from the fake context... and so you can random value. It can be very high in some case like 135840965
4. few lines after, they are doing a loop, and generate a string of supported glsl version. Unfortunatly, the loop is too big to be finished, and the string became really really big... and it's freeze here. (strlen issue ? dunno.)

So here we are, to prevent that, i've tryed to initialize part of the
structure used in _mesa_glsl_parse_state.

--- src/glsl/builtin_function.cpp.before	2011-05-26 18:54:01.299953729 +0200
+++ src/glsl/builtin_function.cpp	2011-05-26 18:54:44.730017427 +0200
@@ -37,6 +37,8 @@
 {
    struct gl_context fakeCtx;
    fakeCtx.API = API_OPENGL;
+   fakeCtx.Const.GLSLVersion = 120;
+   fakeCtx.Extensions.ARB_ES2_compatibility = 0;
    gl_shader *sh = _mesa_new_shader(NULL, 0, target);
    struct _mesa_glsl_parse_state *st =
       new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh);

I'm not sure at all that this will be ok for everyone, but it's
resolving the current freeze, by using initialized value...

** Affects: mesa (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu-X,
which is subscribed to mesa in Ubuntu.
https://bugs.launchpad.net/bugs/788730

Title:
  Random freeze when using gl application


Follow ups

References