segmentations faults at jogamp startup using 0.7 and current git (regression since 0.6+20130401)

114 views
Skip to first unread message

Xerxes Rånby

unread,
Jan 15, 2014, 4:28:03 PM1/15/14
to av...@googlegroups.com
I have started to see segmentations faults at startup when testing to use avian in combination with jogamp jogl.
Jogamp examples have worked with avian and openjdk 7 before thus i think it is a regression.
gdb backtrace included below using a mode=debug avian build:

Test system setup: Ubuntu Linux 13.10 amd64
#avian build options:
export ARCH=amd64
export JVM_ARCH=x86_64
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-${ARCH} make openjdk=/usr/lib/jvm/java-7-openjdk-${ARCH}
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-${ARCH}/ make openjdk=/usr/lib/jvm/java-7-openjdk-${ARCH}/ test
#all avian tests pass

# Install the built avian libjvm.so into OpenJDK 7
sudo mkdir -p /usr/lib/jvm/java-7-openjdk-${ARCH}/jre/lib/${ARCH}/avian
sudo cp build/linux-${JVM_ARCH}-openjdk/libjvm.so /usr/lib/jvm/java-7-openjdk-${ARCH}/jre/lib/${ARCH}/avian
# Add -avian KNOWN to the end of the jvm.cfg file in order to make java -avian work
sudo sh -c "echo '-avian KNOWN' >> /usr/lib/jvm/java-7-openjdk-${ARCH}/jre/lib/${ARCH}/jvm.cfg"


java -avian -version
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.12) (7u25-2.3.12-4ubuntu3)
Avian (build 0.7, )


Testcase:

wget http://jogamp.org/deployment/archive/master/gluegen_761-joal_511-jogl_1200-jocl_903-signed/archive/jogamp-all-platforms.7z
7z x jogamp-all-platforms.7z
cd jogamp-all-platforms/jar
java -avian -cp jogl-all.jar:gluegen-rt.jar com.jogamp.newt.opengl.GLWindow

familjen@familjen-P67A-UD3:~/jogamp/2.1.4/jogamp-all-platforms/jar$ gdb --args java -avian -cp jogl-all.jar:gluegen-rt.jar com.jogamp.newt.opengl.GLWindow
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/java -avian -cp jogl-all.jar:gluegen-rt.jar com.jogamp.newt.opengl.GLWindow
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff6bcd700 (LWP 21802)]
[New Thread 0x7fffefbc0700 (LWP 21803)]
forceES2    false
forceES3    false
forceGL3    false
forceGL4ES3 false
[New Thread 0x7fffed502700 (LWP 21807)]
[New Thread 0x7fffe7fff700 (LWP 21808)]
[New Thread 0x7fffe6d6a700 (LWP 21812)]
[Thread 0x7fffe6d6a700 (LWP 21812) exited]
-----------------------------------------------------------------------------------------------------
Platform: LINUX / Linux 3.11.0-15-generic (3.11.0), x86_64 (arch), GENERIC_ABI, 4 cores
MachineDescription: runtimeValidated true, littleEndian true, 32Bit false, primitive size / alignment:
  int8    1 / 1, int16   2 / 2
  int     4 / 4, long    8 / 8
  int32   4 / 4, int64   8 / 8
  float   4 / 4, double  8 / 8, ldouble 16 / 16
  pointer 8 / 8, page    4096
