<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>391</bug_id>
          
          <creation_ts>2010-03-26 17:22:27 +0100</creation_ts>
          <short_desc>Race condition in GLStateTracker while accessing/reset the mapping</short_desc>
          <delta_ts>2010-03-26 17:25:26 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>2</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>sgothel</cc>
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs>cf95674e16d34a85191d3af0a35d1357e011fcac</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>430</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-26 17:22:27 +0100</bug_when>
    <thetext>As shown below, the concurrent access of GLStateTracker
while being cleared by GLContext.destroy() causes a NPE.

GLContext.destroy() shall disable it first, then clear it.

The state stack pop method shall also swap the mapping 
with a most atomic action.

Exception in thread &quot;AWT-EventQueue-0&quot; java.lang.NullPointerException
        at com.sun.opengl.impl.GLStateTracker.getInt(GLStateTracker.java:94)
        at com.sun.opengl.impl.gl2.GL2Impl.glGetIntegerv(GL2Impl.java:6102)
        at com.sun.opengl.impl.gl2.GL2Impl.imageSizeInBytes(GL2Impl.java:26000)
        at com.sun.opengl.impl.gl2.GL2Impl.imageSizeInBytes(GL2Impl.java:25713)
        at com.sun.opengl.impl.gl2.GL2Impl.glTexImage2D(GL2Impl.java:18692)
        at glredbook1314.combiner.init(combiner.java:104)
        at com.sun.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:88)
        at javax.media.opengl.awt.GLJPanel$Updater.init(GLJPanel.java:557)
        at com.sun.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:88)
        at com.sun.opengl.impl.GLPbufferImpl$InitAction.run(GLPbufferImpl.java:274)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:149)
        at com.sun.opengl.impl.GLPbufferImpl.maybeDoSingleThreadedWorkaround(GLPbufferImpl.java:267)
        at com.sun.opengl.impl.GLPbufferImpl.swapBuffers(GLPbufferImpl.java:157)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:159)
        at javax.media.opengl.awt.GLJPanel.dispose(GLJPanel.java:238)

[junit] Testsuite: com.jogamp.opengl.test.junit.texture.awt.Texture1
    [junit] Exception in thread &quot;AWT-EventQueue-0&quot; java.lang.NullPointerException
    [junit] 	at com.sun.opengl.impl.GLStateTracker.getInt(GLStateTracker.java:94)
    [junit] 	at com.sun.opengl.impl.gl2.GL2Impl.glGetIntegerv(GL2Impl.java:6102)
    [junit] 	at com.sun.opengl.impl.gl2.GL2Impl.imageSizeInBytes(GL2Impl.java:26000)
    [junit] 	at com.sun.opengl.impl.gl2.GL2Impl.imageSizeInBytes(GL2Impl.java:25713)
    [junit] 	at com.sun.opengl.impl.gl2.GL2Impl.glTexImage2D(GL2Impl.java:18692)
    [junit] 	at com.sun.opengl.util.texture.Texture.updateImage(Texture.java:646)
    [junit] 	at com.sun.opengl.util.texture.Texture.updateImage(Texture.java:421)
    [junit] 	at com.sun.opengl.util.texture.Texture.&lt;init&gt;(Texture.java:183)
    [junit] 	at com.sun.opengl.util.texture.TextureIO.newTexture(TextureIO.java:394)
    [junit] 	at com.jogamp.opengl.test.junit.texture.util.gl2.TextureGL2ListenerDraw1.init(TextureGL2ListenerDraw1.java:56)
    [junit] 	at com.sun.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:88)
    [junit] 	at javax.media.opengl.awt.GLCanvas$InitAction.run(GLCanvas.java:603)
    [junit] 	at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:149)
    [junit] 	at javax.media.opengl.awt.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:553)
    [junit] 	at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:290)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>431</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-26 17:25:26 +0100</bug_when>
    <thetext>Solved as described ..</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>