Login  Register

JOGL Shader VM Crash

Posted by Xfel on Mar 05, 2011; 5:44pm
URL: https://forum.jogamp.org/JOGL-Shader-VM-Crash-tp2638696.html

Hello,

When I try to use shaders with opengl, my VM crashes.
This is my code:

try {
                        shaderProgram = gl.glCreateProgramObjectARB();
                        vertexShaderObject = gl.glCreateShaderObjectARB(GL2.GL_VERTEX_SHADER);
                        fragmentShaderObject = gl.glCreateShaderObjectARB(GL2.GL_FRAGMENT_SHADER);
                        try {
                                String vp = loadFile("test_vertex.vp");
                                gl.glShaderSourceARB(vertexShaderObject, 1, new String[] { vp }, new int[] { vp.length() }, 0);
                                String fp = loadFile("test_fragment.fp");
                                gl.glShaderSourceARB(fragmentShaderObject, 1, new String[] { fp }, new int[] { fp.length() }, 0);
                        } catch (IOException e) {
                                System.err.println("Error while Loading shader code");
                                e.printStackTrace();
                                System.exit(1);
                        }
                        gl.glCompileShaderARB(vertexShaderObject);
                        gl.glCompileShaderARB(fragmentShaderObject);
                        gl.glAttachObjectARB(shaderProgram, vertexShaderObject);
                        gl.glAttachObjectARB(shaderProgram, fragmentShaderObject);
                        gl.glLinkProgramARB(shaderProgram);

                        gl.glUseProgramObjectARB(shaderProgram);
                } finally {
                        if (vertexShaderObject != 0) {
                                gl.glDeleteShader(vertexShaderObject);
                        }
                        if (fragmentShaderObject != 0) {
                                gl.glDeleteShader(fragmentShaderObject);
                        }
                }

and this is the error:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000069aa42b9, pid=6856, tid=2776
#
# JRE version: 6.0_17-b04
# Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode windows-amd64 )
# Problematic frame:
# C  [atio6axx.dll+0xa742b9]
#
# 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.
#

GLProfile.getDefault().hasGLSL() return true. I stepped through it and noticed that the error occures at the very first instruction.  I am running Windows 7 64 bit with a 64 bit Java VM (java 6). Ma Graphics card is a ATI Radeon HD 4600 Series. The ccc prints me an OpenGL version of 6.14.10.8787.