Platform: Java Version: 1.7.0_25 (1.7.0u25), VM: Avian, Runtime: OpenJDK Runtime Environment
Platform: Java Vendor: Oracle Corporation, http://java.oracle.com/, JavaSE: true, Java6: true, AWT enabled: true
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Package: com.jogamp.common
Extension Name: com.jogamp.common
Specification Title: GlueGen Java Bindings Generator
Specification Vendor: JogAmp Community
Specification Version: 2.1
Implementation Title: GlueGen Run-Time
Implementation Vendor: JogAmp Community
Implementation Vendor ID: com.jogamp
Implementation URL: http://jogamp.org/
Implementation Version: 2.1.4-rc-20140113
Implementation Build: 2.1-b761-20140113
Implementation Branch: origin/master
Implementation Commit: 6de214a403f4277dbfdff2e9cf974c964f1dcdbb
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Package: javax.media.opengl
Extension Name: javax.media.opengl
Specification Title: Java Bindings for OpenGL API Specification
Specification Vendor: JogAmp Community
Specification Version: 2.1
Implementation Title: Java Bindings for OpenGL Runtime Environment
Implementation Vendor: JogAmp Community
Implementation Vendor ID: com.jogamp
Implementation URL: http://jogamp.org/
Implementation Version: 2.1.4-rc-20140113
Implementation Build: 2.1-b1200-20140113
Implementation Branch: origin/master
Implementation Commit: 367b704b448b4ebabcfc62cc29e61fa5760514d1
-----------------------------------------------------------------------------------------------------
[New Thread 0x7fffe6d6a700 (LWP 21813)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe6d6a700 (LWP 21813)]
0x00000000400f04eb in ?? ()
(gdb) bt
#0  0x00000000400f04eb in ?? ()
#1  0x00007fffd40eba98 in ?? ()
#2  0x00007ffff01bc628 in ?? ()
#3  0x00007fffe6d68c20 in ?? ()
#4  0x00007fffd40eba98 in ?? ()
#5  0x00007fffd40eb5b0 in ?? ()
#6  0x00007ffff6f8d9fc in vmInvoke () from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/avian/libjvm.so
#7  0x00007ffff6f3ef27 in (anonymous namespace)::local::invoke (thread=0x7ffff01bc628, method=0x7fffd40e5668,
    arguments=0x7fffe6d68ea0) at src/compile.cpp:8321
#8  0x00007ffff6f40a52 in (anonymous namespace)::local::MyProcessor::invokeArray (this=0x7ffff0002d98,
    t=0x7ffff01bc628, method=0x7fffd40e5668, this_=0x7fffd40eb5b0, arguments=0x7fffd4344070)
    at src/compile.cpp:8807
#9  0x00007ffff6f53626 in vm::invoke (t=0x7ffff01bc628, method=0x7fffd40e5668, instance=0x7fffd40eb5b0,
    args=0x7fffd4344070) at src/avian/classpath-common.h:586
#10 0x00007ffff6f5db21 in (anonymous namespace)::local::jvmNewInstanceFromConstructor (t=0x7ffff01bc628,
    arguments=0x7fffe6d69260) at src/classpath-openjdk.cpp:4448
#11 0x00007ffff6f8d994 in vmRun () from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/avian/libjvm.so
#12 0x00007ffff6f16071 in vm::runRaw (t=0x7ffff01bc628,
    function=0x7ffff6f5da0b <(anonymous namespace)::local::jvmNewInstanceFromConstructor(vm::Thread*, uintptr_t*)>, arguments=0x7fffe6d69260) at src/avian/machine.h:1950
#13 0x00007ffff6f160ce in vm::run (t=0x7ffff01bc628,
    function=0x7ffff6f5da0b <(anonymous namespace)::local::jvmNewInstanceFromConstructor(vm::Thread*, uintptr_t*)>, arguments=0x7fffe6d69260) at src/avian/machine.h:1957
#14 0x00007ffff6f5db88 in (anonymous namespace)::local::JVM_NewInstanceFromConstructor (t=0x7ffff01bc628,
    constructor=0x7fffe6d69690, args=0x7fffe6d69698) at src/classpath-openjdk.cpp:4461
#15 0x00007ffff6f8d932 in vmNativeCall () from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/avian/libjvm.so
#16 0x00007ffff6ee13c8 in vm::dynamicCall (
    function=0x7fffefbd94c0 <Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0>,
    arguments=0x7fffe6d69448, argumentTypes=0x7fffe6d69438 "\a\a\a\a\377\177", argumentCount=4, returnType=7)
    at src/avian/x86.h:197
