Bug 42

Summary: Problems invoking GLU functions
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: VERIFIED FIXED    
Severity: normal    
Priority: P2    
Version: 1   
Hardware: All   
OS: linux   
Type: DEFECT SCM Refs:
Workaround: ---

Description Sven Gothel 2010-03-24 07:45:54 CET


---- Reported by yvg 2003-09-14 08:56:28 ----

When trying to call GLU functions under Linux, JVM crashed in native code.
The example is taken from the forum at javagaming.org, topic "Picking". The code 
works fine when code for glu functions replaced with equivalent code in Java. I 
can send the test code if needed.

System information:

Linux RedHat 9
VIA CLE266
JDK 1.4.2

The crash info:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0xEF1
Function=[Unknown.]
Library=(N/A)

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.


Current Java thread:
	at net.java.games.jogl.impl.GLUImpl.dispatch_gluPerspective(Native 
Method)
	at net.java.games.jogl.impl.GLUImpl.gluPerspective(GLUImpl.java:935)
	at com.jproof.xith3d.test.PickTest1.reshape(PickTest1.java:393)
	at net.java.games.jogl.impl.GLDrawableHelper.reshape
(GLDrawableHelper.java:81)
	at net.java.games.jogl.GLCanvas$1.run(GLCanvas.java:108)
	at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:189)
	- locked <0x44c1cef8> (a 
net.java.games.jogl.impl.x11.X11OnscreenGLContext)
	at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:182)
	at net.java.games.jogl.GLCanvas.display(GLCanvas.java:82)
	at net.java.games.jogl.Animator$1.run(Animator.java:104)
	at java.lang.Thread.run(Thread.java:534)

