Doing a glMaterialfv call, e.g. glMaterialfv( GL.GL_FRONT, GLLightingFunc.GL_AMBIENT, color, 0 ), lets the JVM crash if the color parameter is null and directly passed into the native function. On my system com.jogamp.opengl.impl.gl4.GL4bcImpl.dispatch_glMaterialfv1 provokes a segfault in the graphics driver (see log). Possible solution: let glMaterialfv do a nullpointer check Implementation-Title: Java Bindings for OpenGL Runtime Environment Implementation-Version: 2.0-b11-20101213 # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007ffca91dd441, pid=12740, tid=140723133142784 # # JRE version: 6.0_26-b03 # OS:wheezy/sid uname:Linux 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 libc:glibc 2.13 NPTL 2.13 vm_info: Java HotSpot(TM) 64-Bit Server VM (20.1-b02) for linux-amd64 JRE (1.6.0_26-b03), built on May 4 2011 01:13:47 by "java_re" with gcc 3.2.2 (SuSE Linux) Stack: [0x00007ffca84cd000,0x00007ffca85ce000], sp=0x00007ffca85cb6d0, free space=1017k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [fglrx_dri.so+0x2c5441] ukiCreateContext+0x2c5441 [error occurred during error reporting (printing native stack), id 0xb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J com.jogamp.opengl.impl.gl4.GL4bcImpl.dispatch_glMaterialfv1(IILjava/lang/Object;IZJ)V j com.jogamp.opengl.impl.gl4.GL4bcImpl.glMaterialfv(II[FI)V+99 j dk.itu.cgr.sgdl.gameviewer.ui.WorldObjectRenderer.display(Ldk/itu/cgr/sgdl/gameviewer/components/GameBoard;Ljavax/media/opengl/GL2;ILjava/lang/Object;)V+146
We don't check GL arguments by their function's semantics, since this would cause a huge overhead in processing time as well as in work to do. Sometimes null values are allowed and desired, sometimes not. A SIGSEGV for a null pointer access is not too bad, since it is save and not a security issue IMHO.