#17 0x00007ffff6ee06f9 in (anonymous namespace)::MySystem::call (this=0x7ffff00008c0,
    function=0x7fffefbd94c0 <Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0>,
    arguments=0x7fffe6d69448, types=0x7fffe6d69438 "\a\a\a\a\377\177", count=4, size=32, returnType=7)
    at src/vm/system/posix.cpp:782
#18 0x00007ffff6f3be93 in (anonymous namespace)::local::invokeNativeSlow (t=0x7ffff01bc628,
    method=0x7fffd4448010,
    function=0x7fffefbd94c0 <Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0>)
    at src/compile.cpp:7430
#19 0x00007ffff6f3c193 in (anonymous namespace)::local::invokeNative2 (t=0x7ffff01bc628, method=0x7fffd4448010)
    at src/compile.cpp:7502
#20 0x00007ffff6f3c322 in (anonymous namespace)::local::invokeNative (t=0x7ffff01bc628) at src/compile.cpp:7534
#21 0x000000004000007b in ?? ()
#22 0x00007fffe6d696d0 in ?? ()
#23 0x000000004002a148 in ?? ()
#24 0x00007fffd40eb508 in ?? ()
#25 0x00007fffd4344070 in ?? ()
#26 0x00000000e6d698f0 in ?? ()
#27 0x00000000d4424808 in ?? ()
#28 0x00007fffd4446218 in ?? ()
#29 0x00007fffd44484d0 in ?? ()
#30 0x00007ffff01bc628 in ?? ()
---Type <return> to continue, or q <return> to quit---
#31 0x0000000000000001 in ?? ()
#32 0x00007fffe6d69700 in ?? ()
#33 0x0000000040029fc6 in ?? ()
#34 0x00007fffd40eb580 in ?? ()
#35 0x00007fffd4344070 in ?? ()
#36 0x00007fffd4444b48 in ?? ()
#37 0x00007ffff01bc628 in ?? ()
#38 0x00007fffe6d698f0 in ?? ()
#39 0x0000000040029544 in ?? ()
#40 0x00007fffd40eb5a0 in ?? ()
#41 0x00007fffd4344070 in ?? ()
#42 0x00000003400e61e0 in ?? ()
#43 0x0000000000000001 in ?? ()
#44 0x00007fffd40eb2c0 in ?? ()
#45 0x00000000400ce141 in ?? ()
#46 0x00007fffd4344070 in ?? ()
#47 0x00007fffd40eb5a0 in ?? ()
#48 0x00007fffd40eb5a0 in ?? ()
#49 0x00000000400efe3a in ?? ()
#50 0x00007fffd40eb508 in ?? ()
#51 0x00007fffd4344070 in ?? ()
#52 0x00007fffd4343ff0 in ?? ()
#53 0x0000000000000001 in ?? ()
#54 0x00007fffd449a0a8 in ?? ()
#55 0x00007ffff01bc628 in ?? ()
#56 0x00007fffe6d69b00 in ?? ()
#57 0x00007fffe6d69738 in ?? ()
#58 0x0000000000000000 in ?? ()
(gdb)


The jogamp testcase pass if I use the 0.6+20130401-0ubuntu1 version of avian that is currently shipping with ubuntu.
sudo apt-get install jvm-7-avian-jre
java -avian -version
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.12) (7u25-2.3.12-4ubuntu3)
Avian (build 0.6, package 0.6+20130401-0ubuntu1)

Cheers
Xerxes

Joel Dice

unread,
Jan 21, 2014, 11:31:36 AM1/21/14
to av...@googlegroups.com
On Wed, 15 Jan 2014, Xerxes Rånby wrote:

> I have started to see segmentations faults at startup when testing to use
> avian in combination with jogamp jogl.
> Jogamp examples have worked with avian and openjdk 7 before thus i think it
> is a regression.

Thanks for the report, Xerxes. The segmentation faults are just
NullPointerExceptions (GDB catches them before the VM can turn them into
NPEs). The root problem is that libnativewindow_awt.so can't be loaded,
because it depends on libjawt.so, which depends on libmawt.so, which is
not loaded by default. The VM used to load it during initialization, but
I had to comment-out that code due to another bug:

