<?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>90</bug_id>
          
          <creation_ts>2004-05-29 03:26:53 +0200</creation_ts>
          <short_desc>Two JInternalFrames with Animators crash with EXCEPTION_ACCESS_VIOLATION</short_desc>
          <delta_ts>2010-03-24 07:46:40 +0100</delta_ts>
          <reporter_accessible>0</reporter_accessible>
          <cclist_accessible>0</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>1</version>
          <rep_platform>All</rep_platform>
          <op_sys>windows</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</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>
          
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>106</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 07:46:40 +0100</bug_when>
    <thetext>


---- Reported by nikojn 2004-05-29 03:26:53 ----

Two JInternalFrames are added to a JDesktopPane. Both of them have GLCanvases 
controlled by Animators. Moving one of the windows on the desktop causes a non-
recoverable error, a crash with the following trace:

net.java.games.jogl.GLException: Error swapping buffers
        at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.swapBuffers
(WindowsOnscreenGLContext.java:140)
        at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:270)
        at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:186)
        at net.java.games.jogl.GLCanvas.display(GLCanvas.java:74)
        at net.java.games.jogl.Animator$1.run(Animator.java:104)
        at java.lang.Thread.run(Thread.java:534)

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at 
PC=0x693F21F6
Function=[Unknown.]
Library=G:\windows\System32\atioglxx.dll

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.


Current Java thread:
        at 
net.java.games.jogl.impl.windows.WindowsGLImpl.dispatch_wglChoosePixelFormatARB
(Native Method)
        at 
net.java.games.jogl.impl.windows.WindowsGLImpl.wglChoosePixelFormatARB
(WindowsGLImpl.java:33092)
        at 
net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateCont
ext(WindowsGLContext.java:342



The environment is:

- JOGL nightly build dated 20040517
- WinXP
- ATI Radeon 9700 Pro, with 4.5 Catalyst drivers
- J2SE 1.4.2_04

Note: this issue probably somewhat overlaps with the existing issue #30.
Here is the complete source code for the test case:

--- snip ---
import net.java.games.jogl.*;

import javax.swing.*;


public class GLCanvasTest
    implements GLEventListener
{
    public static void main(String[] args)
    {
        new GLCanvasTest().test();
    }

    public GLCanvasTest()
    {
    }

    public void test()
    {
        JFrame jFrame = new JFrame(&quot;Main Window&quot;);
        jFrame.setSize(640, 480);
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JDesktopPane jDesktopPane = new JDesktopPane();
        createChildWindow(jDesktopPane, &quot;Child Window #1&quot;);
        createChildWindow(jDesktopPane, &quot;Child Window #2&quot;);
        jFrame.setContentPane(jDesktopPane);
        jFrame.show();
    }

    private JInternalFrame createChildWindow(JDesktopPane jDesktopPane, final 
String title)
    {
        final JInternalFrame jInternalFrame = new JInternalFrame(title, true, 
true, true, true);
        jInternalFrame.setSize(320, 200);
        jInternalFrame.setLocation(jDesktopPane.getAllFrames().length * 200, 
jDesktopPane.getAllFrames().length * 200);

        GLCapabilities glCaps = new GLCapabilities();
        glCaps.setDoubleBuffered(true);
        glCaps.setHardwareAccelerated(true);
        GLCapabilitiesChooser glCapsChooser = new DefaultGLCapabilitiesChooser
();

        GLCanvas glCanvas = GLDrawableFactory.getFactory().createGLCanvas
(glCaps, glCapsChooser);
        glCanvas.addGLEventListener(this);

        jInternalFrame.getContentPane().add(glCanvas);
        jInternalFrame.show();
        jDesktopPane.add(jInternalFrame);

        final Animator animator = new Animator(glCanvas);
        new Thread()
        {
            public void run()
            {
                try
                {
                    sleep(1000);
                }
                catch (InterruptedException ignored)
                {
                }
                animator.start();
                jInternalFrame.setTitle(title + &quot;, started&quot;);
            }
        }.start();

        return jInternalFrame;
    }

    public void init(GLDrawable glDrawable)
    {
    }

    public void display(GLDrawable glDrawable)
    {
        GL gl = glDrawable.getGL();
        gl.glClearColor((System.currentTimeMillis() % 1000) / 1000.0f, 0.0f, 
0.0f, 0.0f);
        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    }

    public void reshape(GLDrawable glDrawable, int i, int i1, int i2, int i3)
    {
    }

    public void displayChanged(GLDrawable glDrawable, boolean b, boolean b1)
    {
    }
}
--- snip ---



---- Additional Comments From kbr 2005-01-31 09:46:08 ----

This problem is caused by bugs in ATI&apos;s OpenGL drivers. The test case works on
NVidia hardware. Bug fixes and additional workarounds have recently been checked
in to the single-threaded workaround designed for ATI hardware. The attached
test case works properly with the code in the CVS repository, which will be
introduced in JOGL 1.1 b08.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:46 EDT  ---

This bug was previously known as _bug_ 90 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=90

The original assignee of this bug does not have
   an account here. Reassigning to the default assignee
   for the component, sgothel@jausoft.com.
   Previous assignee was kbr.

</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>