Native exception when JFrame is disposed

I am getting an exception in the OpenGL library when I exit my application and dispose the main JFrame. This only happens on my Linux machine, which uses Red Hat 9, an NVidia Quadro4 750 XGL with the latest 66.29 drivers, and the latest 1.1b07 Jogl libraries.

Anyone have any ideas? Thanks for your help.

Sean

The first part of the exception log reads:

This test class reproduces the problem for me:

Sean,

This looks a lot like the issue I raised a couple of weeks back. They are both happening in GLCanvas.removeNotify() anyhow.

https://jogl.dev.java.net/issues/show_bug.cgi?id=124

Rob

Yeah, it appears to be the same exception. Although mine is deterministic. I just upgraded from Jogl 1.1b04, which didn’t exhibit this behavior. I believe the exception is also thrown when the GLCanvas is removed from the parent JFrame.

Sean

Also, I forgot to mention that I’m using Java 1.4.2.

Sean

The exception is thrown by line 177 in X11Context, which is in the destroyImpl method:

The variable ‘context’ is checked for null, so ‘mostRecentDisplay’ would seem to be suspect.

Now, when the Animator is run, the GLCanvas display method is called and in turn the invokeGL method of GLContext is called. In this method, after the context is made current, the drawing surface is locked, and the GLEventListeners display methods are called, the current context is cleared (glXMakeCurrent with null values) and the drawing surface unlocked. I don’t really know what locking and unlocking the JAWT surface is doing. And I don’t know if it, or clearing the current context, will cause an exception if the context is subsequently freed or destroyed.

Anyone know what’s going on? Thanks for your help.

Sean

This looks like a bug in JOGL’s context destruction code on X11. Your test works fine on two Windows XP machines I tried but on X11 it crashes with NVidia hardware and reports “Xlib: unexpected async reply (sequence 0x52c)!” with ATI hardware. There is probably not enough synchronization with the AWT down the context destruction paths. Could you please file a bug with the JOGL Issue Tracker and attach your test case? Thanks.

As a workaround, remove the call to mFrame.dispose() in your close() method.

I was going to add it to issue #124 that Rob submitted. However, as an Observer, I cannot add comments to an issue. How do I promote my dev.java.net profile, ssylvis, to comment-submission status?

Sean

Actually, you weren’t an Observer of the JOGL project. You usually need to request that status using the Membership link on the JOGL home page. I’ve manually added you as an Observer so you should be able to add comments to bug reports now.

Doh!

Thanks. I’ve added my comments and test case to issue #124.

Sean