Hard crash in Windows XP

Hi,

Using JOGL version 1.0.0 (same issue with 1.1.0 RC3), JRE 1.5.0_11, Windows XP, and IBM X31 with Mobility Radeon.

On Windows, running the program crashes on startup. The log is pasted below. I have very little experience debugging this type of hard crash. Is this a known issue, something to write up a bug-report on, or something that I am doing wrong?

The same code that generates the error runs well on the same machine under SuSe linux.

I will post the offending code if someone needs it, but it’s rather long. I haven’t been able to replicate the problem in a simple manner (most JOGL code runs fine). If you need more than the error log, please let me know.

Thanks very much for all responses!
Charles

`

An unexpected error has been detected by HotSpot Virtual Machine:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0c71dfb9, pid=2444, tid=664

Java VM: Java HotSpot™ Client VM (1.5.0_11-b03 mixed mode)

Problematic frame:

C [atioglx1.dll+0xedfb9]

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

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

siginfo: ExceptionCode=0xc0000005, reading address 0x0fee0000

Registers:
EAX=0x2fe00002, EBX=0x0ffb0268, ECX=0x2fdffc9a, EDX=0xbf800008
ESP=0x0c43f42c, EBP=0x0fedf260, ESI=0x0fee0000, EDI=0x0ffb1008
EIP=0x0c71dfb9, EFLAGS=0x00010202

Top of Stack: (sp=0x0c43f42c)
0x0c43f42c: 0c43f5d4 0ffb0028 00000200 0ccf7fc0
0x0c43f43c: 00000000 bcd0369d 0ffb0200 0ffb020c
0x0c43f44c: 0ffb0204 0ffb0210 0ffb0208 0ffb0214
0x0c43f45c: 0ffb01fc 0ffb01f4 0ffb01f8 0fedf440
0x0c43f46c: 0fedf0b8 00000000 0ffb0050 0c729a60
0x0c43f47c: 0ccf7fc0 0ffb0028 0c43f498 0ae0a670
0x0c43f48c: 0ccf7fc0 0c43f5dc 0ffb0028 00000200
0x0c43f49c: 00000005 00000005 00000000 00000014

Instructions: (pc=0x0c71dfb9)
0x0c71dfa9: 00 00 00 89 10 eb 19 8b d1 c1 e9 02 8b f5 8b fb
0x0c71dfb9: f3 a5 8b ca c1 e0 02 83 e1 03 03 d8 f3 a4 03 e8

Stack: [0x0c400000,0x0c440000), sp=0x0c43f42c, free space=253k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [atioglx1.dll+0xedfb9]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.sun.opengl.impl.GLImpl.glEndList()V+0
j DrawPromoter.initPromoters(Ljavax/media/opengl/GL;)V+163
j DrawPromoter.init(Ljavax/media/opengl/GLAutoDrawable;)V+35
j com.sun.opengl.impl.GLDrawableHelper.init(Ljavax/media/opengl/GLAutoDrawable;)V+29
j javax.media.opengl.GLCanvas$InitAction.run()V+11
j com.sun.opengl.impl.GLDrawableHelper.invokeGL(Ljavax/media/opengl/GLDrawable;Ljavax/media/opengl/GLContext;Ljava/lang/Runnable;Ljava/lang/Runnable;)V+370
j javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(Ljava/lang/Runnable;Ljava/lang/Runnable;)V+36
j javax.media.opengl.GLCanvas.display()V+9
j javax.media.opengl.GLCanvas.paint(Ljava/awt/Graphics;)V+1
j sun.awt.RepaintArea.paintComponent(Ljava/awt/Component;Ljava/awt/Graphics;)V+6
j sun.awt.RepaintArea.paint(Ljava/lang/Object;Z)V+326
j sun.awt.windows.WComponentPeer.handleEvent(Ljava/awt/AWTEvent;)V+63
j java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+805
j java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+46
j java.awt.EventDispatchThread.pumpOneEventForHierarchy(ILjava/awt/Component;)Z+233
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 )
0x000368e8 JavaThread “DestroyJavaVM” [_thread_blocked, id=3748]
=>0x0ae0a670 JavaThread “AWT-EventQueue-0” [_thread_in_native, id=664]
0x0adccd90 JavaThread “AWT-Windows” daemon [_thread_in_native, id=2324]
0x0ae86e70 JavaThread “AWT-Shutdown” [_thread_blocked, id=3188]
0x0ae71008 JavaThread “Java2D Disposer” daemon [_thread_blocked, id=2724]
0x00a953c8 JavaThread “Low Memory Detector” daemon [_thread_blocked, id=2180]
0x00a94068 JavaThread “CompilerThread0” daemon [_thread_blocked, id=3352]
0x00a934d8 JavaThread “Signal Dispatcher” daemon [_thread_blocked, id=652]
0x00a89fa0 JavaThread “Finalizer” daemon [_thread_blocked, id=2816]
0x00a88b30 JavaThread “Reference Handler” daemon [_thread_blocked, id=3548]

Other Threads:
0x00a848f0 VMThread [id=716]
0x00a932a8 WatcherThread [id=176]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
def new generation total 576K, used 112K [0x02ad0000, 0x02b70000, 0x02fb0000)
eden space 512K, 9% used [0x02ad0000, 0x02adc030, 0x02b50000)
from space 64K, 99% used [0x02b60000, 0x02b6fff8, 0x02b70000)
to space 64K, 0% used [0x02b50000, 0x02b50000, 0x02b60000)
tenured generation total 1408K, used 1270K [0x02fb0000, 0x03110000, 0x06ad0000)
the space 1408K, 90% used [0x02fb0000, 0x030edb38, 0x030edc00, 0x03110000)
compacting perm gen total 9728K, used 9558K [0x06ad0000, 0x07450000, 0x0aad0000)
the space 9728K, 98% used [0x06ad0000, 0x07425888, 0x07425a00, 0x07450000)
No shared spaces configured.

Dynamic libraries:
0x00400000 - 0x0040d000 C:\WINDOWS\system32\java.exe
0x7c900000 - 0x7c9b0000 C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f4000 C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f01000 C:\WINDOWS\system32\RPCRT4.dll
0x77c10000 - 0x77c68000 C:\WINDOWS\system32\MSVCRT.dll
0x6d640000 - 0x6d7dd000 C:\Program Files\Java\jre1.5.0_11\bin\client\jvm.dll
0x77d40000 - 0x77dd0000 C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f57000 C:\WINDOWS\system32\GDI32.dll
0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.DLL
0x629c0000 - 0x629c9000 C:\WINDOWS\system32\LPK.DLL
0x74d90000 - 0x74dfb000 C:\WINDOWS\system32\USP10.dll
0x6d290000 - 0x6d298000 C:\Program Files\Java\jre1.5.0_11\bin\hpi.dll
0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
0x6d610000 - 0x6d61c000 C:\Program Files\Java\jre1.5.0_11\bin\verify.dll
0x6d310000 - 0x6d32d000 C:\Program Files\Java\jre1.5.0_11\bin\java.dll
0x6d630000 - 0x6d63f000 C:\Program Files\Java\jre1.5.0_11\bin\zip.dll
0x6d000000 - 0x6d16a000 C:\Program Files\Java\jre1.5.0_11\bin\awt.dll
0x73000000 - 0x73026000 C:\WINDOWS\system32\WINSPOOL.DRV
0x774e0000 - 0x7761d000 C:\WINDOWS\system32\ole32.dll
0x10000000 - 0x10047000 C:\WINDOWS\system32\jogl.dll
0x5ed00000 - 0x5edcc000 C:\WINDOWS\system32\OPENGL32.dll
0x68b20000 - 0x68b40000 C:\WINDOWS\system32\GLU32.dll
0x73760000 - 0x737a9000 C:\WINDOWS\system32\DDRAW.dll
0x73bc0000 - 0x73bc6000 C:\WINDOWS\system32\DCIMAN32.dll
0x5ad70000 - 0x5ada8000 C:\WINDOWS\system32\uxtheme.dll
0x6d240000 - 0x6d290000 C:\Program Files\Java\jre1.5.0_11\bin\fontmanager.dll
0x74720000 - 0x7476b000 C:\WINDOWS\system32\MSCTF.dll
0x755c0000 - 0x755ee000 C:\WINDOWS\system32\msctfime.ime
0x7c9c0000 - 0x7d1d5000 C:\WINDOWS\system32\shell32.dll
0x77f60000 - 0x77fd6000 C:\WINDOWS\system32\SHLWAPI.dll
0x773d0000 - 0x774d3000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll
0x5d090000 - 0x5d12a000 C:\WINDOWS\system32\comctl32.dll
0x6d370000 - 0x6d376000 C:\Program Files\Java\jre1.5.0_11\bin\jawt.dll
0x0c480000 - 0x0c485000 C:\WINDOWS\system32\jogl_awt.dll
0x77120000 - 0x771ac000 C:\WINDOWS\system32\OLEAUT32.DLL
0x69000000 - 0x694b1000 C:\WINDOWS\system32\atioglxx.dll
0x0c630000 - 0x0cca7000 C:\WINDOWS\system32\atioglx1.dll
0x6d4d0000 - 0x6d4e3000 C:\Program Files\Java\jre1.5.0_11\bin\net.dll
0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll
0x6d4f0000 - 0x6d4f9000 C:\Program Files\Java\jre1.5.0_11\bin\nio.dll

VM Arguments:
java_command: PromoterMapper
Launcher Type: SUN_STANDARD

Environment Variables:
CLASSPATH=.;D:\Snow\Transcriptional Regulation Project\bin\JOGL\biojava\biojava-1.5-beta2.jar;D:\Snow\Transcriptional Regulation Project\bin\JOGL\biojava\bytecode-0.92.jar;D:\Snow\Transcriptional Regulation Project\bin\JOGL\biojava\commons-cli.jar;D:\Snow\Transcriptional Regulation Project\bin\JOGL\biojava\commons-collections-2.1.jar;D:\Snow\Transcriptional Regulation Project\bin\JOGL\biojava\commons-dbcp-1.1.jar;D:\Snow\Transcriptional Regulation Project\bin\JOGL\biojava\commons-pool-1.1.jar;D:\Snow\Transcriptional Regulation Project\bin\JOGL\jogl-1_0_0-windows-i586\lib\jogl.jar
PATH=C:\PROGRAM FILES\THINKPAD\UTILITIES;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\IBMTOOLS\Python22;C:\Program Files\Java\jdk1.5.0_08\bin
USERNAME=Operative Snow
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 9 Stepping 5, GenuineIntel

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

OS: Windows XP Build 2600 Service Pack 2

CPU:total 1 (cores per cpu 1, threads per core 1) family 6 model 9 stepping 5, cmov, cx8, fxsr, mmx, sse, sse2

Memory: 4k page, physical 1047472k(612120k free), swap 1736292k(1327048k free)

vm_info: Java HotSpot™ Client VM (1.5.0_11-b03) for windows-x86, built on Dec 15 2006 01:16:12 by “java_re” with MS VC++ 6.0

`

