Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (595)
Games in Android Showcase (168)
games submitted by our members
Games in WIP (646)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  intermittent crashes with JOGL  (Read 6017 times)
0 Members and 1 Guest are viewing this topic.
Offline joglNoob

Senior Newbie

« Posted 2012-04-18 11:18:05 »

Linux 32bit
JOGL 2.0 (using incremental build from 07/17/2011)
Netbeans 7.1.1
NVIDIA drivers = "version current" that came with Linux.

Program seams to work fine 20-30% of the time. Other times it crashes and I get this:

Info: XInitThreads() called for concurrent Thread support
# A fatal error has been detected by the Java Runtime Environment:
#  SIGSEGV (0xb) at pc=0xb7730f2d, pid=12378, tid=2362850160
# JRE version: 6.0_31-b04
# Java VM: Java HotSpot(TM) Server VM (20.6-b01 mixed mode linux-x86 )
# Problematic frame:
# C  []  pthread_mutex_lock+0x1d
# An error report file with more information is saved as:
# /usr/local/vcat/hs_err_pid12378.log
# If you would like to submit a bug report, please visit:
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
Result: 134
BUILD SUCCESSFUL (total time: 1 minute 46 seconds)

Any ideas what's going on?
Thanks in advance.
Offline lhkbob

JGO Knight

Medals: 32

« Reply #1 - Posted 2012-04-18 15:22:54 »

If you are using VBOs, you are most likely referencing bad vertices, etc. through a glDrawElements command that has incorrect indices set up for the enabled vertex attributes.  A common case is if the index is too large so it refers to a non-existent vertex, or if one set of attributes is shorter than expected.

Offline joglNoob

Senior Newbie

« Reply #2 - Posted 2012-04-19 04:57:14 »

This same code runs just fine on Windows 32.
Given your description this problem would persist across platforms if it was what you think it is wouldn't it?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline lhkbob

JGO Knight

Medals: 32

« Reply #3 - Posted 2012-04-19 05:02:37 »

Yes and no, drivers have different behaviors when reading past the end of a VBO, and it depends where the memory lies.  So even on the same OS you might have it fail or not.  It's pretty easy to check, though, you just have to make sure you're calling glDisableClientState(x) as appropriate and that the data you're sending as VBOs makes sense, and that indices into glDrawElements, etc. are correct.

Offline joglNoob

Senior Newbie

« Reply #4 - Posted 2012-04-19 08:32:04 »

How would I go about checking this? Sorry I am new to JOGL. I found instances of the method you were refering to:

protected void drawSideInteriors(DrawContext dc, ShapeData shapeData)
        super.prepareToDrawInterior(dc, this.getActiveSideAttributes(), defaultSideAttributes);

        GL gl = dc.getGL();

        for (ExtrudedBoundaryInfo boundary : shapeData)
            if (!dc.isPickingMode() && this.mustApplyLighting(dc, this.getActiveSideAttributes()))
                gl.getGL2().glNormalPointer(GL.GL_FLOAT, 0, boundary.sideNormalBuffer.rewind());

            if (!dc.isPickingMode() && boundary.sideTextureCoords != null)
                gl.getGL2().getGL2().glTexCoordPointer(2, GL.GL_FLOAT, 0, boundary.sideTextureCoords.rewind());

            gl.getGL2().getGL2().getGL2().glVertexPointer(3, GL.GL_FLOAT, 0, boundary.sideVertexBuffer.rewind());

            for (int j = 0; j < boundary.faceCount; j++)
                if (!dc.isPickingMode() && boundary.sideTextureCoords != null)
                    if (!boundary.sideTextures.get(j).bind(dc))


                boundary.sideIndices.position(4 * j);
                boundary.sideIndices.limit(4 * (j + 1));
                gl.glDrawElements(GL.GL_TRIANGLE_STRIP, 4, GL.GL_UNSIGNED_INT, boundary.sideIndices);

Does anything here look suspect? How do you go about checking what you mentioned?
Offline joglNoob

Senior Newbie

« Reply #5 - Posted 2012-04-19 08:42:10 »

Also in case it is relevant, I get the following warning right before the crash message in the OP:

WARNING [org.openide.filesystems.Ordering]: Found same position 100 for both Toolbars/File/PolygonAction.shadow and Toolbars/File/RectangleAction.shadow

This warning persists though even during the 20-30% of the cases when the program works.
Offline lhkbob

JGO Knight

Medals: 32

« Reply #6 - Posted 2012-04-19 14:47:24 »

The only suspect thing I can see is that you're not calling glEnableClientState(GL_NORMAL_ARRAY) and glDisableClientState(GL_NORMAL_ARRAY), even though you only set the glNormalPointer during certain conditions.

I also don't see where you call glEnableClientState(GL_VERTEX_ARRAY).

