Drawing more than a certain number of triangles at one time/method/stack crash

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Drawing more than a certain number of triangles at one time/method/stack crash

loremipsum
I have a GLJPanel with swing components (JInternalPane renders beautifully on top). On render, the parent container/gl event listener (JDesktopPane) calls the game's render, which calls the level's render. Inside the level's render, I have about 24,000 float vertices waiting to be drawn. Cutting the for loop short by a few thousand vertices seems to not crash, but rendering all of them does. Other than that, everything seems to work.

SO.. when I go over, I get spammed with this crap (again, Swing DispatchThread woes -.-):

java.lang.reflect.InvocationTargetException
        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1086)
        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1063)
        at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1326)
        at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:98)
        at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
        at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)
Caused by: com.jogamp.opengl.GLException: Error making context 0x20001 current on Thread AWT-EventQueue-0, drawableWrite 0xffffffff8c010bb9, drawableRead 0xffffffff8c010bb9, werr: -1073282985, WindowsWGLContext [Version 2.1 (Compat profile, compat[], FBO, hardware) - 2.1.1 [GL 2.1.0, vendor 0.0.0 (n/a)], options 0x4002, this 0x78482bad, handle 0x20001, isShared false, jogamp.opengl.gl4.GL4bcImpl@3821b42f,
         quirks: [NoDoubleBufferedBitmap, NoSurfacelessCtx],
        Drawable: ResizeableImpl[Initialized true, realized true, texUnit 0, samples 0,
        Factory   jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory@2cbc9673,
        Handle    0xffffffff8c010bb9,
        Caps      GLCaps[wgl vid 7 arb: rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, one, mono  , hw, GLProfile[GL2/GL2.hw], offscr[fbo]],
        fboI back 0, front 0, num 1,
        FBO front read 1, FBO[name r/w 1/1, init true, bound false, size 1440x900, samples 0/16, modified false/false, depth RenderAttachment[type DEPTH, format 0x81a5, samples 0, 1440x900, name 0x1, obj 0x51a422f6], stencil null, colorbuffer attachments: 1/8, with 1 textures: [TextureAttachment[type COLOR_TEXTURE, target GL_TEXTURE_2D, level 0, format 0x8051, 1440x900, border 0, dataFormat 0x1907, dataType 0x1401; min/mag 0x2600/0x2600, wrap S/T 0x812f/0x812f; name 0x1, obj 0x11396ef7], null, null, null, null, null, null, null], msaa[null, hasSink false, dirty true], state OK, obj 0x6ef36e59],
        FBO back  write 1, FBO[name r/w 1/1, init true, bound false, size 1440x900, samples 0/16, modified false/false, depth RenderAttachment[type DEPTH, format 0x81a5, samples 0, 1440x900, name 0x1, obj 0x51a422f6], stencil null, colorbuffer attachments: 1/8, with 1 textures: [TextureAttachment[type COLOR_TEXTURE, target GL_TEXTURE_2D, level 0, format 0x8051, 1440x900, border 0, dataFormat 0x1907, dataType 0x1401; min/mag 0x2600/0x2600, wrap S/T 0x812f/0x812f; name 0x1, obj 0x11396ef7], null, null, null, null, null, null, null], msaa[null, hasSink false, dirty true], state OK, obj 0x6ef36e59],
        Surface   GDISurface[ displayHandle 0x0
, surfaceHandle 0xffffffff8c010bb9
, size 1440x900
, UOB[ OWNS_SURFACE | OWNS_DEVICE | WINDOW_INVISIBLE ]
, WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[obj 0x2fd1cdf7]], idx 0], pfdID 7, ARB-Choosen true,
        requested GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, one, mono  , hw, GLProfile[GL2/GL2.hw], on-scr[.]],
        chosen    GLCaps[wgl vid 7 arb: rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, one, mono  , hw, GLProfile[GL2/GL2.hw], offscr[fbo]]]