https://github.com/ReadyTalk/avian/commit/419ac24963bf4008a9491ec17292a0960d74d261

Unfortunately, I don't remember exactly what the bug was. Interestingly,
though, it was committed on the same day I posted to this thread:
https://groups.google.com/forum/#!topic/avian/7EkHYdKmgvI, so maybe I was
actually trying to fix an Ubuntu/OpenJDK/Avian problem then, too.

Anyway, if you revert that commit, the GLWindow example seems to run
successfully. The question now is: When should the VM load mawt and when
should it not? I'm afraid that just reverting that commit will cause some
other problem. Is there a better way to make sure it's loaded when it's
needed than explicitly loading it when the VM is initialized?

Xerxes Rånby

unread,
Jan 22, 2014, 10:06:53 AM1/22/14
to av...@googlegroups.com

Thank you Joel I did not realize it was all related to native library loading, I can help narrow down the issue:

libawt and libmawt are supposed to get loaded by the OpenJDK run-time during
java.awt.Toolkit.getDefaultToolkit()
when running on a -Djava.awt.headless=false platform
libjawt has to get loaded manually for OpenJDK 7 after libawt and libmawt is initialized before the symbols are available to libnativewindow_awt.so

Inside JogAmp we call Toolkit.getDefaultToolkit() and load jawt manually inside the JAWTJNILibLoader's static constructor
we use JAWTJNILibLoader inside JAWTUtil's static constructor.
we use JAWTUtil during NativeWindowFactory static constructor using reflection:

http://jogamp.org/git/?p=jogl.git;a=blob;f=src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java#l293
http://jogamp.org/git/?p=jogl.git;a=blob;f=src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java#l50
http://jogamp.org/git/?p=jogl.git;a=blob;f=src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java

libnativewindow_awt is then finally loaded by jogamp when NativeWindowFactory has detected that it is running on a "headfull" awt platform.

JAWTUtil and JAWTJNILibLoader debug output can be enabled using: -Dnativewindow.debug.JAWT=true
NativeWindowFactory debug out is enabled using  -Dnativewindow.debug=true

i compared the library load order order using a patched version of avian and jamvm that prints when System.loadLibrary is called to spot the differences in the static initialization.

xranby@xranby-ESPRIMO-P7935:~/jamvm$ git diff
diff --git a/src/os/linux/os.c b/src/os/linux/os.c
index 2eb881b..e4bf2f3 100644
--- a/src/os/linux/os.c
+++ b/src/os/linux/os.c
@@ -62,6 +62,7 @@ char *nativeLibPath() {
 }
 
 void *nativeLibOpen(char *path) {
+    fprintf(stderr, "open %s \n", path);
     return dlopen(path, RTLD_LAZY);
 }
++++++++++++++++++++++++++++++++++++++++++++++++++