You want to look for these types of inconsistencies anywhere you use the glVertexPointer code to perform rendering.  Another draw method to look for is glDrawArrays(), which you might be using.

Offline joglNoob

Senior Newbie

« Reply #7 - Posted 2012-04-19 16:35:03 »

I'd like to exhaust other solutions before jumping into editing code I didn't write especially given the size of this project.
You mention the reason this code might be working in Windows but works only part of the time in Linux is because of the way
drivers (assume graphics card drivers?) interact with VBOs. Could it be possible I am not using the proper/best

Offline lhkbob

JGO Knight

Medals: 32

« Reply #8 - Posted 2012-04-19 18:42:11 »

It is possible, you may want to try creating a very rudimentary demo, too.

Offline gouessej
« Reply #9 - Posted 2012-04-19 21:37:12 »


lhkbob is right, please try to provide a small test case. I assume you try to use WorldWind with JOGL 2.0. Some people already succeeded in doing it, maybe there is something wrong in your code.

Anyway, please use a more recent version of JOGL 2.0. If you have a real problem with a real bug in JOGL, we won't be able to help you if you don't use the latest build.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline joglNoob

Senior Newbie

« Reply #10 - Posted 2012-04-23 08:35:21 »

Can you please tell me why newt.all and nativewindow.all are missing in all post Sept/Oct 2011 builds?
Should I use newt.core or any other and in atomic folder to replace them if I want to use latest stuff?

Most JOGL tutorials require using 4 files: jogl.all, gluren-rt, newt.all and nativewindow.all. Last 2 are missing in newer builds.

Offline gouessej
« Reply #11 - Posted 2012-04-23 19:56:25 »

Use jogl.all.jar and gluegen-rt.jar or all atomic JARs. jogl.all.jar contains NEWT stuffs too.

Offline joglNoob

Senior Newbie

« Reply #12 - Posted 2012-04-24 04:14:40 »


Now I am basically back to where I was in the OP except with the latest (04/22/2012) JOGL build. (still works, but not every time and gives the same error).
I am currently getting the following blocks of warnings in case this sheds some light on this issue:

Warning: com.jogamp.nativewindow.swt.SWTAccessor cannot access
Warning: com.jogamp.nativewindow.swt.SWTAccessor cannot access org.eclipse.swt.widgets.Control
Warning: com.jogamp.nativewindow.swt.SWTAccessor$1 cannot access org.eclipse.swt.widgets.Control
Warning: com.jogamp.nativewindow.swt.SWTAccessor$2 cannot access
Warning: com.jogamp.nativewindow.swt.SWTAccessor$2 cannot access org.eclipse.swt.widgets.Control
Warning: com.jogamp.nativewindow.swt.SWTAccessor$3 cannot access
Warning: com.jogamp.nativewindow.swt.SWTAccessor$3 cannot access org.eclipse.swt.widgets.Control
Warning: com.jogamp.opengl.swt.GLCanvas cannot access
Warning: com.jogamp.opengl.swt.GLCanvas cannot access

and also:

Warning: cannot access com.sun.codemodel.JArrayClass$1
Warning:$1 cannot access com.sun.codemodel.JArrayClass$1
Warning:$1 cannot access com.sun.codemodel.JCodeModel$1
Warning:$JReferencedClass cannot access com.sun.codemodel.JCodeModel$1
Warning: cannot access com.sun.codemodel.JNestedClass
Warning: cannot access com.sun.codemodel.JExpr$3
Warning:$3 cannot access com.sun.codemodel.JExpr$3
Warning: cannot access com.sun.codemodel.JNestedClass
Warning: cannot access com.sun.codemodel.JNullType$1
Warning:$1 cannot access com.sun.codemodel.JNullType$1

but I was reading that the 2nd block's warnings are not significant.

Any thoughts?
Offline gouessej
« Reply #13 - Posted 2012-04-24 22:52:34 »

I didn't know you use the experimental SWT heavyweight canvas. Please report your problem on the official forum of JogAmp, you will get more replies.

Offline joglNoob

Senior Newbie

« Reply #14 - Posted 2012-04-25 08:43:27 »

I downloaded a swt.jar and added it to the project and those warnings went away, but the problem didn't Sad
Now all I get are some warnings, been ignoring them for now.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

deepthought (47 views)
2015-06-30 15:39:44

deepthought (50 views)
2015-06-30 15:39:09

deepthought (62 views)
2015-06-30 15:36:52

Za\'Anzabar (37 views)
2015-06-29 05:44:54

TritonDreyja (46 views)
2015-06-24 17:10:40

CopyableCougar4 (46 views)
2015-06-23 00:34:45

BurntPizza (52 views)
2015-06-21 20:36:46

cookiecompiler (93 views)
2015-06-11 15:42:53

cookiecompiler (55 views)
2015-06-11 15:41:14

NegativeZero (80 views)
2015-06-11 09:49:18
How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!