Sounds like a driver bug triggered by buggy OpenGL code. Try installing a DebugGL pipeline as the first operation in your GLEventListener.init() and see if it reports any errors before the crash occurs.

You might also want to see if there are any driver updates available for the Mobility Radeon in the machine.

Thanks very much for the response!

The first line of my .init(GLAutoDrawable drawable) function now reads:
drawable.setGL(new DebugGL(drawable.getGL()));

followed the setup instructions in this link:
http://www.tml.tkk.fi/Opinnot/T-111.4300/exercises/jogl_javadoc/net/java/games/jogl/DebugGL.html

No GLException is thrown … the same crash still results like before.

I double checked to be certain that I was not catching any exceptions without reporting them - there are no places where I catch either Exception or GLException in the in the class that implements GLEventListener (the only catch block in that class catches ArrayIndexOutOfBoundsException).

Am I implementing DebugGL properly?

Looking closely at the error log, the “Current thread” (presumably current at the time of crash) is “AWT-EventQueue-0”. Is this normal for a crash caused by JOGL? Could this a conflict between JOGL and AWT? (This is obviously just me speculating wildly.)

What’s the next step?

As for driver updates … I’m using the most recent distributed by ATI. Unfortunately, the mobility radeon video card is pretty much outdated, and I don’t really expect the drivers to be updated again by either ATI or IBM. I could try rolling back to the last IBM release if you think these may be more stable??