, surfaceLock <77292ba7, 2ff11e0f>[count 1, qsz 0, owner <AWT-EventQueue-0>]
, GDIDummyUpstreamSurfaceHook[pixel 1440x900]
, upstreamSurface false ]]]
        at jogamp.opengl.windows.wgl.WindowsWGLContext.makeCurrentImpl(WindowsWGLContext.java:442)
        at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:840)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:648)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:586)
        at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1279)
        at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
        at com.jogamp.opengl.awt.GLJPanel$OffscreenBackend.doPaintComponent(GLJPanel.java:2095)
        at com.jogamp.opengl.awt.GLJPanel.paintComponent(GLJPanel.java:569)
        at javax.swing.JComponent.paint(JComponent.java:1037)
        at javax.swing.JComponent.paintChildren(JComponent.java:870)
        at javax.swing.JComponent.paint(JComponent.java:1046)
        at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
        at javax.swing.JComponent.paintToOffscreen(JComponent.java:5132)
        at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:278)
        at javax.swing.RepaintManager.paint(RepaintManager.java:1257)
        at javax.swing.JComponent._paintImmediately(JComponent.java:5080)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4890)
        at javax.swing.RepaintManager$3.run(RepaintManager.java:814)
        at javax.swing.RepaintManager$3.run(RepaintManager.java:802)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:802)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:745)
        at com.jogamp.opengl.util.AWTAnimatorImpl$1.run(AWTAnimatorImpl.java:170)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:672)
        at java.awt.EventQueue.access$400(EventQueue.java:81)
        at java.awt.EventQueue$2.run(EventQueue.java:633)

Here's the code:

This doesn't work:

                gl2.glBegin(GL2.GL_TRIANGLES);
                for (int i = 0; i < terrainTris.length-6; i+=6) {

                        gl2.glVertex3f(terrainTris[i].x, terrainTris[i].y, terrainTris[i].z);
                        gl2.glVertex3f(terrainTris[i+1].x, terrainTris[i+1].y, terrainTris[i+1].z);
                        gl2.glVertex3f(terrainTris[i+2].x, terrainTris[i+2].y, terrainTris[i+2].z);
                        gl2.glVertex3f(terrainTris[i+3].x, terrainTris[i+3].y, terrainTris[i+3].z);
                        gl2.glVertex3f(terrainTris[i+4].x, terrainTris[i+4].y, terrainTris[i+4].z);
                        gl2.glVertex3f(terrainTris[i+5].x, terrainTris[i+5].y, terrainTris[i+5].z);

                       
                }
                gl2.glEnd();

