Error in MacOSXCGLContext since Java 7u55

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Error in MacOSXCGLContext since Java 7u55

Solher
Hello,

I'm experiencing a serious problem on a World Wind Java applet under Mac OS 10.9.2.
I'm using the Web Start JOGL library (http://jogamp.org/deployment/webstart/jogl-all-awt-cg.jnlp) so I assume this is an up to date version.
I tried it on another Mac and I had the same issue.
The applet worked fine under Java 7u53 but since 7u55, JOGL seems to crash:

RunnableTask.run(): A catched exception occured on thread AWT-AppKit: RunnableTask[executed false, tTotal 0 ms, tExec 0 ms, tQueue 0 ms, attachment null, throwable java.lang.NullPointerException]
java.lang.NullPointerException
        at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1012)
        at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1008)
        at sun.awt.SunToolkit.getSystemEventQueueImpl(SunToolkit.java:1003)
        at java.awt.Toolkit.getEventQueue(Toolkit.java:1730)
        at java.awt.Component.repaint(Component.java:3386)
        at java.awt.Component.repaint(Component.java:3286)
        at com.jogamp.nativewindow.awt.JAWTWindow.attachSurfaceLayer(JAWTWindow.java:335)
        at jogamp.opengl.macosx.cgl.MacOSXCGLContext$NSOpenGLImpl$AttachGLLayerCmd.run(MacOSXCGLContext.java:726)
        at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:95)


It seems to be an internal error of JOGL and I hope I could find answers/solutions here.

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Error in MacOSXCGLContext since Java 7u55

gouessej
Administrator
Hi

Another possibility is that there is a regression in AWT within Oracle Java itself. It is probably related with those bug reports (even though you don't use RMI):
http://sun.awt.SunToolkit.getSystemEventQueueImplPP
http://bugs.java.com/view_bug.do?bug_id=8019272

Oracle broke some things in the management of AppContext since Java 7 update 25, maybe a particular fix introduced another regression.

Try this workaround:
http://stackoverflow.com/a/19054224

As you point out it's not reproducible with Java 1.7 update 53 but with Java 1.7 update 55, it looks like it has nothing to do with JOGL. It looks like an internal error of AWT.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Error in MacOSXCGLContext since Java 7u55

Solher
Thanks for your help.

I tried the workaround you indicated but there are so many "invokeLater()" methods in my project that I can't really replace every calls.

I tried to find the "source" invokeLater() with the Eclipse debugger to solve the problem more precisely but surprisingly it worked on it !
No crash with both JDK 7u55 and JRE 7u55 !

I only have the problem with my applet under web browsers (Safari and Firefox).

I really can't figure out where this problem come from.
Reply | Threaded
Open this post in threaded view
|

Re: Error in MacOSXCGLContext since Java 7u55

gouessej
Administrator
Maybe you can try this workaround which is a lot easier to use:
http://forum.jogamp.org/Canvas3D-resize-problem-tp4031602p4031680.html

The problem comes from Oracle Java itself for sure as this is the variant in your case, you get a bug when using the same version of JOGL with 2 successive updates of Oracle Java.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Error in MacOSXCGLContext since Java 7u55

Solher
What I don't understand is why does is crash only when used in a web browser.

So you 're thinking of a problem with a null AppContext ?
Reply | Threaded
Open this post in threaded view
|

Re: Error in MacOSXCGLContext since Java 7u55

gouessej
Administrator
A plain Java application outside the browser without Java Web Start and an applet don't use the same classloader and I already used a similar workaround. It reminds me this bug:
http://bugs.java.com/view_bug.do?bug_id=8017776

The AppContext is thread local, it is probably null in one classloader:
http://hg.openjdk.java.net/jdk6/jdk6/jdk/file/ec13a50f0f17/src/share/classes/sun/awt/SunToolkit.java#l1153

You should read the source code of OpenJDK to understand how it works. Oracle Java uses almost the same source code except for Java Web Start / Icedtea Web Start.
Julien Gouesse | Personal blog | Website