HotSpot failure.. :(

I’m constantly getting this:


# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0652fb7e, pid=148, tid=3536
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-beta-b32c mixed mode)
# Problematic frame:
# C  0x0652fb7e
#

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

Current thread (0x00b57ea0):  JavaThread "Thread-3" [_thread_in_native, id=3536]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000

Registers:
EAX=0x088f14d8, EBX=0x01eb00c0, ECX=0x00000000, EDX=0x00000024
ESP=0x060ff570, EBP=0x060ff57c, ESI=0x00000000, EDI=0x00000000
EIP=0x0652fb7e, EFLAGS=0x00010206

Top of Stack: (sp=0x060ff570)
0x060ff570:   00000024 01eb00c0 00000024 00000000
0x060ff580:   69713c45 01eb00c0 088f14d4 00000000
0x060ff590:   00000024 060ff5f8 00000004 01eb00c0
0x060ff5a0:   00b57ea0 00000008 00000000 0000003f
0x060ff5b0:   0652fb50 695ca7ec 01eb00c0 00000004
0x060ff5c0:   00000000 00000024 6f3d0d20 1000faf5
0x060ff5d0:   00000004 00000000 00000024 7d7fcc95
0x060ff5e0:   00b57f5c 060ff60c 00000004 00000000 

Instructions: (pc=0x0652fb7e)
0x0652fb6e:   30 83 c0 04 8b 35 38 61 eb 01 8d 3c 49 8d 34 be
0x0652fb7e:   8b 3e 8b 6e 04 89 38 89 68 04 8b 7e 08 89 78 08 


Stack: [0x06000000,0x06100000),  sp=0x060ff570,  free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x0652fb7e

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J  net.java.games.jogl.impl.windows.WindowsGLImpl.glDrawArrays(III)V
J  com.xith3d.render.jogl.ShapeAtomPeer.drawGeometry(Lcom/xith3d/render/CanvasPeer;Lnet/java/games/jogl/GL;Lcom/xith3d/scenegraph/GeometryArray;)V
J  com.xith3d.render.jogl.ShapeAtomPeer.renderAtom(Lcom/xith3d/render/CanvasPeer;Lcom/xith3d/render/RenderAtom;)V
J  com.xith3d.render.CanvasPeerBase.render(Lcom/xith3d/render/RenderAtom;)V
J  com.xith3d.render.jogl.CanvasPeerImpl.drawBin(Lnet/java/games/jogl/GL;Lcom/xith3d/render/RenderBin;)V
J  com.xith3d.render.jogl.CanvasPeerImpl.display(Lnet/java/games/jogl/GLDrawable;)V
J  net.java.games.jogl.impl.GLDrawableHelper.display(Lnet/java/games/jogl/GLDrawable;)V
j  net.java.games.jogl.GLCanvas$DisplayAction.run()V+11
j  net.java.games.jogl.impl.GLContext.invokeGL(Ljava/lang/Runnable;ZLjava/lang/Runnable;)V+268
j  net.java.games.jogl.GLCanvas.displayImpl()V+13
j  net.java.games.jogl.GLCanvas.display()V+1
j  com.xith3d.render.jogl.CanvasPeerImpl.render(Lcom/xith3d/render/RenderFrame;)V+79
j  com.xith3d.scenegraph.View.renderOnce(Lcom/xith3d/scenegraph/Canvas3D;)V+53
J  com.xith3d.scenegraph.View.renderOnce()V
v  ~RuntimeStub::alignment_frame_return Runtime1 stub
j  third.Player.run()V+106
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub
...

It’s probably a JOGL thing right? But do people using Xith get these? Are they common? I’ve the newest available version of jogl (version 1.0alpha), but will try to compile the one on their CVS later on, and see if it anything changes.

I think the fault is probably mine, because I don’t really know how I should deal with creating a new thread to render a new canvas with a different view and universe.

I get the problem when I create a new canvas, and new universe, but using objects from another universe. I “try” to clone them when possible, but cloning things in Xith is not always guaranteed.

Should there be a violation if I try to render the same shape in two different canvas, using different views?

I’m trying many things to try solve this, but any insights or directions are most appreciated.

ps: what’s the way people use to pause the rendering thread? Using .wait() and notify()? Using a pause boolean and while loop?

Which version of Xith3D do you currently use?

Yuri

The current one from CVS, with some minor modifications to ShaperAtomPeer to allow the rendering of quadrics.

Now, the weird part is that the crash only occurs when the objects in my scene ARE NOT of a QuadricSphere type. Very strange.

Do you think that’s breaking the code? I will try using the exact version from CVS (without quadrics) and see what happens. I’ll trying to isolate the problem, and will let you know ;p

What are the ways net.java.games.jogl.impl.windows.WindowsGLImpl.glDrawArrays could cause such ACCESS_VIOLATION? Have you come across those errors before?

I too am getting HotSpot crashes.

In the demo HelloXith3D, replace


// create Cube
Geometry g = Cube.createCubeViaTriangles(0, 0, 0, 1, true);
Shape3D sh = new Shape3D(g);
objRotate.addChild(sh);

with


// create Cube
Geometry g = Cube.createCubeViaTriangles(0, 0, 0, 1, true);
Appearance a=new Appearance();
PolygonAttributes p=new PolygonAttributes();
p.setPolygonMode(PolygonAttributes.POLYGON_LINE);
a.setPolygonAttributes(p);
Shape3D sh=new Shape3D(g, a);
objRotate.addChild(sh);

This causes my program to crash with a


#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6934852b, pid=1820, tid=2024
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-beta-b32c mixed mode)
# Problematic frame:
# C  [atioglxx.dll+0x34852b]
#
# An error report file with more information is saved as hs_err_pid1820.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

Commenting out the line
// p.setPolygonMode(PolygonAttributes.POLYGON_LINE);
eliminates the crash.

In fact, setting POLYGON_LINE crashes several, but not all, geometric primitives I’ve been playing with.
Am I doing something wrong, or is this a bug?
FWIW, I’m using Xith3D_2004-02-29_cvs.tar.gz

Thanks,
Daniel

Hmm… strange isn’t? ???

I’m going to try to run it with Java 1.4 and see if it continues. It might be related. Since it’s still a beta relase we might have to leave with that. Should these Exceptions be notified to Sun?