<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>524</bug_id>
          
          <creation_ts>2011-11-08 20:04:08 +0100</creation_ts>
          <short_desc>glMaterialfv crashes if color == null</short_desc>
          <delta_ts>2011-11-27 20:48:32 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>opengl</component>
          <version>2</version>
          <rep_platform>pc_x86_64</rep_platform>
          <op_sys>linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>t.mahlmann</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>---</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1169</commentid>
    <comment_count>0</comment_count>
    <who name="">t.mahlmann</who>
    <bug_when>2011-11-08 20:04:08 +0100</bug_when>
    <thetext>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 &quot;java_re&quot; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1211</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2011-11-27 20:48:32 +0100</bug_when>
    <thetext>We don&apos;t check GL arguments by their function&apos;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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>