Race condition with 1.1.0-b11 on OS X

Hi,

Since we upgraded our application to use 1.1.0-b11 from 1.1.0-b10, it occasionally fails to create and initialize GLCanvas.

JOGL prints out the following message:

Error: view width or height == 0at “/Users/kbr/JavaNet/jogl/src/native/jogl/MacOSXWindowSystemInterface.m:createContext:46”

and throws an exception. I’m including the stack trace below.

We cannot reproduce the problem with JOGL 1.1.0-b10 (we’ve been using 1.1.0-b10 since it was released, and never had this problem). I imagine this is likely related to one of the two OS X specific thread issues addressed in b11, but I’m not sure which one.

On some machines this happens about one out of ten times, consistently. On other machines, in happens every time.

(It happens about 1/10 of the time on a dual G5 with a NVIDIA GeForce FX 5200 Ultra running OS X 10.3. Same on a single G5 with a nVidia GeForce4 MX running 10.3. Happens every time on a iBook G4 with 10.4.)

No problems at all on Windows.

Has anyone had the same problem since upgrading to b11? Any ideas?

Thanks,

Andrei


Here is the exception and stack trace:

apple.awt.EventQueueExceptionHandler Caught Throwable : net.java.games.jogl.GLException: Error creating nsContext
net.java.games.jogl.GLException: Error creating nsContext
at net.java.games.jogl.impl.macosx.MacOSXGLContext.create(MacOSXGLContext.java:158)
at net.java.games.jogl.impl.macosx.MacOSXGLContext.makeCurrent(MacOSXGLContext.java:168)
at net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext.makeCurrent(MacOSXOnscreenGLContext.java:118)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:246)
at net.java.games.jogl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:236)
at net.java.games.jogl.GLCanvas.reshape(GLCanvas.java:133)
at java.awt.Component.setBounds(Component.java:1664)
at java.awt.BorderLayout.layoutContainer(BorderLayout.java:691)
at java.awt.Container.layout(Container.java:1020)
at java.awt.Container.doLayout(Container.java:1010)
at java.awt.Container.validateTree(Container.java:1092)
at java.awt.Container.validate(Container.java:1067)
at java.awt.Window.show(Window.java:461)

This check was removed from JOGL’s Mac OS X implementation today (during testing on 10.4), so the error will be gone in the next release. If you can’t wait that long, please use cvs to check out the current sources and build them. Almost all of the development tools needed are already on 10.4; you just need to download ANTLR, set up $HOME/jogl.properties, and run “ant macosx”.

Ken,

Thank you. Do you have a target date for the next release?

-Andrei

No target date yet. Probably within a couple of weeks. There are a few more bugs I’d like to investigate first.

I am also experiencing this bug in Mac OS X 10.4, but using JOGL 1.1b12. This bug crops up frequently on Mac OS X, but never on Linux. Did the potential fix for this possibly not get included in 1.1b12? Here’s the full stack trace for one of the these exceptions:

Error: view width or height == 0at “/Users/kbr/JavaNet/jogl/src/native/jogl/MacOSXWindowSystemInterface.m:createContext:46”
apple.awt.EventQueueExceptionHandler Caught Throwable : net.java.games.jogl.GLException: Error creating nsContext
net.java.games.jogl.GLException: Error creating nsContext
at net.java.games.jogl.impl.macosx.MacOSXGLContext.create(MacOSXGLContext.java:158)
at net.java.games.jogl.impl.macosx.MacOSXGLContext.makeCurrent(MacOSXGLContext.java:168)
at net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext.makeCurrent(MacOSXOnscreenGLContext.java:118)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:246)
at net.java.games.jogl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:236)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:77)
at net.java.games.jogl.GLCanvas.paint(GLCanvas.java:86)
at net.java.games.jogl.GLCanvas.update(GLCanvas.java:139)
at sun.awt.RepaintArea.updateComponent(RepaintArea.java:267)
at sun.awt.RepaintArea.paint(RepaintArea.java:233)
at apple.awt.ComponentModel.handleEvent(ComponentModel.java:255)
at java.awt.Component.dispatchEventImpl(Component.java:4105)
at java.awt.Component.dispatchEvent(Component.java:3877)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:267)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:182)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

My system config is:
Mac Mini - OS X 10.4.1
ATI Radeon 9200
Java 1.5.0

Thanks!

The fix for this is definitely in 1.1 b12. Please delete all libjogl.jnilib, libjogl_cg.jnilib and jogl.jar files on your machine and reinstall 1.1 b12.

That seems to have fixed it! Sorry for the false alarm…