Thanks again for all the help!
Charles

You’re using the DebugGL properly. Given that it isn’t catching what is going wrong, I would recommend you simplify your OpenGL code drastically (probably just by commenting out large pieces of it) and add it back in bit by bit until you find the thing that’s causing the crash. It is probably something you’re doing wrong in the building of your display list based on the crash log you’ve posted.

I was able to boil the problem down to something simple and can now reproduce the problem in a simple program.

The crash occurs when I create a display list that contains both GL primitives AND GLUT bitmap text (I haven’t tried any other GLUT objects). I create a display list that contains either one alone, no crash, but using both together in a single display list, crash.

I’ve reproduced the crash by modifying the redbook Triangle program, pasted below the message.

This code produces the crash:


gl.glNewList(DisplayList, GL.GL_COMPILE);
            createTriangle(gl);
            createText(gl);
gl.glEndList();

Commenting either the createTriangle function or the createText function allows the code to run normally…

Knowing this, I could create separate display lists for text and primitives. Is there a simple fix that can keep my code neat and simple? Should submit this as a bug somewhere?

Thanks for being so helpful!
Charles


import java.awt.*;
import java.awt.event.*;
import java.util.logging.*;
import javax.media.opengl.*;
 
import com.sun.opengl.util.GLUT;
import com.sun.opengl.util.Animator;
 