This doesn't work:
                for (int i = 0; i < terrainTris.length-200; i+=6) {

This, however, DOES work:
                for (int i = 0; i < terrainTris.length-2000; i+=6) {


What gives? I tried calling the GLJPanel's paint, repaint and display; in many ways: separate thread, separate thread with sleep, same thread with FPSAnimator, different thread with FPSAnimator, etc, etc.
Am I running out of memory? If so, how can I avoid this? Would VBOs help in any way?
Reply | Threaded
Open this post in threaded view
|

Re: Drawing more than a certain number of triangles at one time/method/stack crash

elect
Unless explicitely needed, you should avoid deprecated OpenGL, loremipsum
Reply | Threaded
Open this post in threaded view
|

Re: Drawing more than a certain number of triangles at one time/method/stack crash

Sven Gothel
Administrator
In reply to this post by loremipsum
On 12/15/2015 12:47 AM, loremipsum [via jogamp] wrote:
> I have a GLJPanel with swing components (JInternalPane renders beautifully on
> top). On render, the parent container/gl event listener (JDesktopPane) calls
> the game's render, which calls the level's render. Inside the level's render,
> I have about 24,000 float vertices waiting to be drawn. Cutting the for loop
> short by a few thousand vertices seems to not crash, but rendering all of them
> does. Other than that, everything seems to work.
>
> SO.. when I go over, I get spammed with this crap (again, Swing DispatchThread
> woes -.-):

It might not be releated to the EDT at all
but to available GPU memory?
We would expect a failure while creating the vertices buffers,
but since you utilize the fixed function pipeline (FFP)
these might get aggregated 'on the fly'.

Try using VBOs and glDraw* commands (as elect recommended)
as see how the memory allocation goes ..

~Sven

>
> Caused by: com.jogamp.opengl.GLException: Error making context 0x20001 current
> on Thread AWT-EventQueue-0, drawableWrite 0xffffffff8c010bb9, drawableRead
> 0xffffffff8c010bb9, werr: -1073282985, WindowsWGLContext [Version 2.1 (Compat
> profile, compat[], FBO, hardware) - 2.1.1 [GL 2.1.0, vendor 0.0.0 (n/a)],
> options 0x4002, this 0x78482bad, handle 0x20001, isShared false,
> jogamp.opengl.gl4.GL4bcImpl@3821b42f,
>          quirks: [NoDoubleBufferedBitmap, NoSurfacelessCtx],
>         Drawable: ResizeableImpl[Initialized true, realized true, texUnit 0,
> samples 0,
>         Factory   jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory@2cbc9673,
>         Handle    0xffffffff8c010bb9,
>         Caps      GLCaps[wgl vid 7 arb: rgba 8/8/8/0, opaque, accum-rgba
> 0/0/0/0, dp/st/ms 16/0/0, one, mono  , hw, GLProfile[GL2/GL2.hw], offscr[fbo]],
>         fboI back 0, front 0, num 1,
>         FBO front read 1, FBO[name r/w 1/1, init true, bound false, size
> 1440x900, samples 0/16, modified false/false, depth RenderAttachment[type
> DEPTH, format 0x81a5, samples 0, 1440x900, name 0x1, obj 0x51a422f6], stencil
> null, colorbuffer attachments: 1/8, with 1 textures: [TextureAttachment[type
> COLOR_TEXTURE, target GL_TEXTURE_2D, level 0, format 0x8051, 1440x900, border
> 0, dataFormat 0x1907, dataType 0x1401; min/mag 0x2600/0x2600, wrap S/T
> 0x812f/0x812f; name 0x1, obj 0x11396ef7], null, null, null, null, null, null,
> null], msaa[null, hasSink false, dirty true], state OK, obj 0x6ef36e59],
>         FBO back  write 1, FBO[name r/w 1/1, init true, bound false, size
> 1440x900, samples 0/16, modified false/false, depth RenderAttachment[type
> DEPTH, format 0x81a5, samples 0, 1440x900, name 0x1, obj 0x51a422f6], stencil
> null, colorbuffer attachments: 1/8, with 1 textures: [TextureAttachment[type
> COLOR_TEXTURE, target GL_TEXTURE_2D, level 0, format 0x8051, 1440x900, border
> 0, dataFormat 0x1907, dataType 0x1401; min/mag 0x2600/0x2600, wrap S/T
> 0x812f/0x812f; name 0x1, obj 0x11396ef7], null, null, null, null, null, null,
> null], msaa[null, hasSink false, dirty true], state OK, obj 0x6ef36e59],
>         Surface   GDISurface[ displayHandle 0x0
> , surfaceHandle 0xffffffff8c010bb9
> , size 1440x900


signature.asc (828 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Drawing more than a certain number of triangles at one time/method/stack crash

gouessej
Administrator
In reply to this post by loremipsum
Hi

You can use com.jogamp.opengl.util.ImmModeSink in order to minimize the changes in your code and still benefit of retained mode instead of using immediate mode. By the way, immediate mode shouldn't be used even for compatibility reasons (it's badly supported in numerous drivers like the display lists, you might get a large performance penalty when using them with shaders or during the picking). The vertex buffer objects are in the core of OpenGL since its version 1.4 and the vertex arrays are in its core with its version 1.2.

I draw about ten times more triangles in my game and it works flawlessly even in immediate mode. Please give us a SSCCE if you want to get some help.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Drawing more than a certain number of triangles at one time/method/stack crash

loremipsum
In reply to this post by loremipsum
Well, I got it to work by switching to GL_QUADS. Maybe I had an array improperly initialized... don't know.

However, now I have a next issue:
I can only load textures with AWTTextureIO using a buffered image. TextureIO using a file crashes. Maybe it's meant to be that way. Who knows. GLJPanel issues.

BUT, when I draw, for example, green to the texure, the resulting color is always white. I tried making only a quarter of the texture green, and the rest black. I get a quarter white and the rest black. COLORS AREN'T WORKING!!

I already have GL_TEXTURE_2D enabled, obviously. And color material. The texCoord2f's are correct, cause the image is actually drawing as expected. Just no color...
Reply | Threaded
Open this post in threaded view
|

Re: Drawing more than a certain number of triangles at one time/method/stack crash

loremipsum
Oh yeah, and I did try to explicitly set the image data type as well. If I'm not mistaken, BufferedImage.TYPE_INT_RGB should go hand and hand with GL2.GL_RGB. Regardless, the result doesn't budge.

More FTRs:

Tried setting GLCapabilities, lighting is always disabled. Grading either color channel has no effect on the seemingly impervious white. It's either black (if the color is exactly 0,0,0) or white (if the color is anything other than black).
Reply | Threaded
Open this post in threaded view
|

Re: Drawing more than a certain number of triangles at one time/method/stack crash

loremipsum
Actually, AWTTextureIO also gives me a crash. The key is when I load from a file (or if I provide the FileInputStream myself).
The crash is a juicy one, too:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000695195f9, pid=3368, tid=4224
#
# JRE version: 6.0_45-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.45-b01 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [nvoglv64.dll+0x195f9]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

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

Current thread (0x0000000000aec000):  JavaThread "main" [_thread_in_native, id=4224, stack(0x0000000002460000,0x0000000002560000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000000008c0

Registers:
RAX=0x0000000000000000, RBX=0x0000000000aec1d0, RCX=0x0000000000000001, RDX=0x00000000f6ac0108
RSP=0x000000000255f208, RBP=0x0000000000000001, RSI=0x000000000255f348, RDI=0x0000000000000000
R8 =0x00000000f6ac00f8, R9 =0x0000000000000001, R10=0x0000000000000000, R11=0x000000000000000c
R12=0x00000000695195f0, R13=0x0000000000000000, R14=0x00000000f6ac0108, R15=0x0000000000aec000
RIP=0x00000000695195f9, EFLAGS=0x0000000000010202

Top of Stack: (sp=0x000000000255f208)
0x000000000255f208:   0000000064517348 0000000000aec1d0
0x000000000255f218:   0000000000000001 000000000255f348
0x000000000255f228:   0000000000000000 00000000dbcb4f58
0x000000000255f238:   00000000dc321a28 0000000000000002
0x000000000255f248:   000000000255f308 0000000000000000
0x000000000255f258:   00000000dbcb4f58 000000000255f358
0x000000000255f268:   00000000029e79df 0000000000aecf30
0x000000000255f278:   0000000000aed278 0000000000aecef0
0x000000000255f288:   000000006daedcd3 0000000000000000
0x000000000255f298:   0000000000000000 00000000695195f0
0x000000000255f2a8:   00000000dc2e7918 0000000000aecef0
0x000000000255f2b8:   00000000dc2edec0 0000000000000003
0x000000000255f2c8:   000000000255f2c8 0000000000000000
0x000000000255f2d8:   000000000255f358 00000000dbe07918
0x000000000255f2e8:   0000000000000000 00000000dbcb4f58
0x000000000255f2f8:   0000000000000000 000000000255f328

Instructions: (pc=0x00000000695195f9)
0x00000000695195d9:   cc cc cc cc cc cc cc 01 00 66 a3 ef be ef be 00
0x00000000695195e9:   00 00 00 c3 cc cc cc 65 48 8b 04 25 88 15 00 00
0x00000000695195f9:   ff a0 c0 08 00 00 cc cc cc cc cc cc cc cc cc cc
0x0000000069519609:   cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc


Register to memory mapping:

RAX=0x0000000000000000 is an unknown value
RBX=0x0000000000aec1d0 is an unknown value
RCX=0x0000000000000001 is an unknown value
RDX=0x00000000f6ac0108 is an unknown value
RSP=0x000000000255f208 is pointing into the stack for thread: 0x0000000000aec000
RBP=0x0000000000000001 is an unknown value
RSI=0x000000000255f348 is pointing into the stack for thread: 0x0000000000aec000
RDI=0x0000000000000000 is an unknown value
R8 =0x00000000f6ac00f8 is an oop
[I
 - klass: {type array int}
 - length: 1
R9 =0x0000000000000001 is an unknown value
R10=0x0000000000000000 is an unknown value
R11=0x000000000000000c is an unknown value
R12=0x00000000695195f0 is an unknown value
R13=0x0000000000000000 is an unknown value
R14=0x00000000f6ac0108 is an unknown value
R15=0x0000000000aec000 is a thread


Stack: [0x0000000002460000,0x0000000002560000],  sp=0x000000000255f208,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [nvoglv64.dll+0x195f9]  DllMain+0x17759

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  jogamp.opengl.gl4.GL4bcImpl.dispatch_glGenTextures1(ILjava/lang/Object;IZJ)V+0
j  jogamp.opengl.gl4.GL4bcImpl.glGenTextures(I[II)V+107
j  com.jogamp.opengl.util.texture.Texture.validateTexID(Lcom/jogamp/opengl/GL;Z)Z+21
j  com.jogamp.opengl.util.texture.Texture.updateImage(Lcom/jogamp/opengl/GL;Lcom/jogamp/opengl/util/texture/TextureData;I)V+3
j  com.jogamp.opengl.util.texture.Texture.updateImage(Lcom/jogamp/opengl/GL;Lcom/jogamp/opengl/util/texture/TextureData;)V+4
j  com.jogamp.opengl.util.texture.Texture.<init>(Lcom/jogamp/opengl/GL;Lcom/jogamp/opengl/util/texture/TextureData;)V+22
j  com.jogamp.opengl.util.texture.TextureIO.newTexture(Lcom/jogamp/opengl/GL;Lcom/jogamp/opengl/util/texture/TextureData;)Lcom/jogamp/opengl/util/texture/Texture;+20
j  com.signisoft.games.mmo.client.resources.textures.TextureResource.loadData(Ljava/io/File;)Lcom/jogamp/opengl/util/texture/Texture;+28
j  com.signisoft.games.mmo.client.resources.textures.TextureResource.loadData(Ljava/io/File;)Ljava/lang/Object;+2
j  com.signisoft.games.mmo.client.resources.Resource.initialize()V+20
j  com.signisoft.games.mmo.client.resources.textures.TextureManager.loadResource(Ljava/lang/String;)Lcom/signisoft/games/mmo/client/resources/textures/TextureResource;+15
j  com.signisoft.games.mmo.client.resources.textures.TextureManager.loadResource(Ljava/lang/String;)Lcom/signisoft/games/mmo/client/resources/Resource;+2
j  com.signisoft.games.mmo.client.resources.ResourceManager.getResource(Ljava/lang/String;)Lcom/signisoft/games/mmo/client/resources/Resource;+18
j  com.signisoft.games.mmo.client.map.ClientMap.loadTextures()V+10
j  com.signisoft.games.mmo.client.map.ClientMap.initialize()V+17
j  com.signisoft.games.mmo.client.Game.initialize()V+24
j  com.signisoft.games.mmo.client.GameScreen.start()V+4
j  com.signisoft.games.mmo.client.Game.main([Ljava/lang/String;)V+40
v  ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
  0x0000000007758000 JavaThread "D3D Screen Updater" daemon [_thread_blocked, id=3784, stack(0x000000000d620000,0x000000000d720000)]
  0x00000000072b3000 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=7492, stack(0x000000000b1f0000,0x000000000b2f0000)]
  0x000000000718e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3028, stack(0x0000000008280000,0x0000000008380000)]
  0x0000000007394800 JavaThread "main-SharedResourceRunner" daemon [_thread_blocked, id=2960, stack(0x000000000b4f0000,0x000000000b5f0000)]
  0x00000000072b4000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=5648, stack(0x0000000008380000,0x0000000008480000)]
  0x00000000072b2800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=6784, stack(0x0000000007cc0000,0x0000000007dc0000)]
  0x000000000631c000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4300, stack(0x0000000006ec0000,0x0000000006fc0000)]
  0x0000000006312000 JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=4736, stack(0x0000000006dc0000,0x0000000006ec0000)]
  0x000000000630c000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=5280, stack(0x0000000006cc0000,0x0000000006dc0000)]
  0x00000000062fe000 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=6652, stack(0x0000000006ae0000,0x0000000006be0000)]
  0x00000000062fa800 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=4336, stack(0x00000000068e0000,0x00000000069e0000)]
  0x00000000062f4800 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=4528, stack(0x00000000066b0000,0x00000000067b0000)]
  0x0000000000246000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3364, stack(0x00000000065b0000,0x00000000066b0000)]
  0x0000000000245000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=6384, stack(0x00000000064b0000,0x00000000065b0000)]
  0x000000000022d800 JavaThread "Finalizer" daemon [_thread_blocked, id=5852, stack(0x00000000061b0000,0x00000000062b0000)]
  0x0000000000229800 JavaThread "Reference Handler" daemon [_thread_blocked, id=528, stack(0x00000000060b0000,0x00000000061b0000)]