xranby@xranby-ESPRIMO-P7935:~/avian$ git diff
diff --git a/src/vm/system/posix.cpp b/src/vm/system/posix.cpp
index b2531ff..d2c4660 100644
--- a/src/vm/system/posix.cpp
+++ b/src/vm/system/posix.cpp
@@ -877,12 +877,13 @@ class MySystem: public System {
     if (isMain) {
       pathOfExecutable(this, &name, &nameLength);
     }
+    fprintf(stderr, "open %s \n", name);
     void* p = dlopen(name, RTLD_LAZY | RTLD_LOCAL);
 
     if (p) {
-      if (Verbose) {
+//      if (Verbose) {
         fprintf(stderr, "open %s as %p\n", name, p);
-      }
+//      }
 
       char* n;
       if (name) {
++++++++++++++++++++++++++++++++++++++++++++++++++

Test output:

java -jamvm-git -Dnativewindow.debug=true -Dnativewindow.debug.JAWT=true -cp jogl-all.jar:gluegen-rt.jar com.jogamp.newt.opengl.GLWindow
Library load order using jamvm:
OK Test output (stack traces from debug output code):
...
Implementation Commit: ccfc9b529b1dbd6003a62cb4215e2cdaeb8c37fd
-----------------------------------------------------------------------------------------------------
main - Info: NativeWindowFactory.<init>
main - NativeWindowFactory.initSingleton()
JAWTUtil initialization (JAWT/JNI/...
open /usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/libawt.so
open /usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/xawt/libmawt.so
open /usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/libjawt.so
open /tmp/jogamp_0000/file_cache/jln3514050511337699936/jln4624328718319207679/libnativewindow_awt.so
JAWTUtil.getJAWT(tryOffscreenLayer false, tryOnscreen true)
JAWTUtil: Has sun.awt.SunToolkit.awtLock/awtUnlock true
JAWTUtil: Has Java2D true
JAWTUtil: Is headless false
JAWTUtil: AWT Desktop hints 1
JAWTUtil: OffscreenLayer Supported: false - Required false
X11Util.initSingleton()
open /tmp/jogamp_0000/file_cache/jln3514050511337699936/jln4624328718319207679/libnativewindow_x11.so
Info: NativeWindow native init passed
X11Util.initSingleton(): OK true],
     X11 Display(NULL) <:0>,
     XSynchronize Enabled: false,
     X11_EXTENSION_ATIFGLRXDRI false,
     X11_EXTENSION_ATIFGLEXTENSION false,
     requiresToolkitLock true,
     hasThreadingIssues false,
     markAllDisplaysUnclosable false
NativeWindowFactory.registerFactory() interface javax.media.nativewindow.NativeWindow -> jogamp.nativewindow.NativeWindowFactoryImpl@982e9698
NativeWindowFactory.registerFactory() class java.awt.Component -> jogamp.nativewindow.NativeWindowFactoryImpl@982e9698
NativeWindowFactory requiresToolkitLock true, desktopHasThreadingIssues false
NativeWindowFactory isAWTAvailable true, defaultFactory jogamp.nativewindow.NativeWindowFactoryImpl@982e9698
main - Info: GraphicsConfigurationFactory.<init>
main - GraphicsConfigurationFactory.initSingleton()
GraphicsConfigurationFactory.registerFactory() put DeviceCapsType[javax.media.nativewindow.AbstractGraphicsDevice, javax.media.nativewindow.CapabilitiesImmutable] -> jogamp.nativewindow.DefaultGraphicsConfigurationFactoryImpl@982fba98, overridding: null
GraphicsConfigurationFactory.registerFactory() put DeviceCapsType[com.jogamp.nativewindow.x11.X11GraphicsDevice, javax.media.nativewindow.CapabilitiesImmutable] -> jogamp.nativewindow.x11.X11GraphicsConfigurationFactory@9830a730, overridding: null
GraphicsConfigurationFactory.registerFactory() put DeviceCapsType[com.jogamp.nativewindow.awt.AWTGraphicsDevice, javax.media.nativewindow.CapabilitiesImmutable] -> jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory@98324518, overridding: null
open /tmp/jogamp_0000/file_cache/jln3514050511337699936/jln4624328718319207679/libjogl_desktop.so
GraphicsConfigurationFactory.registerFactory() put DeviceCapsType[com.jogamp.nativewindow.x11.X11GraphicsDevice, javax.media.opengl.GLCapabilitiesImmutable] -> jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory@983da6d8, overridding: null
java.lang.Exception: Stack trace
    at java.lang.Thread.dumpStack(Thread.java:1344)
    at javax.media.nativewindow.GraphicsConfigurationFactory.getFactory(GraphicsConfigurationFactory.java:229)
    at jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory.registerFactory(X11GLXGraphicsConfigurationFactory.java:86)
    at jogamp.opengl.x11.glx.X11GLXDrawableFactory.<init>(X11GLXDrawableFactory.java:123)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:171)
    at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:193)
    at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:213)
    at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:235)
    at javax.media.opengl.GLDrawableFactory.initSingletonImpl(GLDrawableFactory.java:166)
    at javax.media.opengl.GLDrawableFactory.initSingleton(GLDrawableFactory.java:129)
    at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1573)
    at javax.media.opengl.GLProfile.access$100(GLProfile.java:76)
    at javax.media.opengl.GLProfile$1.run(GLProfile.java:155)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:123)
    at javax.media.opengl.GLProfile.getDefaultDevice(GLProfile.java:1837)
    at com.jogamp.opengl.JoglVersion.getDefaultOpenGLInfo(JoglVersion.java:116)
    at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:914)