public class Triangle implements GLEventListener {
 
// Statics -----------------------------------------------------------------
 
private final Logger LOG = Logger.getLogger(Triangle.class.getName());
 
private int DisplayList;
 
public static void main(String[] args) {
Frame frame = new Frame("Triangle Demo");
 
GLCapabilities capabilities = new GLCapabilities();
capabilities.setHardwareAccelerated(false);
 
GLCanvas canvas = new GLCanvas();
canvas.addGLEventListener(new Triangle());
 
frame.add(canvas);
frame.setSize(512, 512);
 
final Animator animator = new Animator(canvas);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
new Thread(new Runnable() {
public void run() {
animator.stop();
System.exit(0);
}
}).start();
}
});
frame.setVisible(true);
animator.start();
}
 
// Constructors ------------------------------------------------------------
 
public Triangle() {
}
 
// GLEventListener ---------------------------------------------------------
 
public void createTriangle(GL gl) {
            gl.glBegin(GL.GL_TRIANGLES);
                        gl.glVertex3f(0.0F, 0.0F, 0.0F);
                        gl.glVertex3f(1.0F, 0.0F, 0.0F);
                        gl.glVertex3f(1.0F, 1.0F, 0.0F);
            gl.glEnd();
}
 
public void createText(GL gl) {
            GLUT glut = new GLUT();
            gl.glColor3f(1F,1F,1F);
            gl.glRasterPos2f(0.5F,0.5F);
            glut.glutBitmapString(GLUT.BITMAP_HELVETICA_12, "String");
}
 
public void init(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
if (LOG.isLoggable(Level.FINE))
LOG.fine("Init GL is " + gl.getClass().getName());
 
DisplayList = gl.glGenLists(1);
gl.glNewList(DisplayList, GL.GL_COMPILE);
            createTriangle(gl);
            createText(gl);
gl.glEndList();
 
}
 
public void display(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glLoadIdentity();
gl.glColor3f(1F, 0F, 0F);
 
gl.glCallList(DisplayList);
}
 
public void reshape(GLAutoDrawable drawable, int i, int i1, int i2, int i3) {
}
 
public void displayChanged(GLAutoDrawable drawable, boolean b, boolean b1) {
}
}

I think one or the other function may be calling OpenGL routines that can’t be legally compiled into a display list. You should look deeper into them before thinking about filing a bug (with ATI).

Hmm…I’ve looked for awhile now and haven’t found anything that would lead me to believe one of the routines can’t be compiled into a display list. At least, none of the functions I use are included in the list of unsupported functions: (http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html). Finally, unsupported functions are executed immediately, and should not cause this type of crash (a second call to glNewList generates an error).

Perhaps it’s that I am creating the GLUT object inside the display list? I’ll try more commenting and post if I find anything else that may be useful to others.

In any case, thanks for responding to everything! I’ve learned a lot from this.

EDIT:
Creating the GLUT object in the display list seems to be fine.
Commenting just the call to glutBitmapString solves the problem. I was unable to find any note that glutBitmapString is incomputable with display lists; however, I am still new to OpenGL and may have missed something.
It’s worth noting that I found plenty of programs that use other glut calls inside display lists. The obvious difference between these, however, is that most glut objects are stored as vectors whereas glutBitmapString is rasterized. I can’t imagine this would be a problem with display lists, though.

I have what I need now, though. Thanks for the help!