=>0x0000000000aec000 JavaThread "main" [_thread_in_native, id=4224, stack(0x0000000002460000,0x0000000002560000)]

Other Threads:
  0x0000000000223000 VMThread [stack: 0x0000000005fb0000,0x00000000060b0000] [id=4532]
  0x0000000006328000 WatcherThread [stack: 0x0000000006fc0000,0x00000000070c0000] [id=4968]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 PSYoungGen      total 35456K, used 22203K [0x00000000f5560000, 0x00000000f7ae0000, 0x0000000100000000)
  eden space 32704K, 67% used [0x00000000f5560000,0x00000000f6b06f50,0x00000000f7550000)
  from space 2752K, 1% used [0x00000000f7810000,0x00000000f7818000,0x00000000f7ac0000)
  to   space 2816K, 0% used [0x00000000f7550000,0x00000000f7550000,0x00000000f7810000)
 PSOldGen        total 21888K, used 2410K [0x00000000e0000000, 0x00000000e1560000, 0x00000000f5560000)
  object space 21888K, 11% used [0x00000000e0000000,0x00000000e025a8f8,0x00000000e1560000)
 PSPermGen       total 22400K, used 22304K [0x00000000dae00000, 0x00000000dc3e0000, 0x00000000e0000000)
  object space 22400K, 99% used [0x00000000dae00000,0x00000000dc3c8268,0x00000000dc3e0000)

