Multiple Canvas errors

I have a runtime error when I actualise for the 7th time two View/Canvas.
This is very strange.
I’ve created a JFrame and have added to JPanel to it. I made Canvas of them, and then render a scene with two different views in them.
What’s the problem ?
Maybe cylab ( Xith3D in Netbeans thread ) can help me… :slight_smile:

Here’s the log of the VM :

`

An unexpected error has been detected by HotSpot Virtual Machine:

SIGSEGV (0xb) at pc=0xaf930b32, pid=13772, tid=3086776800

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

Problematic frame:

C 0xaf930b32

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

Current thread (0x0805b880): JavaThread “main” [_thread_in_native, id=13772]

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

Registers:
EAX=0xb050b9a0, EBX=0x0821b9c0, ECX=0x00000000, EDX=0x00000024
ESP=0xbfffd008, EBP=0xbfffd014, ESI=0x00000000, EDI=0x00000000
EIP=0xaf930b32, CR2=0x00000000, EFLAGS=0x00010296

Top of Stack: (sp=0xbfffd008)
0xbfffd008: af930b00 0821b9c0 00000024 00000000
0xbfffd018: b0fed154 0821b9c0 b050b99c 00000000
0xbfffd028: 00000024 0837eef0 0821b9c0 00000000
0xbfffd038: 00000024 00000000 00000006 00000055
0xbfffd048: af930b00 0837eef0 082248e8 b0feebb7
0xbfffd058: 0821b9c0 00000004 00000000 00000024
0xbfffd068: 0821b9c0 00000024 00000000 00000004
0xbfffd078: 00000000 082248e8 b0e21271 0821b9c0

Instructions: (pc=0xaf930b32)
0xaf930b22: 04 8b 35 dc 4d 22 08 8b 76 54 8d 3c 49 8d 34 be
0xaf930b32: 8b 3e 8b 6e 04 89 38 89 68 04 8b 7e 08 89 78 08

Stack: [0xbfe00000,0xc0000000), sp=0xbfffd008, free space=2036k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0xaf930b32

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j net.java.games.jogl.impl.x11.X11GLImpl.glDrawArrays(III)V+0
j com.xith3d.render.jogl.ShapeAtomPeer.drawGeometry(Lcom/xith3d/render/CanvasPeer;Lnet/java/games/jogl/GL;Lcom/xith3d/scenegraph/GeometryArray;)V+445
j com.xith3d.render.jogl.ShapeAtomPeer.renderAtom(Lcom/xith3d/render/CanvasPeer;Lcom/xith3d/render/RenderAtom;)V+543
j com.xith3d.render.CanvasPeerBase.render(Lcom/xith3d/render/RenderAtom;)V+76
j com.xith3d.render.jogl.CanvasPeerImpl.drawBin(Lnet/java/games/jogl/GL;Lcom/xith3d/render/RenderBin;)V+32
j com.xith3d.render.jogl.CanvasPeerImpl.display(Lnet/java/games/jogl/GLDrawable;)V+327
j net.java.games.jogl.impl.GLDrawableHelper.display(Lnet/java/games/jogl/GLDrawable;)V+29
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 org.magicspark.gamma.universe.PointOfView.render()V+11
j org.magicspark.gamma.test.RSTest.run()V+67
j org.magicspark.gamma.test.RSTest.main([Ljava/lang/String;)V+9
v ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
0x081bdb68 JavaThread “AWT-EventQueue-0” [_thread_blocked, id=13785]
0x081bcdc0 JavaThread “AWT-Shutdown” [_thread_blocked, id=13784]
0x08431228 JavaThread “AWT-XAWT” daemon [_thread_blocked, id=13781]
0x0836a8d0 JavaThread “Java2D Disposer” daemon [_thread_blocked, id=13780]
0x080a0cc8 JavaThread “Low Memory Detector” daemon [_thread_blocked, id=13778]
0x0809f778 JavaThread “CompilerThread0” daemon [_thread_blocked, id=13777]
0x0809e868 JavaThread “Signal Dispatcher” daemon [_thread_blocked, id=13776]
0x08099ad0 JavaThread “Finalizer” daemon [_thread_blocked, id=13775]
0x08098da8 JavaThread “Reference Handler” daemon [_thread_blocked, id=13774]
=>0x0805b880 JavaThread “main” [_thread_in_native, id=13772]

Other Threads:
0x08096300 VMThread [id=13773]
0x080a2158 WatcherThread [id=13779]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
def new generation total 576K, used 176K [0x88ad0000, 0x88b70000, 0x88fb0000)
eden space 512K, 21% used [0x88ad0000, 0x88aec1d0, 0x88b50000)
from space 64K, 100% used [0x88b50000, 0x88b60000, 0x88b60000)
to space 64K, 0% used [0x88b60000, 0x88b60000, 0x88b70000)
tenured generation total 2808K, used 2460K [0x88fb0000, 0x8926e000, 0x8cad0000)
the space 2808K, 87% used [0x88fb0000, 0x89217258, 0x89217400, 0x8926e000)
compacting perm gen total 8192K, used 3387K [0x8cad0000, 0x8d2d0000, 0x90ad0000)
the space 8192K, 41% used [0x8cad0000, 0x8ce1efd8, 0x8ce1f000, 0x8d2d0000)
ro space 8192K, 68% used [0x90ad0000, 0x91048958, 0x91048a00, 0x912d0000)
rw space 12288K, 47% used [0x912d0000, 0x91886148, 0x91886200, 0x91ed0000)

Dynamic libraries:

VM Arguments:
java_command: org.magicspark.gamma.test.RSTest

Environment Variables:
PATH=/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/games
USERNAME=bluesky
LD_LIBRARY_PATH=/usr/lib/sun-j2sdk1.5.0/jre/lib/i386/client:/usr/lib/sun-j2sdk1.5.0/jre/lib/i386:/usr/lib/sun-j2sdk1.5.0/jre/…/lib/i386
SHELL=/bin/bash
DISPLAY=:0.0

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

OS:3.1

uname:Linux 2.6.10-5-386 #1 Tue Apr 5 12:12:40 UTC 2005 i686
libc:glibc 2.3.2 NPTL 0.60
rlimit: STACK 8192k, CORE 0k, NPROC infinity, NOFILE 1024, AS infinity
load average:0.99 0.45 0.47

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

Memory: 4k page, physical 256812k(2908k free), swap 506008k(274328k free)

vm_info: Java HotSpot™ Client VM (1.5.0_02-b09) for linux-x86, built on Mar 4 2005 03:08:25 by java_re with gcc 3.2.1-7a (J2SE release)

` ;D ;D

