Java program with JOGL on Solaris crash. My code or ...?

Hi,
When launched the outline of the GUI appears with the proper dimensions, then immediately and simultaneously resizes smaller and jumps to the top left of the screen, then crashes. What is interesting to note is that it gets to the point where the main method finishes and the GUI is left to stand on its own and crashes before init, reshape, or display are entered (I placed a println at the beginning of those methods to verify). I’m using the latest release builds of jogl.jar and precompiled system libraries for Solaris on a Sparc machine avaiable from the website. The program does run perfectly fine in Windows XP Pro SP2, XP Home, and even on an old Win 98SE machine with a VooDoo5 card using the last official divers from 3Dfx (although it does draw the world upside down, but it doesn’t crash and the drivers are ancient).
The program does compile without error on the Sun machine, and the only warnings are from me using the pre Java 5 convention of having to cast objects back out of the java.util containers.

Anyone with any ideas on a solution, or where the problem is originating? Is it a mistake in my code or system configuration? Potential conflict between JOGL and the X11 libs?

Thanks,
nova dragoon

Terminal text:
bash-2.05$ java -classpath .:jogl.jar: -Djogl.debug -Djava.library.path=. AiGUI
AiGUI:main:Entered
Warning: Cannot convert string “-monotype-arial-regular-r-normal–-140---p--iso8859-1” to type FontStruct
AiGUI:main:Creating the gui.
AiGUI:AiGUI:Entered
AiGuiMenuAndToolBars:AiGuiMenuAndToolBars:Entered
AiGuiMenuAndToolBars:AiGuiMenuAndToolBars:Exit
AiGuiMenuAndToolBars:getMenuBar:Entered
AiGuiMenuAndToolBars:getMenuBar:Exit
AiGuiMenuAndToolBars:getToolBar:Entered
AiGuiMenuAndToolBars:getToolBar:Exit
AiGuiWorldSpace:AiGuiWorldSpace:Entered
AiGuiWorldSpace:AiGuiWorldSpace:Exit
AiGUI:AiGUI:About to set size ans set visible.
Available 0: GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 32, StencilBits: 8, Red: 5, Green: 5, Blue: 5: Alpha: 0, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 16 ]
Available 1: null
Scores: [ -460, -9999999 ]
Chosen index: 0
Chosen capabilities:
GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 32, StencilBits: 8, Red: 5, Green: 5, Blue: 5: Alpha: 0, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 16 ]
GLJPanel.addNotify()
AiGUI:AiGUI:Exit
AiGUI:main:Exit
AWT-EventQueue-0: GLContext.setRealized(true) for context net.java.games.jogl.impl.x11.X11OnscreenGLContext@1729854
GLCanvas.addNotify()

An unexpected error has been detected by HotSpot Virtual Machine:

SIGBUS (0xa) at pc=0xf7eb87ec, pid=18111, tid=16

Java VM: Java HotSpot™ Client VM (1.5.0-b64 mixed mode, sharing)

Problematic frame:

C [libX11.so.4+0x387ec] XVisualIDFromVisual+0x4

An error …

Abort

Logfile:

An unexpected error has been detected by HotSpot Virtual Machine:

SIGBUS (0xa) at pc=0xf7eb87ec, pid=18111, tid=16

Java VM: Java HotSpot™ Client VM (1.5.0-b64 mixed mode, sharing)

Problematic frame:

C [libX11.so.4+0x387ec] XVisualIDFromVisual+0x4

--------------- T H R E A D ---------------

Current thread (0x003ec2f8): JavaThread “AWT-EventQueue-0” [_thread_in_native, id=16]

siginfo:si_signo=10, si_errno=0, si_code=1, si_addr=0x00300069

Registers:
O0=0x00300065 O1=0x00000000 O2=0xf7cfec9c O3=0x003ec2f8
O4=0xff0cfabc O5=0x00005c00 O6=0xf7cfec38 O7=0xfb8af8d0
G1=0x000e4000 G2=0x00005c00 G3=0x00000000 G4=0x00000000
G5=0x00000000 G6=0x00000000 G7=0xff271200 Y=0x000073e7
PC=0xf7eb87ec nPC=0xfb8af8d8

Top of Stack: (sp=0xf7cfec38)
0xf7cfec38: 003ec3b0 ff0b6000 fedd2898 ff0cbe4c
0xf7cfec48: fb8f5908 00000001 fedce404 ff0cbe4c
0xf7cfec58: fb8f5a80 0041d340 0041d198 0041d2a0
0xf7cfec68: fb8f0ae0 000e0f6c f7cfecf8 f7e4b8c
0xf7cfec78: ff0d00c4 00000000 00000050 000e6fb4
0xf7cfec88: ff0bd81c 000e6fb4 00000028 00000000
0xf7cfec98: 0000000c 00000000 00000000 00000000
0xf7cfeca8: 00000100 00000000 00000000 00300065

Instructions: (pc=0xf7eb87ec)
0xf7eb87dc: 00 00 00 00 00 00 00 00 00 00 00 00 81 c3 e0 08
0xf7eb87ec: d0 02 20 04 9d e3 bf a0 d0 06 24 d0 80 a2 20 00

Stack: [0xf7c80000,0xf7d00000), sp=0xf7cfec38, free space=507k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libX11.so.4+0x387ec] XVisualIDFromVisual+0x4
C [libjogl.so+0x64b94] Java_net_java_games_jogl_impl_JAWT_1DrawingSurface_GetDrawingSurfaceInfo0+0x5c
j net.java.games.jogl.impl.JAWT_DrawingSurface.GetDrawingSurfaceInfo0(Ljava/nio/Buffer;)Ljava/nio/ByteBuffer;+0
j net.java.games.jogl.impl.JAWT_DrawingSurface.GetDrawingSurfaceInfo0(Ljava/nio/Buffer;)Ljava/nio/ByteBuffer;+0
j net.java.games.jogl.impl.JAWT_DrawingSurface.GetDrawingSurfaceInfo()Lnet/java/games/jogl/impl/JAWT_DrawingSurfaceInfo;+5
j net.java.games.jogl.impl.x11.X11OnscreenGLContext.lockSurface()Z+104
j net.java.games.jogl.impl.x11.X11OnscreenGLContext.makeCurrent(Ljava/lang/Runnable;)Z+1
j net.java.games.jogl.impl.GLContext.invokeGL(Ljava/lang/Runnable;ZLjava/lang/Runnable;)V+258
j net.java.games.jogl.GLCanvas.maybeDoSingleThreadedWorkaround(Ljava/lang/Runnable;Ljava/lang/Runnable;Z)V+52
j net.java.games.jogl.GLCanvas.reshape(IIII)V+48
j java.awt.Component.setBounds(IIII)V+6
j java.awt.BorderLayout.layoutContainer(Ljava/awt/Container;)V+380
j java.awt.Container.layout()V+11
j java.awt.Container.doLayout()V+1
j java.awt.Container.validateTree()V+30
j java.awt.Container.validate()V+61
j java.awt.Window.show()V+12
j java.awt.Component.show(Z)V+5
j java.awt.Component.setVisible(Z)V+2
j net.java.games.jogl.GLJPanel$4.run()V+8
j java.awt.event.InvocationEvent.dispatch()V+47
j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+26
j java.awt.EventDispatchThread.pumpOneEventForHierarchy(ILjava/awt/Component;)Z+200
j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+26
j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j java.awt.EventDispatchThread.run()V+9
v ~StubRoutines::call_stub
V [libjvm.so+0xd96e8]
V [libjvm.so+0xef968]
V [libjvm.so+0xef7c4]
V [libjvm.so+0xef648]
V [libjvm.so+0xd2da4]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j net.java.games.jogl.impl.JAWT_DrawingSurface.GetDrawingSurfaceInfo0(Ljava/nio/Buffer;)Ljava/nio/ByteBuffer;+0
j net.java.games.jogl.impl.JAWT_DrawingSurface.GetDrawingSurfaceInfo()Lnet/java/games/jogl/impl/JAWT_DrawingSurfaceInfo;+5
j net.java.games.jogl.impl.x11.X11OnscreenGLContext.lockSurface()Z+104
j net.java.games.jogl.impl.x11.X11OnscreenGLContext.makeCurrent(Ljava/lang/Runnable;)Z+1
j net.java.games.jogl.impl.GLContext.invokeGL(Ljava/lang/Runnable;ZLjava/lang/Runnable;)V+258
j net.java.games.jogl.GLCanvas.maybeDoSingleThreadedWorkaround(Ljava/lang/Runnable;Ljava/lang/Runnable;Z)V+52
j net.java.games.jogl.GLCanvas.reshape(IIII)V+48
j java.awt.Component.setBounds(IIII)V+6
j java.awt.BorderLayout.layoutContainer(Ljava/awt/Container;)V+380
j java.awt.Container.layout()V+11
j java.awt.Container.doLayout()V+1
j java.awt.Container.validateTree()V+30
j java.awt.Container.validate()V+61
j java.awt.Window.show()V+12
j java.awt.Component.show(Z)V+5
j java.awt.Component.setVisible(Z)V+2
j net.java.games.jogl.GLJPanel$4.run()V+8
j java.awt.event.InvocationEvent.dispatch()V+47
j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+26
j java.awt.EventDispatchThread.pumpOneEventForHierarchy(ILjava/awt/Component;)Z+200
j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+26
j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j java.awt.EventDispatchThread.run()V+9
v ~StubRoutines::call_stub

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )
0x00037248 JavaThread “DestroyJavaVM” [_thread_blocked, id=1]
=>0x003ec2f8 JavaThread “AWT-EventQueue-0” [_thread_in_native, id=16]
0x00412d18 JavaThread “AWT-Shutdown” [_thread_blocked, id=15]
0x004131d0 JavaThread “AWT-Motif” daemon [_thread_blocked, id=11]
0x0013e8f0 JavaThread “Java2D Disposer” daemon [_thread_blocked, id=9]
0x000e4660 JavaThread “Low Memory Detector” daemon [_thread_blocked, id=7]
0x000e3518 JavaThread “CompilerThread0” daemon [_thread_blocked, id=6]
0x000e2758 JavaThread “Signal Dispatcher” daemon [_thread_blocked, id=5]
0x000db520 JavaThread “Finalizer” daemon [_thread_blocked, id=4]
0x000da910 JavaThread “Reference Handler” daemon [_thread_blocked, id=3]

Other Threads:
0x000d8138 VMThread [id=2]
0x000ff750 WatcherThread [id=8]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
def new generation total 2112K, used 1269K [0xccc00000, 0xcce20000, 0xcd310000)
eden space 2048K, 58% used [0xccc00000, 0xccd2d590, 0xcce00000)
from space 64K, 100% used [0xcce00000, 0xcce10000, 0xcce10000)
to space 64K, 0% used [0xcce10000, 0xcce10000, 0xcce20000)
tenured generation total 1408K, used 837K [0xcd310000, 0xcd470000, 0xd0c00000)
the space 1408K, 59% used [0xcd310000, 0xcd3e1400, 0xcd3e1400, 0xcd470000)
compacting perm gen total 8192K, used 2760K [0xd0c00000, 0xd1400000, 0xd4c00000)
the space 8192K, 33% used [0xd0c00000, 0xd0eb22c0, 0xd0eb2400, 0xd1400000)
ro space 8192K, 64% used [0xd4c00000, 0xd511f9a8, 0xd511fa00, 0xd5400000)
rw space 12288K, 44% used [0xd5400000, 0xd5953e00, 0xd5953e00, 0xd6000000)

Dynamic libraries:
0x00010000 java
0xff370000 /usr/lib/libthread.so.1
0xff3a0000 /usr/lib/libdl.so.1
0xff280000 /usr/lib/libc.so.1
0xff350000 /usr/platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1
0xfec00000 /usr/local/j2sdk1.5.0/jre/lib/sparc/client/libjvm.so
0xff240000 /usr/lib/libsocket.so.1
0xff220000 /usr/lib/libsched.so.1
0xff1e0000 /usr/lib/libCrun.so.1
0xff190000 /usr/lib/libm.so.1
0xfeb00000 /usr/lib/libnsl.so.1
0xff260000 /usr/lib/libw.so.1
0xff160000 /usr/lib/libmp.so.2
0xff110000 /usr/local/j2sdk1.5.0/jre/lib/sparc/native_threads/libhpi.so
0xfebc0000 /usr/local/j2sdk1.5.0/jre/lib/sparc/libverify.so
0xfeac0000 /usr/local/j2sdk1.5.0/jre/lib/sparc/libjava.so
0xfeaa0000 /usr/local/j2sdk1.5.0/jre/lib/sparc/libzip.so
0xf8380000 /usr/local/j2sdk1.5.0/jre/lib/sparc/libawt.so
0xf8200000 /usr/local/j2sdk1.5.0/jre/lib/sparc/libmlib_image.so
0xfb880000 /usr/local/j2sdk1.5.0/jre/lib/sparc/motif21/libmawt.so
0xf7f80000 /usr/lib/libXm.so.4
0xfe3b0000 /usr/lib/libXp.so.1
0xfbb90000 /usr/lib/libXt.so.4
0xfe1d0000 /usr/lib/libXext.so.0
0xfe390000 /usr/lib/libXtst.so.1
0xf7e80000 /usr/lib/libX11.so.4
0xfbae0000 /usr/lib/libSM.so.6
0xfbab0000 /usr/lib/libICE.so.6
0xfac80000 /usr/local/j2sdk1.5.0/jre/lib/sparc/libfontmanager.so
0xfb9d0000 /usr/local/j2sdk1.5.0/jre/lib/sparc/libnet.so
0xfba90000 /usr/local/j2sdk1.5.0/jre/lib/sparc/libnio.so
0xfb9b0000 /usr/lib/librt.so.1
0xfb990000 /usr/lib/libaio.so.1
0xfb860000 /usr/lib/libmd5.so.1
0xfafe0000 /usr/lib/libsendfile.so.1
0xfafc0000 /usr/local/j2sdk1.5.0/jre/lib/sparc/libjawt.so
0xf7780000 /home/stu12/s17/username/public_html/MastersProjectWin/libjogl.so
0xf7600000 /usr/lib/libGL.so.1
0xf7500000 /usr/lib/libGLU.so.1
0xfaed0000 /usr/lib/libXmu.so.4
0xfaea0000 /usr/openwin/lib/libdga.so.1
0xfe290000 /usr/lib/libintl.so.1

VM Arguments:
jvm_args: -Djogl.debug -Djava.library.path=.
java_command: AiGUI

Environment Variables:
JAVA_HOME=/usr/local/jdk
CLASSPATH=.:/home/stu12/s17/username/classes:/home/course/fyj/classes
PATH=/usr/local/bin:.:/home/stu12/s17/username/bin:/usr/local/jdk/bin:/usr/local/ant/bin:/usr/local/gnu/bin:/usr/local/lang/bin:/usr/local/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/usr/local/Eiffel51/studio/spec/solaris-2.5+/bin:/usr/local/share/texmf/bin:/usr/java/bin:/usr/local/X11/bin:/usr/openwin/bin:/usr/dt/bin:/usr/local/together/bin:/usr/local/firefox
LD_LIBRARY_PATH=/usr/local/j2sdk1.5.0/jre/lib/sparc/client:/usr/local/j2sdk1.5.0/jre/lib/sparc:/usr/local/j2sdk1.5.0/jre/…/lib/sparc:/home/stu12/s17/username/lib:/usr/local/jdk/lib:/usr/local/gnu/lib:/usr/local/lang/lib:/usr/local/lib:/usr/lib:/usr/ccs/lib:/usr/local/Eiffel51/studio/spec/solaris-2.5+/lib:/usr/local/share/texmf/lib:/usr/java/lib:/usr/local/X11/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/together/lib:/usr/sfw/lib:/usr/local/gnu.old/lib
SHELL=/bin/csh
DISPLAY=localhost:10.0
HOSTTYPE=sparc
OSTYPE=solaris2.9
MACHTYPE=sparc-sun-solaris2.9

--------------- S Y S T E M ---------------

OS: Solaris 9 s9_58shwpl3 SPARC
Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 15 April 2002

uname:SunOS 5.9 Generic_117171-01 sun4u (T2 libthread)
rlimit: STACK 8192k, CORE infinity, NOFILE 65536, AS infinity
load average:0.10 0.12 0.12

CPU:total 1 has_v8, has_v9, has_vis1

Memory: 8k page, physical 524288k(227768k free)

vm_info: Java HotSpot™ Client VM (1.5.0-b64) for solaris-sparc, built on Sep 15 2004 04:46:59 by unknown with unknown Workshop:0x550

Does the Gears demo work on your machine? This looks like some crashes in earlier JOGL releases on some X11 platforms which have been fixed in the latest release. Are you sure you’re running build 1.1.1? What is the output of java -Djogl.verbose demos.printext.PrintExt?

Hi,
On a lark, I modified the program by switching from a GLJPanel to a GLCanvas, recompiled and the program doesn’t crash anymore. Unfortuniately there developed three issues with this:
1. The program window doesn’t initially display at the size I want it to, it displays smaller, but I can live with that.
2. I have a JComboBox in a toolbar, which when drops down gets coverd by the GLCanvas. But I think the thread
(http://192.18.37.44/forums/index.php?topic=11108.0) will give me a solution to that.
3. The MouseListener doesn’t pickup the mouse clicks in the area of the GLCanvas (The GLCanvas is placed in a JPanel).
Looking at the javadoc on GLCanvas, I see the inherited method addMouseListener from java.awt.Component, so I’m going to
try adding the MouseListener to the canvas and not to the JPanel the GLCanvas is in.

So why would using a GLJPanel result in a crash, and using a GLCanvas result in mostly perfect operation?

I didn’t use the Gears demo, but I did use a modified (I added a windows close listener) Point drawing demo program by Jim X. Chen(http://cs.gmu.edu/~jchen/graphics/jogl/index.html), and that worked fine. I’ve tried avoiding bring down the offical demos becase of the amout of space that would take up on my student account, but I’ll try moving suff out and see if I can run the Gears demo. For the output I posted earilier, yes I’m sure I used build 1.1.1.

Thanks,
nova dragoon

A substantial rewrite of the GLJPanel has been done and is forthcoming in the next JOGL release. I think this will probably clear up the issues you’ve seen; it has fixed other problems in the 1.1.1 release. You can check out and build these sources yourself, or wait roughly a week for the next build:


cvs -d :pserver:guest@cvs.dev.java.net:/cvs co -r JSR-231 -P jogl jogl-demos