Code Cache  [0x00000000029d0000, 0x0000000002c40000, 0x00000000059d0000)
 total_blobs=961 nmethods=161 adapters=761 free_code_cache=49199232 largest_free_block=15744

Dynamic libraries:
0x0000000000400000 - 0x000000000042f000 C:\Program Files\Java\jdk1.6.0_45\bin\javaw.exe
0x0000000077560000 - 0x00000000776e6000 C:\Windows\system32\ntdll.dll
0x0000000077430000 - 0x000000007755d000 C:\Windows\system32\kernel32.dll
0x000007fefeee0000 - 0x000007fefefe8000 C:\Windows\system32\ADVAPI32.dll
0x000007fefebc0000 - 0x000007fefed03000 C:\Windows\system32\RPCRT4.dll
0x0000000077360000 - 0x000000007742d000 C:\Windows\system32\USER32.dll
0x000007fefed10000 - 0x000007fefed74000 C:\Windows\system32\GDI32.dll
0x000007feff7f0000 - 0x000007feff81d000 C:\Windows\system32\IMM32.DLL
0x000007feff6e0000 - 0x000007feff7e2000 C:\Windows\system32\MSCTF.dll
0x000007fefeda0000 - 0x000007fefee3c000 C:\Windows\system32\msvcrt.dll
0x000007fefdcc0000 - 0x000007fefdccd000 C:\Windows\system32\LPK.DLL
0x000007fefee40000 - 0x000007fefeeda000 C:\Windows\system32\USP10.dll
0x000000006d8e0000 - 0x000000006e09c000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\server\jvm.dll
0x000007fefc100000 - 0x000007fefc139000 C:\Windows\system32\WINMM.dll
0x000007feff070000 - 0x000007feff248000 C:\Windows\system32\ole32.dll
0x000007feff2e0000 - 0x000007feff3b3000 C:\Windows\system32\OLEAUT32.dll
0x000007fefbe80000 - 0x000007fefbecf000 C:\Windows\system32\OLEACC.dll
0x000000006d850000 - 0x000000006d85e000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\verify.dll
0x000000006d460000 - 0x000000006d487000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\java.dll
0x000000006d4d0000 - 0x000000006d504000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\jdwp.dll
0x000000006d6f0000 - 0x000000006d6f8000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\npt.dll
0x000000006d8a0000 - 0x000000006d8b2000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\zip.dll
0x000000006d310000 - 0x000000006d319000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\dt_socket.dll
0x000007fefdcd0000 - 0x000007fefdd14000 C:\Windows\system32\WS2_32.dll
0x000007feff3c0000 - 0x000007feff3c7000 C:\Windows\system32\NSI.dll
0x000007fefbe20000 - 0x000007fefbe33000 C:\Windows\system32\NLAapi.dll
0x000007fefd360000 - 0x000007fefd383000 C:\Windows\system32\IPHLPAPI.DLL
0x000007fefd310000 - 0x000007fefd355000 C:\Windows\system32\dhcpcsvc.DLL
0x000007fefd6d0000 - 0x000007fefd70a000 C:\Windows\system32\DNSAPI.dll
0x000007fefdb10000 - 0x000007fefdb2c000 C:\Windows\system32\Secur32.dll
0x000007fefd300000 - 0x000007fefd30a000 C:\Windows\system32\WINNSI.DLL
0x000007fefd2d0000 - 0x000007fefd2fb000 C:\Windows\system32\dhcpcsvc6.DLL
0x000007fef9be0000 - 0x000007fef9bf3000 C:\Windows\system32\napinsp.dll
0x000007fef9bc0000 - 0x000007fef9bd7000 C:\Windows\system32\pnrpnsp.dll
0x000007fefd090000 - 0x000007fefd0df000 C:\Windows\System32\mswsock.dll
0x000007fef9c00000 - 0x000007fef9c0b000 C:\Windows\System32\winrnr.dll
0x000007feff820000 - 0x000007feff875000 C:\Windows\system32\WLDAP32.dll
0x0000000077700000 - 0x0000000077709000 C:\Windows\system32\PSAPI.DLL
0x000007fefae30000 - 0x000007fefae38000 C:\Windows\system32\rasadhlp.dll
0x000007fefcd60000 - 0x000007fefcd67000 C:\Windows\System32\wshtcpip.dll
0x000000006d0a0000 - 0x000000006d264000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\awt.dll
0x000007fef9ed0000 - 0x000007fef9f28000 C:\Windows\system32\WINSPOOL.DRV
0x000007fefdd20000 - 0x000007fefe973000 C:\Windows\system32\SHELL32.dll
0x000007fefeff0000 - 0x000007feff063000 C:\Windows\system32\SHLWAPI.dll
0x000007fefc370000 - 0x000007fefc569000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.18005_none_1509f8bef40ee4da\COMCTL32.dll
0x000007fefa780000 - 0x000007fefa791000 C:\Windows\system32\DWMAPI.DLL
0x000000006d340000 - 0x000000006d3b5000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\fontmanager.dll
0x000007fef6660000 - 0x000007fef683f000 C:\Windows\system32\d3d9.dll
0x000007fefd120000 - 0x000007fefd12b000 C:\Windows\system32\VERSION.dll
0x000007fefc300000 - 0x000007fefc307000 C:\Windows\system32\d3d8thk.dll
0x0000000010000000 - 0x0000000010700000 C:\Windows\system32\nvd3dumx.dll
0x000000006d6c0000 - 0x000000006d6d7000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\net.dll
0x000007fefd110000 - 0x000007fefd117000 C:\Windows\System32\wship6.dll
0x000000006d6e0000 - 0x000000006d6ec000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\nio.dll
0x000007fefcdb0000 - 0x000007fefcdf8000 C:\Windows\system32\rsaenh.dll
0x000007fefdb30000 - 0x000007fefdb56000 C:\Windows\system32\USERENV.dll
0x000007fefda90000 - 0x000007fefdac5000 C:\Windows\system32\apphelp.dll
0x00000000637c0000 - 0x00000000637cd000 C:\workspace\Client\natives\windows-amd64\gluegen-rt.dll
0x000000006d4a0000 - 0x000000006d4a7000 C:\Program Files\Java\jdk1.6.0_45\jre\bin\jawt.dll
0x000000006a440000 - 0x000000006a44d000 C:\workspace\Client\natives\windows-amd64\nativewindow_awt.dll
0x000000006c100000 - 0x000000006c10f000 C:\workspace\Client\natives\windows-amd64\nativewindow_win32.dll
0x000007fef4280000 - 0x000007fef43b1000 C:\Windows\system32\OpenGL32.dll
0x000007fef7790000 - 0x000007fef77bd000 C:\Windows\system32\GLU32.dll
0x000007fef4770000 - 0x000007fef485f000 C:\Windows\system32\DDRAW.dll
0x000007fefc1a0000 - 0x000007fefc1a8000 C:\Windows\system32\DCIMAN32.dll
0x000007fefe9e0000 - 0x000007fefebbc000 C:\Windows\system32\SETUPAPI.dll
0x0000000064500000 - 0x00000000645b1000 C:\workspace\Client\natives\windows-amd64\jogl_desktop.dll
0x0000000064340000 - 0x00000000643a2000 C:\workspace\Client\natives\windows-amd64\jogl_mobile.dll
0x0000000069500000 - 0x0000000069e5a000 C:\Windows\system32\nvoglv64.dll
0x000007feff640000 - 0x000007feff6d9000 C:\Windows\system32\CLBCatQ.DLL