It looks like you’re using an old version of JOGL. I think that if you download the current (1.1 b12) version and drop both the jogl.jar and unpack the jogl-natives-linux.jar into your thirdparty libs that it will probably fix the crash.

I had trouble with older versions of Xith3d, the last release however fixed most of my problems. Also upgrading to the latest JOGL like ken suggests might help. I don’t know if I can help, but if you still have trouble after updating the dependencies, I could take a look at your code…

Thanks guys.
After reading the Xith3D in Netbeans topic, I updated Xith3D to the latest community build, but I will try to download the latest JOGL version.
Note : this does not happen when I don’t render both canvas.

I was able to render two canvases, but I had to create two RenderPeers for that. But in the end it was no good, because I got a huge perfomance slowdown, so I haven’t invested anymore time in it and have probably also deleted the code.

Arne

PS: this was some time ago, before the new update (around fall/winter, I dunno)

I create two renderpeers, too…
Fortunately I don’t need this code now… But if somebody know how to do ( with the latest version ), he is welcome.

I had the same error when using two canvases.

The latest JOGL version should work. At least I can render two canvases if I am using two completely separate universes/scenes.

Another issue in this domain is a problem that occurs when a single texture instance is used in both canvases. This caused in my case a severe memory leak with all its consequences.

Since the (old) textureLoader class identifies textures by their respective filename (thus you can’t get two instances of the same texture) I used multiple TextureLoader instances to organize the textures according to the canvas they were used in.

If someone has a better idea to solve the problems in the “multiple canvas” domain please tell me/us.

Further, I would very much like to render the same scene using different views in different canvases. But I could not get it working so far.

Ca$

Well, I don’t use textures in the test…
Just a coloured cube.
But it’s the same geometry and the same shape that is shared.
And I NEED to render the same scene from two different points of view.

Yep this way it get’s nasty to make split screen games…

(it’s about gamma, right? I read there something about splitscreen there, so… - In that case we’d better skip this problem and wait until there’s a good fix for that)

I’m confused. Is there still a problem with this support in Xith3D?

Please submit an Issue on the bug if there is one. If you make it nice and detailed, and provide a small test case the chances are it will be resolved sooner.

Will.

The problem as I experienced it is as follows (with latest jogl):

Same scene multiple views with respective canvas: VM crashes with error as above (although both frames are initially rendered)

One scene per view with respective canvas: Using a single texture instance in both scenes causes a huge memory leak (appears that texture gets reallocated per render call)

One scene per view with respective canvas and texture instances: Works fine for me.

Same scene multiple views in one canvas and switching between views: don’t know, have not tried it.

Ca$

Yes it’s about Gamma.
You’re right, it’s not important for now… But it’s important for the future…
Is there another manner to do a split-screen game than with two canvases ?