Dynamic libraries:
08048000-0804e000 r-xp 00000000 03:03 
622584     /usr/java/j2sdk1.4.2/jre/bin/java
0804e000-0804f000 rw-p 00005000 03:03 
622584     /usr/java/j2sdk1.4.2/jre/bin/java
40000000-40015000 r-xp 00000000 03:03 621437     /lib/ld-2.3.2.so
40015000-40016000 rw-p 00014000 03:03 621437     /lib/ld-2.3.2.so
40017000-4001f000 r-xp 00000000 03:03 
655913     /usr/java/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so
4001f000-40020000 rw-p 00007000 03:03 
655913     /usr/java/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so
40020000-40024000 rw-s 00000000 03:03 754653     /tmp/hsperfdata_root/6774
40025000-4002f000 r-xp 00000000 03:03 556062     /lib/tls/libpthread-0.29.so
4002f000-40030000 rw-p 0000a000 03:03 556062     /lib/tls/libpthread-0.29.so
40032000-40034000 r-xp 00000000 03:03 621448     /lib/libdl-2.3.2.so
40034000-40035000 rw-p 00002000 03:03 621448     /lib/libdl-2.3.2.so
40036000-4042d000 r-xp 00000000 03:03 
230982     /usr/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
4042d000-40448000 rw-p 003f6000 03:03 
230982     /usr/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
4045b000-4046d000 r-xp 00000000 03:03 621452     /lib/libnsl-2.3.2.so
4046d000-4046e000 rw-p 00011000 03:03 621452     /lib/libnsl-2.3.2.so
40470000-40491000 r-xp 00000000 03:03 556060     /lib/tls/libm-2.3.2.so
40491000-40492000 rw-p 00020000 03:03 556060     /lib/tls/libm-2.3.2.so
40492000-40495000 r--s 00000000 03:03 
558044     /usr/java/j2sdk1.4.2/jre/lib/ext/dnsns.jar
40495000-4049c000 r-xp 00000000 03:03 294798     /usr/X11R6/lib/libXp.so.6.2
4049c000-4049d000 rw-p 00006000 03:03 294798     /usr/X11R6/lib/libXp.so.6.2
4049d000-4049e000 r-xp 00000000 03:03 
460190     /usr/java/j2sdk1.4.2/jre/lib/i386/libjawt.so
4049e000-4049f000 rw-p 00000000 03:03 
460190     /usr/java/j2sdk1.4.2/jre/lib/i386/libjawt.so
404a0000-404ab000 r-xp 00000000 03:03 621458     /lib/libnss_files-2.3.2.so
404ab000-404ac000 rw-p 0000a000 03:03 621458     /lib/libnss_files-2.3.2.so
404ac000-404bc000 r-xp 00000000 03:03 
460202     /usr/java/j2sdk1.4.2/jre/lib/i386/libverify.so
404bc000-404be000 rw-p 0000f000 03:03 
460202     /usr/java/j2sdk1.4.2/jre/lib/i386/libverify.so
404be000-404de000 r-xp 00000000 03:03 
460188     /usr/java/j2sdk1.4.2/jre/lib/i386/libjava.so
404de000-404e0000 rw-p 0001f000 03:03 
460188     /usr/java/j2sdk1.4.2/jre/lib/i386/libjava.so
404e0000-404f4000 r-xp 00000000 03:03 
460203     /usr/java/j2sdk1.4.2/jre/lib/i386/libzip.so
404f4000-404f7000 rw-p 00013000 03:03 
460203     /usr/java/j2sdk1.4.2/jre/lib/i386/libzip.so
404f7000-41e82000 r--s 00000000 03:03 
525095     /usr/java/j2sdk1.4.2/jre/lib/rt.jar
41ecc000-41ee2000 r--s 00000000 03:03 
525094     /usr/java/j2sdk1.4.2/jre/lib/sunrsasign.jar
41ee2000-41fbd000 r--s 00000000 03:03 
525093     /usr/java/j2sdk1.4.2/jre/lib/jsse.jar
41fbd000-41fce000 r--s 00000000 03:03 
525085     /usr/java/j2sdk1.4.2/jre/lib/jce.jar
41ff6000-41ffa000 r-xp 00000000 03:03 294808     /usr/X11R6/lib/libXtst.so.6.1
41ffa000-41ffb000 rw-p 00004000 03:03 294808     /usr/X11R6/lib/libXtst.so.6.1
41ffb000-41ffc000 r-xp 00000000 03:03 
491001     /usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2
41ffc000-41ffd000 rw-p 00000000 03:03 
491001     /usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2
41ffd000-41fff000 rw-s cc951000 03:03 114720     /dev/dri/card0
42000000-4212e000 r-xp 00000000 03:03 556058     /lib/tls/libc-2.3.2.so
4212e000-42131000 rw-p 0012e000 03:03 556058     /lib/tls/libc-2.3.2.so
42133000-4268c000 r--s 00000000 03:03 
525086     /usr/java/j2sdk1.4.2/jre/lib/charsets.jar
4c910000-4cb10000 r--p 00000000 03:03 474322     /usr/lib/locale/locale-archive
4cd10000-4cd1d000 r--s 00000000 03:03 
558045     /usr/java/j2sdk1.4.2/jre/lib/ext/ldapsec.jar
4cd1d000-4cdd9000 r--s 00000000 03:03 
558327     /usr/java/j2sdk1.4.2/jre/lib/ext/localedata.jar
4cdd9000-4cdf5000 r--s 00000000 03:03 
558047     /usr/java/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar
4cdf5000-4ce4c000 r--s 00000000 03:03 753912     /yvg2/test/log4j-1.2.8.jar
4ce4c000-4ce6b000 r--s 00000000 03:03 753918     /yvg2/test/xith_utilities.jar
4ce6b000-4ceb2000 r--s 00000000 03:03 753916     /yvg2/test/vecmath.jar
4ceb2000-4cf15000 r--s 00000000 03:03 753917     /yvg2/test/xith3d.jar
4cf15000-4cf9d000 r--s 00000000 03:03 753910     /yvg2/test/jogl.jar
4cf9d000-4d268000 r-xp 00000000 03:03 
460180     /usr/java/j2sdk1.4.2/jre/lib/i386/libawt.so
4d268000-4d27d000 rw-p 002ca000 03:03 
460180     /usr/java/j2sdk1.4.2/jre/lib/i386/libawt.so
4d2a3000-4d2f6000 r-xp 00000000 03:03 
460197     /usr/java/j2sdk1.4.2/jre/lib/i386/libmlib_image.so
4d2f6000-4d2f7000 rw-p 00052000 03:03 
460197     /usr/java/j2sdk1.4.2/jre/lib/i386/libmlib_image.so
4d2f7000-4d2fd000 r--s 00000000 03:03 392710     /usr/lib/gconv/gconv-
modules.cache
4d2fd000-4d304000 r-xp 00000000 03:03 
294804     /usr/X11R6/lib/libXrender.so.1.2
4d304000-4d305000 rw-p 00006000 03:03 
294804     /usr/X11R6/lib/libXrender.so.1.2
4d305000-4d353000 r-xp 00000000 03:03 294806     /usr/X11R6/lib/libXt.so.6.0
4d353000-4d357000 rw-p 0004d000 03:03 294806     /usr/X11R6/lib/libXt.so.6.0
4d357000-4d364000 r-xp 00000000 03:03 294784     /usr/X11R6/lib/libXext.so.6.4
4d364000-4d365000 rw-p 0000c000 03:03 294784     /usr/X11R6/lib/libXext.so.6.4
4d365000-4d441000 r-xp 00000000 03:03 294774     /usr/X11R6/lib/libX11.so.6.2
4d441000-4d444000 rw-p 000db000 03:03 294774     /usr/X11R6/lib/libX11.so.6.2
4d444000-4d44c000 r-xp 00000000 03:03 294772     /usr/X11R6/lib/libSM.so.6.0
4d44c000-4d44d000 rw-p 00007000 03:03 294772     /usr/X11R6/lib/libSM.so.6.0
4d44d000-4d461000 r-xp 00000000 03:03 294768     /usr/X11R6/lib/libICE.so.6.3
4d461000-4d462000 rw-p 00013000 03:03 294768     /usr/X11R6/lib/libICE.so.6.3
4d464000-4d47e000 r--s 00000000 03:03 753909     /yvg2/test/jogl-demos.jar
4d47e000-4d875000 r--s 00000000 03:03 753907     /yvg2/test/jogl-demos-
data.jar
4d875000-4d896000 r--s 00000000 03:03 753908     /yvg2/test/jogl-demos-util.jar
4d896000-4d94e000 r-xp 00000000 03:03 753911     /yvg2/test/libjogl.so
4d94e000-4d94f000 rw-p 000b7000 03:03 753911     /yvg2/test/libjogl.so
4d94f000-4d9cb000 r-xp 00000000 03:03 640678     /dri-
cvs/build/xc/lib/GL/GL/libGL.so.1.2
4d9cb000-4d9d0000 rw-p 0007c000 03:03 640678     /dri-
cvs/build/xc/lib/GL/GL/libGL.so.1.2
4d9d1000-4da4c000 r-xp 00000000 03:03 296856     /usr/X11R6/lib/libGLU.so.1.3
4da4c000-4da4e000 rw-p 0007a000 03:03 296856     /usr/X11R6/lib/libGLU.so.1.3
4da4e000-4daf7000 r-xp 00000000 03:03 359971     /usr/lib/libstdc++.so.5.0.3
4daf7000-4dafc000 rw-p 000a9000 03:03 359971     /usr/lib/libstdc++.so.5.0.3
4db01000-4db08000 r-xp 00000000 03:03 621507     /lib/libgcc_s-3.2.2-
20030225.so.1
4db08000-4db09000 rw-p 00007000 03:03 621507     /lib/libgcc_s-3.2.2-
20030225.so.1
4db09000-4dbc3000 r-xp 00000000 03:03 
460184     /usr/java/j2sdk1.4.2/jre/lib/i386/libfontmanager.so
4dbc3000-4dbdd000 rw-p 000b9000 03:03 
460184     /usr/java/j2sdk1.4.2/jre/lib/i386/libfontmanager.so
4dbde000-4dbe7000 rw-s dc000000 03:03 114720     /dev/dri/card0
4dbec000-4dbf4000 r-xp 00000000 03:03 
294782     /usr/X11R6/lib/libXcursor.so.1.0
4dbf4000-4dbf5000 rw-p 00007000 03:03 
294782     /usr/X11R6/lib/libXcursor.so.1.0
4dbf5000-4dc11000 r-xp 00000000 03:03 
490999     /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
4dc11000-4dc13000 rw-p 0001c000 03:03 
490999     /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
4de93000-4e085000 r-xp 00000000 03:03 101055     /dri-
cvs/build/xc/lib/GL/mesa/src/drv/via/via_dri.so
4e085000-4e089000 rw-p 001f2000 03:03 101055     /dri-
cvs/build/xc/lib/GL/mesa/src/drv/via/via_dri.so
4e094000-52094000 rw-s d8000000 03:03 114720     /dev/dri/card0
52094000-54094000 rw-s d0000000 03:03 114720     /dev/dri/card0

Heap at VM Abort:
Heap
 def new generation   total 576K, used 292K [0x44710000, 0x447b0000, 
0x44bf0000)
  eden space 512K,  44% used [0x44710000, 0x447490e0, 0x44790000)
  from space 64K, 100% used [0x44790000, 0x447a0000, 0x447a0000)
  to   space 64K,   0% used [0x447a0000, 0x447a0000, 0x447b0000)
 tenured generation   total 1408K, used 352K [0x44bf0000, 0x44d50000, 
0x48710000)
   the space 1408K,  25% used [0x44bf0000, 0x44c48040, 0x44c48200, 
0x44d50000)
 compacting perm gen  total 4352K, used 4345K [0x48710000, 0x48b50000, 
0x4c710000)
   the space 4352K,  99% used [0x48710000, 0x48b4e670, 0x48b4e800, 
0x48b50000)

Local Time = Sun Sep 14 18:45:53 2003
Elapsed Time = 3
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode)
#

Yuri



---- Additional Comments From kbr 2004-09-09 16:41:07 ----

Several users have reported crashes while invoking GLU routines on Linux. As
recommended by the LWJGL group, the best solution is probably to just port the
GLU routines to pure Java and stop using the underlying GLU library.




---- Additional Comments From kbr 2004-11-18 15:17:58 ----

Incorporated the LWJGL team's port of the GLU quadric and projection routines to
be able to eliminate calls to the native GLU library for these cases, which was
problematic on certain Linux distributions. Still need to port at least some of
the mipmap routines and the NURBS tesselator.




---- Additional Comments From kbr 2005-02-23 15:44:38 ----

User GKW on java.net and the javagaming.org forums has ported the GLU mipmap
library to pure Java. After a few bug fixes to this port it appears to be
working very solidly. It addresses these strange crashes on various Linux
distributions so this bug is being closed as fixed (even though we don't
currently have a port of the GLU NURBS library).




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:45 EDT  ---

This bug was previously known as _bug_ 42 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=42