VM Arguments:
jvm_args: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:53435 -Djava.library.path=C:\workspace\Client\native\win-amd64;C:\workspace\Client\native\win-amd64 -Dfile.encoding=Cp1251
java_command: com.signisoft.games.mmo.client.Game
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=C:\Program Files\Java\jdk1.6.0_45\jre\bin;C:/Program Files (x86)/Java/jre1.8.0_66/bin/client;C:/Program Files (x86)/Java/jre1.8.0_66/bin;C:/Program Files (x86)/Java/jre1.8.0_66/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\BIN;C:\MinGW\bin;C:\MinGW\msys\1.0\bin;C:\eclipse;
USERNAME=admin
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 15 Stepping 13, GenuineIntel



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

OS: Windows Vista , 64 bit Build 6002 Service Pack 2

CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 13, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3

Memory: 4k page, physical 2094728k(191536k free), swap 4430392k(2538380k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (20.45-b01) for windows-amd64 JRE (1.6.0_45-b06), built on Apr  1 2013 12:31:37 by "java_re" with MS VC++ 8.0 (VS2005)

time: Thu Dec 17 04:34:54 2015
elapsed time: 9 seconds



Reply | Threaded
Open this post in threaded view
|

Re: Drawing more than a certain number of triangles at one time/method/stack crash

gouessej
Administrator
Please give us a SSCCE if you want to get some help. You seem to call com.jogamp.opengl.util.texture.TextureIO.newTexture() with no current OpenGL context or from the wrong thread. You can create the texture data anywhere but the texture creation requires a current OpenGL context.

Instead of blaming JOGL, show us your own code which is probably responsible for your problems.

Finally, I switched from quads to triangles several years ago without any trouble.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Drawing more than a certain number of triangles at one time/method/stack crash

loremipsum
Thank you, that solved it. The GL context existed and I even ensured that it was the same one being used by passing GL gl into the texture manager. It was due to calling from a different thread. Without BufferedImage, using the loader from file, the texture renders fine with all colors 0.0
Reply | Threaded
Open this post in threaded view
|

Re: Drawing more than a certain number of triangles at one time/method/stack crash

gouessej
Administrator
You're welcome.

You shouldn't pass GL instances, this is a bad practice, it might lead you to use an invalidated instance. I advise you to look at the renderers of the most famous 3D engines (JMonkeyEngine, LibGDX, JogAmp's Ardor3D Continuation, ...), I call GLContext.getCurrentGL() instead of passing GL instances. If you called getCurrentGL() on the wrong thread or at the wrong time, it would throw an exception with an understandable error message instead of causing a crash.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Drawing more than a certain number of triangles at one time/method/stack crash

Sven Gothel
Administrator
On 12/17/2015 12:50 PM, gouessej [via jogamp] wrote:
> You shouldn't pass GL instances, this is a bad practice, it might lead you to
> use an invalidated instance. I advise you to look at the renderers of the most
> famous 3D engines (JMonkeyEngine, LibGDX, JogAmp's Ardor3D Continuation, ...),

Well, I advise to pass the GL instance, but treat it only transient,
i.e. do not store/cache it (no persistance) - or you really have to
know what you are doing (lifecycle, threading, ..).

From my viewpoint, it is best practice to pass the GL instance
as it is done in most of our framework - and keep it transient.

> I call GLContext.getCurrentGL() instead of passing GL instances. If you called
> getCurrentGL() on the wrong thread or at the wrong time, it would throw an
> exception with an understandable error message instead of causing a crash.

getCurrentGL() works ofc, assuming operating from the right thread,
which you control.

It uses TLS storage and hence has a [very] little performance footprint.
Dunno which footprint is bigger, i.e. passing the GL instance or
accessing the TLS for the current GL instance.

In the end .. well, it might be just very academic discussion :)

~Sven



signature.asc (828 bytes) Download Attachment