GraphicsConfigurationFactory.getFactory: com.jogamp.nativewindow.x11.X11GraphicsDevice, javax.media.nativewindow.CapabilitiesImmutable
Factory #0: DeviceCapsType[javax.media.nativewindow.AbstractGraphicsDevice, javax.media.nativewindow.CapabilitiesImmutable] -> jogamp.nativewindow.DefaultGraphicsConfigurationFactoryImpl@982fba98
Factory #1: DeviceCapsType[com.jogamp.nativewindow.awt.AWTGraphicsDevice, javax.media.nativewindow.CapabilitiesImmutable] -> jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory@98324518
Factory #2: DeviceCapsType[com.jogamp.nativewindow.x11.X11GraphicsDevice, javax.media.nativewindow.CapabilitiesImmutable] -> jogamp.nativewindow.x11.X11GraphicsConfigurationFactory@9830a730
Factory #3: DeviceCapsType[com.jogamp.nativewindow.x11.X11GraphicsDevice, javax.media.opengl.GLCapabilitiesImmutable] -> jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory@983da6d8
GraphicsConfigurationFactory.getFactory() deviceTypes: [class com.jogamp.nativewindow.x11.X11GraphicsDevice, class javax.media.nativewindow.DefaultGraphicsDevice, interface javax.media.nativewindow.AbstractGraphicsDevice]
GraphicsConfigurationFactory.getFactory() capabilitiesTypes: [interface javax.media.nativewindow.CapabilitiesImmutable]
GraphicsConfigurationFactory.getFactory() found DeviceCapsType[com.jogamp.nativewindow.x11.X11GraphicsDevice, javax.media.nativewindow.CapabilitiesImmutable] -> jogamp.nativewindow.x11.X11GraphicsConfigurationFactory@9830a730
GraphicsConfigurationFactory.registerFactory() put DeviceCapsType[com.jogamp.nativewindow.x11.X11GraphicsDevice, javax.media.opengl.GLCapabilitiesImmutable] -> jogamp.opengl.egl.EGLGraphicsConfigurationFactory@98423d68, overridding: jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory@983da6d8
GraphicsConfigurationFactory.registerFactory() put DeviceCapsType[com.jogamp.nativewindow.egl.EGLGraphicsDevice, javax.media.opengl.GLCapabilitiesImmutable] -> jogamp.opengl.egl.EGLGraphicsConfigurationFactory@98423d68, overridding: null
open /tmp/jogamp_0000/file_cache/jln3514050511337699936/jln4624328718319207679/libjogl_mobile.so
main - EGLGraphicsDevice.open(): EGLGraphicsDevice[type .egl, connection decon, unitID 0, handle 0x0, owner true, ResourceToolkitLock[obj 0x984661f0, isOwner false, <98466200, 98466210>[count 0, qsz 0, owner <NULL>]]]
Info: Nativewindow X11 Error: 16 - BadLength (poly request too large or internal Xlib length error), dpy 0x912d77c0, id 17, # 15: 135:17 Unknown
java.lang.Exception: Stack trace
    at java.lang.Thread.dumpStack(Thread.java:1344)
    at jogamp.nativewindow.x11.X11Util.dumpStack(X11Util.java:618)
    at jogamp.opengl.egl.EGL.dispatch_eglInitialize0(Native Method)
    at jogamp.opengl.egl.EGL.eglInitialize(EGL.java:564)
    at jogamp.opengl.egl.EGLDisplayUtil.eglInitialize(EGLDisplayUtil.java:146)
    at jogamp.opengl.egl.EGLDisplayUtil.eglGetDisplayAndInitialize(EGLDisplayUtil.java:182)
    at jogamp.opengl.egl.EGLDisplayUtil.eglGetDisplayAndInitialize(EGLDisplayUtil.java:198)
    at jogamp.opengl.egl.EGLDisplayUtil$1.eglGetAndInitDisplay(EGLDisplayUtil.java:255)
    at com.jogamp.nativewindow.egl.EGLGraphicsDevice.open(EGLGraphicsDevice.java:95)
    at jogamp.opengl.egl.EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGLDisplayUtil.java:274)
    at jogamp.opengl.egl.EGLDrawableFactory.<init>(EGLDrawableFactory.java:197)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:171)
    at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:193)
    at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:213)
    at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:235)
    at javax.media.opengl.GLDrawableFactory.initSingletonImpl(GLDrawableFactory.java:181)
    at javax.media.opengl.GLDrawableFactory.initSingleton(GLDrawableFactory.java:129)
    at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1573)
    at javax.media.opengl.GLProfile.access$100(GLProfile.java:76)
    at javax.media.opengl.GLProfile$1.run(GLProfile.java:155)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:123)
    at javax.media.opengl.GLProfile.getDefaultDevice(GLProfile.java:1837)
    at com.jogamp.opengl.JoglVersion.getDefaultOpenGLInfo(JoglVersion.java:116)
    at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:914)
