jogl
  1. jogl
  2. JOGL-370

Potential crash calling glXDestroyContext

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: jogl
    • Labels:
      None
    • Environment:

      Operating System: Linux
      Platform: Other

    • Issuezilla Id:
      370

      Description

      I have been debugging an issue which showed up on Ubuntu 8.04 and 8.10. My
      application asks for a context, and JOGl creates an X11GLContext in response. An
      attempt to make this context current then fails, as sometimes happens, and a
      GLException is correctly thrown. My application then destroys the context. At
      the point of destroying the context a core dump occurs, generating an hs_err file.

      Closer inspection shows that in X11GLContext the variable 'mostRecentDisplay' is
      not set during either the constructor, createContext() or makeCurrentImpl() (if
      GLX.glXMakeCurrent() returns false). However in destroyImpl() there is a call
      GLX.glXDestroyContext(mostRecentDisplay, context). The value of
      mostRecentDisplay is zero.

      I believe that this is the cause of the problem. The documentation I have found
      for glXDestroyContext() does not indicate that null is a valid input. If I
      modify a local copy of JOGl to set mostRecentDisplay to drawable.getDisplay()
      then the crash does not occur.

      I haven't tested this code change very much; it just seems to work in our case.
      I hope this is helpful.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            jogl-issues
            Reporter:
            djclayworth
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: