Display freezes after JOGL animation

Hello!

I have a funny problem. Have been running some JOGL examples, and every time there is some sort of animation, after a random time interval, the display on my laptop freezes. This happens on any animation (Simple rotating cube). Im using archlinux, running XOrg 6.8.2 with Mesa 6.2, KDE 3.4 and jdk1.5.0_01. (My GPU is a SIS 630 (300 series) ).

Tried it on Slackware aswell, on the same machine getting the same results. Funny thing is that the computer itself doesnt freeze, just the display (I can turn it off safely using the keyboard). Tried to debug, but there is no relevant information to find in any of the relevant *.log files.

Thats why I tried Java3D and LWJGL, but no luck. Simple rotating cube code still freezes the display (On both slackware and archlinux).

So I was wondering if there are more people having the same problem? I dont know much about OpenGL, but I guess that something as simple as a rotating cube is pretty safe code, therefore this must be a problem with Mesa and my GPU. Alternatively, maybe something can be done in the code to avoid this kind of things?

Thank you!
Gunnar

BTW: This doesnt happen on WindowsXP.

EDIT::

Downloaded the jogl 1.1.b09 and ran the testContextDestruction demo in demos.jar. This generated an error file (hs_err_pid5488.log). There is obviously a problem with the sis_dri.so. Display didnt freeze though. But rotating cube still freezes the screen. :-[

#Below is the error (had to edit it for size…):

An unexpected error has been detected by HotSpot Virtual Machine:

SIGSEGV (0xb) at pc=0xb14615dd, pid=5488, tid=2901576624

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

Problematic frame:

C [sis_dri.so+0x1505dd]

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

Current thread (0x0865dc20): JavaThread “Thread-1” [_thread_in_native, id=5502]

siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00000050

Registers:
(REMOVED)

Top of Stack: (sp=0xacf27be4)
(REMOVED)

Instructions: (pc=0xb14615dd)
(REMOVED)

Stack: [0xacea8000,0xacf29000), sp=0xacf27be4, free space=510k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [sis_dri.so+0x1505dd]
C [sis_dri.so+0x15127f]
C [libGL.so.1+0x4638d]
C [libGL.so.1+0x467d8] glXCreateContext+0x38
C [libjogl.so+0xc09a2] Java_net_java_games_jogl_impl_x11_GLX_glXCreateContext0+0x76
j net.java.games.jogl.impl.x11.GLX.glXCreateContext0(JLjava/nio/Buffer;JZ)J+0
j net.java.games.jogl.impl.x11.GLX.glXCreateContext(JLnet/java/games/jogl/impl/x11/XVisualInfo;JZ)J+16
j net.java.games.jogl.impl.x11.X11GLContext.createContext(Lnet/java/games/jogl/impl/x11/XVisualInfo;Z)J+46
j net.java.games.jogl.impl.x11.X11GLContext.chooseVisualAndCreateContext(Z)V+9
j net.java.games.jogl.impl.x11.X11OnscreenGLContext.create()V+2
j net.java.games.jogl.impl.x11.X11GLContext.makeCurrent(Ljava/lang/Runnable;)Z+12
j net.java.games.jogl.impl.x11.X11OnscreenGLContext.makeCurrent(Ljava/lang/Runnable;)Z+11
J net.java.games.jogl.impl.GLContext.invokeGL(Ljava/lang/Runnable;ZLjava/lang/Runnable;)V
J net.java.games.jogl.GLCanvas.withSingleThreadedWorkaroundDo(Ljava/lang/Runnable;Ljava/lang/Runnable;Z)V
J net.java.games.jogl.Animator$1.run()V
v ~OSRAdapter
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
V [libjvm.so+0x168c1c]
V [libjvm.so+0x254668]
V [libjvm.so+0x168475]
V [libjvm.so+0x16850e]
V [libjvm.so+0x1d2e05]
V [libjvm.so+0x2ad55d]
V [libjvm.so+0x255178]
C [libpthread.so.0+0x5d64]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j net.java.games.jogl.impl.x11.GLX.glXCreateContext0(JLjava/nio/Buffer;JZ)J+0
j net.java.games.jogl.impl.x11.GLX.glXCreateContext(JLnet/java/games/jogl/impl/x11/XVisualInfo;JZ)J+16
j net.java.games.jogl.impl.x11.X11GLContext.createContext(Lnet/java/games/jogl/impl/x11/XVisualInfo;Z)J+46
j net.java.games.jogl.impl.x11.X11GLContext.chooseVisualAndCreateContext(Z)V+9
j net.java.games.jogl.impl.x11.X11OnscreenGLContext.create()V+2
j net.java.games.jogl.impl.x11.X11GLContext.makeCurrent(Ljava/lang/Runnable;)Z+12
j net.java.games.jogl.impl.x11.X11OnscreenGLContext.makeCurrent(Ljava/lang/Runnable;)Z+11
J net.java.games.jogl.impl.GLContext.invokeGL(Ljava/lang/Runnable;ZLjava/lang/Runnable;)V
J net.java.games.jogl.GLCanvas.withSingleThreadedWorkaroundDo(Ljava/lang/Runnable;Ljava/lang/Runnable;Z)V
J net.java.games.jogl.Animator$1.run()V
v ~OSRAdapter
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub

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

#HAD TO REMOVE LOTS OF STUFF HERE:…
--------------- S Y S T E M ---------------

OS:Linux
uname:Linux 2.6.10 #2 SMP Sun Feb 13 23:46:11 CET 2005 i686
libc:glibc 2.3.3 NPTL 2.3.3
rlimit: STACK 8192k, CORE 0k, NPROC 3839, NOFILE 1024, AS infinity
load average:0.39 0.25 0.24

CPU:total 1 family 6, cmov, cx8, fxsr, mmx, sse

Memory: 4k page, physical 482196k(60800k free), swap 1000432k(1000432k free)

vm_info: Java HotSpot™ Client VM (1.5.0_01-b08) for linux-x86, built on Dec 6 2004 20:41:12 by java_re with gcc 3.2.1-7a (J2SE release)

You should find the C sources for the glxgears demo and try compiling and running it. If it crashes, try upgrading your display drivers, and if it still crashes then file a bug with SiS if they have a web site for feedback. Other than that the only thing I can suggest is to upgrade to a more modern chipset…NVidia’s hardware and drivers are the most robust, but even ATI’s seem to be better quality than what you’re reporting.

Thanx for your reply.

Strange thing is, that GLXGears runs without problems, both the C and Java versions. None of the OpenGL screensavers, nor Tuxracer ever freezes. But using JOGL, LWJGL or Java3D, even a simple rotating cube makes the display freeze.

And of course, the linux support from SIS is non-existing. There is one guy ( Thomas Winischhofer http://www.winischhofer.at/linuxsispart1.shtml ) both writing and maintaining the drivers. But he sais that he ignores all questions regarding DRI crashing machines and such. Also tested the JME engine (http://jmonkeyengine.com/) and I couldnt get any demos running. This is an abstraction layer on top of LWJGL and all of them froze the display. But this time I was able to kill X by CTRL-ALT-BACKSPACE and the display starts to respond again, I havent been able to do that before. No matter what, this is max annoying, as Im itching to write code in JOGL.

Anyway, I guess the best solution would be to invest in a card produced by NVidia, as they seem to take the linux community a bit more serious then the other manufacturers.

I would guess that the thread-local storage mechanism being used by your OpenGL drivers conflicts with the TLS mechanism in the JVM. ATI’s drivers seem to have an option to use a slower but more compatible TLS mechanism. You might want to see if your drivers have a similar option.