← Back to team overview

dx-packages team mailing list archive

[Bug 692966] Re: Check for OpenGL extensions support before calling associated extension functions.

 

** Changed in: unity (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of DX
Packages, which is subscribed to nux in Ubuntu.
Matching subscriptions: dx-packages, dx-packages
https://bugs.launchpad.net/bugs/692966

Title:
  Check for OpenGL extensions support before calling associated
  extension functions.

Status in Nux:
  Fix Released
Status in Unity:
  Fix Released
Status in “nux” package in Ubuntu:
  Fix Released
Status in “unity” package in Ubuntu:
  Fix Released

Bug description:
  Current nux code (nux-0.9.12) is using glew to query GPU driver for a
  list of supported extensions and get associated extension function
  pointers, but there're no checks if the extension is present/supported
  before such functions usage.

  For example:
  glActiveStencilFaceEXT is part of GL_EXT_stencil_two_side extension and should be called if and only if GL_EXT_stencil_two_side is supported, however nux-0.9.12/NuxGraphics/glrenderstates.h (lines 990-1011) contains function GpuRenderStates::HW__SetFrontFaceStencilFunc which performs a call CHECKGL(glActiveStencilFaceEXT (GL_FRONT)); without any checks. In practice that leads to a crash if GPU doesn't support GL_EXT_stencil_two_side, as __glewActiveStencilFaceEXT (which is actually accessed in this call) would be set to NULL.
  Attached a stacktrace.txt of such case when running compiz on natty with unity desktop, part of it here:
  #0  0x00000000 in ?? ()
  #1  0x04428295 in nux::GpuRenderStates::HW__SetFrontFaceStencilFunc (this=0x96e7a70, Func_=519, Ref_=0, Mask_=255) at ./GLRenderStates.h:1005

  Please note that the extension function above is not the only one
  which is used the same way in the nux code, there're other similar
  cases: for example glBlendEquationSeparateEXT used in
  GpuRenderStates::HW__SetAlphaBlendOp.

  Related info:
  ProblemType:    Crash
  Distributor ID:	Ubuntu
  Description:	Ubuntu natty (development branch)
  Release:	       11.04
  Uname:            Linux leo-VirtualBox 2.6.37-10-generic #24-Ubuntu SMP Thu Dec 16 17:52:40 UTC 2010 i686 GNU/Linux
  compiz:
    Installed: 1:0.9.2.1+glibmainloop3-0ubuntu5
  unity:
    Installed: 3.2.8-0ubuntu1
  libnux-0.9-0:
    Installed: 0.9.12-0ubuntu1
  Attaching also glxinfo output.
  related glewinfo output:
  GL_EXT_stencil_two_side:                                       MISSING
  ------------------------
    glActiveStencilFaceEXT:                                      MISSING

To manage notifications about this bug go to:
https://bugs.launchpad.net/nux/+bug/692966/+subscriptions