libEGL warning: DRI2: failed to authenticate
<application runs>



Library load order using avian:
java -avian-git -Dnativewindow.debug=true -Dnativewindow.debug.JAWT=true -cp jogl-all.jar:gluegen-rt.jar com.jogamp.newt.opengl.GLWindow
FAILED Test output:
...
Implementation Commit: ccfc9b529b1dbd6003a62cb4215e2cdaeb8c37fd
-----------------------------------------------------------------------------------------------------
Thread-0xb761c4f8 - Info: NativeWindowFactory.<init>
Thread-0xb761c4f8 - NativeWindowFactory.initSingleton()
JAWTUtil initialization (JAWT/JNI/...
open /usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386//tmp/jogamp_0000/file_cache/jln4355273086748331556/jln4958764329972598846/libnativewindow_awt.so
open /usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/xawt//tmp/jogamp_0000/file_cache/jln4355273086748331556/jln4958764329972598846/libnativewindow_awt.so
open /tmp/jogamp_0000/file_cache/jln4355273086748331556/jln4958764329972598846/libnativewindow_awt.so
NativeWindowFactory.shutdown() START: JVM Shutdown true, on thread NativeWindowFactory_ShutdownHook
NativeWindowFactory.shutdown(): Post customShutdownHook
NativeWindowFactory_ShutdownHook - Info: GraphicsConfigurationFactory.<init>
NativeWindowFactory_ShutdownHook - NativeWindowFactory.shutdown() END JVM Shutdown true
<application ends premature>

it appears that the call to Toolkit.getDefaultToolkit() and the explicit loading of jawt manually inside the JAWTJNILibLoader's static constructor never takes place when using avian.

Cheers
Xerxes

Joel Dice

unread,
Feb 4, 2014, 10:01:40 AM2/4/14
to av...@googlegroups.com
Thanks for investigating this, Xerxes. I'm sorry I haven't followed up
yet, but I plan to look at it this weekend. My guess is there's something
subtly wrong with how Avian is loading and initializing classes; maybe
it's being too lazy somewhere. I'll let you know what I find.

Joel Dice

unread,
Feb 9, 2014, 5:10:42 PM2/9/14
to av...@googlegroups.com
On Wed, 22 Jan 2014, Xerxes Rånby wrote:

> it appears that the call to Toolkit.getDefaultToolkit() and the explicit
> loading of jawt manually inside the JAWTJNILibLoader's static constructor
> never takes place when using avian.

Thanks again for reporting this. It turned out to be a JIT compiler
optimization gone awry: https://github.com/ReadyTalk/avian/pull/167

With that patch, the JogAmp example seems to run fine on my machine. Let
me know if you see any other issues.
Reply all
Reply to author
Forward
0 new messages