JogAmp JOGL angelesgl2es1 applet fails to initialize using Hotspot

Bug #1078706 reported by Xerxes Rånby on 2012-11-14
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenJDK
Invalid
Medium
icedtea-web (Ubuntu)
Undecided
Unassigned
openjdk-6 (Ubuntu)
Undecided
Unassigned
openjdk-7 (Ubuntu)
Undecided
Unassigned

Bug Description

http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1218

This is a fully reproducible bug:
The http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html applet fails to initialize when using Hotspot, it runs fine using JamVM thus i belive the root cause is inside the OpenJDK Hotspot JVM.
Tested on two different systems A and B with the same outcome thus I think we can rule out bugs in IcedTea-web and the ARM Thumb2 JIT, see below:

Testcase:
chromium-browser http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html
or
firefox http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html

System A:
OS: Ubuntu 12.10 32bit armhf
Machine: Toshiba AC100-10D
IcedTea-Version: 1.3
OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1ubuntu1)
Chromium: 22.0.1229.94 (Developer Build 161065) Ubuntu 12.10

Runs OK using jamvm:
chromium-browser http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html
...
java version "1.7.0_07"
OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1ubuntu1)
JamVM (build 1.6.0-devel, inline-threaded interpreter with stack-caching)
Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
NvRmPrivGetChipIdStub: Could not read Tegra chip id/rev
Expected on kernels without Tegra3 support, using Tegra2
Loading GLESv2lib libGLESv2.so.2
Library for API 1 exposes function not wrapped: glPointSizePointerOES
class demos.es1.angeles.AngelesGL has no 'window' field
class demos.es1.angeles.AngelesGL has no 'glWindow' field
AngelesGL: jogamp.opengl.es1.GLES1Impl@41679930
33 s: 300 f / 33790 ms, 8.8 fps, 112 ms/f; total: 300 f, 8.8 fps, 112 ms/f
66 s: 300 f / 32722 ms, 9.1 fps, 109 ms/f; total: 600 f, 9.0 fps, 110 ms/f
98 s: 300 f / 32422 ms, 9.2 fps, 108 ms/f; total: 900 f, 9.0 fps, 109 ms/f
111 s: 300 f / 12335 ms, 24.3 fps, 41 ms/f; total: 1200 f, 10.7 fps, 92 ms/f
117 s: 300 f / 5818 ms, 51.5 fps, 19 ms/f; total: 1500 f, 12.8 fps, 78 ms/f

Fails using Hotspot (armhf thumb2 jit):
chromium-browser http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html
java version "1.7.0_07"
OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1ubuntu1)
OpenJDK Zero VM (build 22.0-b10, mixed mode)
Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
[12:12:7511309852:ERROR:nss_util.cc(452)] Error initializing NSS without a persistent database: libsoftokn3.so: cannot open shared object file: Permission denied
Exception in thread "Applet" java.lang.ExceptionInInitializerError
        at com.jogamp.common.util.PropertyAccess.addTrustedPrefix(PropertyAccess.java:52)
        at jogamp.newt.Debug.<clinit>(Debug.java:52)
        at com.jogamp.newt.awt.applet.JOGLNewtAppletBase.<clinit>(JOGLNewtAppletBase.java:58)
        at com.jogamp.newt.awt.applet.JOGLNewtApplet1Run.<clinit>(JOGLNewtApplet1Run.java:95)
        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:525)
        at java.lang.Class.newInstance0(Class.java:372)
        at java.lang.Class.newInstance(Class.java:325)
        at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:726)
        at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:676)
        at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:886)
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getProtectionDomain")
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
        at java.security.AccessController.checkPermission(AccessController.java:555)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
        at net.sourceforge.jnlp.runtime.JNLPSecurityManager.checkPermission(JNLPSecurityManager.java:284)
        at java.lang.Class.getProtectionDomain(Class.java:2123)
        at com.jogamp.common.util.SecurityUtil$2.run(SecurityUtil.java:52)
        at com.jogamp.common.util.SecurityUtil$2.run(SecurityUtil.java:50)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.common.util.SecurityUtil.getCerts(SecurityUtil.java:50)
        at com.jogamp.common.util.SecurityUtil.<clinit>(SecurityUtil.java:46)
        ... 13 more
java.lang.NullPointerException
        at net.sourceforge.jnlp.NetxPanel.runLoader(NetxPanel.java:154)
        at sun.applet.AppletPanel.run(AppletPanel.java:379)
        at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
        at sun.applet.AppletPanel.run(AppletPanel.java:429)
        at java.lang.Thread.run(Thread.java:722)
[16:16:7512497608:ERROR:nss_util.cc(452)] Error initializing NSS without a persistent database: libsoftokn3.so: cannot open shared object file: Permission denied
[20:20:7513434520:ERROR:nss_util.cc(452)] Error initializing NSS without a persistent database: libsoftokn3.so: cannot open shared object file: Permission denied

System B:
Ubuntu 12.04 32bit IA32
Machine: Fujitsu ESPRIMO-P7935
IcedTea-Web Plugin (using IcedTea-Web 1.2 (1.2-2ubuntu1.2))
OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~12.04.1)
Firefox 16.0.2

Runs OK using jamvm:
firefox http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~12.04.1)
JamVM (build 1.6.0-devel, inline-threaded interpreter with stack-caching)
libEGL warning: failed to create a pipe screen for i965
class demos.es1.angeles.AngelesGL has no 'window' field
class demos.es1.angeles.AngelesGL has no 'glWindow' field
AngelesGL: jogamp.opengl.gl4.GL4bcImpl@99a96018
4 s: 300 f / 4990 ms, 60.1 fps, 16 ms/f; total: 300 f, 60.1 fps, 16 ms/f

Fails using Hotspot:
firefox http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~12.04.1)
OpenJDK Server VM (build 20.0-b12, mixed mode)
Exception in thread "Applet" java.lang.ExceptionInInitializerError
 at com.jogamp.common.util.PropertyAccess.addTrustedPrefix(PropertyAccess.java:52)
 at jogamp.newt.Debug.<clinit>(Debug.java:52)
 at com.jogamp.newt.awt.applet.JOGLNewtAppletBase.<clinit>(JOGLNewtAppletBase.java:58)
 at com.jogamp.newt.awt.applet.JOGLNewtApplet1Run.<clinit>(JOGLNewtApplet1Run.java:95)
 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:532)
 at java.lang.Class.newInstance0(Class.java:372)
 at java.lang.Class.newInstance(Class.java:325)
 at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:726)
 at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:676)
 at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:886)
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission getProtectionDomain)
 at java.security.AccessControlContext.checkPermission(AccessControlContext.java:393)
 at java.security.AccessController.checkPermission(AccessController.java:558)
 at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
 at net.sourceforge.jnlp.runtime.JNLPSecurityManager.checkPermission(JNLPSecurityManager.java:284)
 at java.lang.Class.getProtectionDomain(Class.java:2123)
 at com.jogamp.common.util.SecurityUtil$2.run(SecurityUtil.java:52)
 at com.jogamp.common.util.SecurityUtil$2.run(SecurityUtil.java:50)
 at java.security.AccessController.doPrivileged(Native Method)
 at com.jogamp.common.util.SecurityUtil.getCerts(SecurityUtil.java:50)
 at com.jogamp.common.util.SecurityUtil.<clinit>(SecurityUtil.java:46)
 ... 13 more
java.lang.NullPointerException
 at net.sourceforge.jnlp.NetxPanel.runLoader(NetxPanel.java:154)
 at sun.applet.AppletPanel.run(AppletPanel.java:380)
 at java.lang.Thread.run(Thread.java:679)
java.lang.NullPointerException
 at sun.applet.AppletPanel.run(AppletPanel.java:430)
 at java.lang.Thread.run(Thread.java:679)

Download full text (8.3 KiB)

This is a fully reproducible bug:
The http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html applet fails to initialize when using Hotspot, it runs fine using JamVM thus i belive the root cause is inside the OpenJDK Hotspot JVM.
Tested on two different systems A and B with the same outcome thus I think we can rule out bugs in IcedTea-web and the ARM Thumb2 JIT, see below:

Testcase:
chromium-browser http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html
or
firefox http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html

System A:
OS: Ubuntu 12.10 32bit armhf
Machine: Toshiba AC100-10D
IcedTea-Version: 1.3
OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1ubuntu1)
Chromium: 22.0.1229.94 (Developer Build 161065) Ubuntu 12.10

Runs OK using jamvm:
chromium-browser http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html
...
java version "1.7.0_07"
OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1ubuntu1)
JamVM (build 1.6.0-devel, inline-threaded interpreter with stack-caching)
Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
NvRmPrivGetChipIdStub: Could not read Tegra chip id/rev
Expected on kernels without Tegra3 support, using Tegra2
Loading GLESv2lib libGLESv2.so.2
Library for API 1 exposes function not wrapped: glPointSizePointerOES
class demos.es1.angeles.AngelesGL has no 'window' field
class demos.es1.angeles.AngelesGL has no 'glWindow' field
AngelesGL: jogamp.opengl.es1.GLES1Impl@41679930
33 s: 300 f / 33790 ms, 8.8 fps, 112 ms/f; total: 300 f, 8.8 fps, 112 ms/f
66 s: 300 f / 32722 ms, 9.1 fps, 109 ms/f; total: 600 f, 9.0 fps, 110 ms/f
98 s: 300 f / 32422 ms, 9.2 fps, 108 ms/f; total: 900 f, 9.0 fps, 109 ms/f
111 s: 300 f / 12335 ms, 24.3 fps, 41 ms/f; total: 1200 f, 10.7 fps, 92 ms/f
117 s: 300 f / 5818 ms, 51.5 fps, 19 ms/f; total: 1500 f, 12.8 fps, 78 ms/f

Fails using Hotspot (armhf thumb2 jit):
chromium-browser http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html
java version "1.7.0_07"
OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1ubuntu1)
OpenJDK Zero VM (build 22.0-b10, mixed mode)
Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
[12:12:7511309852:ERROR:nss_util.cc(452)] Error initializing NSS without a persistent database: libsoftokn3.so: cannot open shared object file: Permission denied
Exception in thread "Applet" java.lang.ExceptionInInitializerError
        at com.jogamp.common.util.PropertyAccess.addTrustedPrefix(PropertyAccess.java:52)
        at jogamp.newt.Debug.<clinit>(Debug.java:52)
        at com.jogamp.newt.awt.applet.JOGLNewtAppletBase.<clinit>(JOGLNewtAppletBase.java:58)
        at com.jogamp.newt.awt.applet.JOGLNewtApplet1Run.<clinit>(JOGLNewtApplet1Run.java:95)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorA...

Read more...

This bug is also reproducible on 64Bit hotspot:
(12:39:13) mz: arch linux, kernel 3.6.6, "ondemand"
(12:47:27) mz: is a core i7, 12gb ram, radeon 4670 gpu
(13:24:33) xranby: i have a really odd bug that only triggers when using hotspot: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1218
(13:24:53) xranby: can someone test if this work on say 64bit hotspots?
(13:25:02) xranby: i have only tested on arm 32bit and ia32 32bit
(13:26:52) mz: Exception in thread "Applet" java.lang.ExceptionInInitializerError
(13:27:05) xranby: 64bit?
(13:27:14) mz: yep
(13:27:17) xranby: will it work using jamvm?
(13:27:20) mz: seems to be the exact same stack trace you had
(13:27:25) xranby: great
(13:27:33) xranby: then its reproducible across systems
(13:27:48) mz: not sure how to test it with jamvm
(13:28:25) xranby: to test with jamvm edit /etc/java-7-/etc/java-7-openjdk/jvm-amd64.cfg
(13:28:37) xranby: and put -jamvm KNOWN on top of the list
(13:29:02) xranby: this file can be located inside your openjdk/jre/lib/amd64 folder
(13:29:09) xranby: jvm.cfg
(13:29:13) xranby: if you have jamvm installed
(13:30:19) mz: got it
(13:31:00) mz: anything else required beyond that?
(13:31:07) xranby: no, restart the browser
(13:31:31) xranby: if you run from the terminal then you will see which jvm it uses internally
(13:31:38) xranby: java -version should report jamvm as well
(13:32:33) mz: java -version doesn't mention jamvm
(13:32:56) mz: i should mention that i'm on openjdk6, and i edited /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/jvm.cfg
(13:33:15) mz: is the only config file present on the system
(13:33:17) xranby: manual jamvm installation: http://labb.zafena.se/?p=576
(13:34:01) xranby: mz: most likely you dont have jamvm installed in /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/jamvm
(13:34:43) ***mz moves libjvm.so
(13:41:04) mz: jamvm working now... testing the applet
(13:41:55) mz: hm, firefox still insists on using the normal VM
(13:42:03) xranby: thats odd
(13:42:04) mz: i'll disable everything but jamvm, temporarily
(13:42:50) xranby: do you know whuch icedtea-web you got installed? firefox about:plugins
(13:43:28) xranby: it may be that it defaults to the server or client jvm folder
(13:43:30) mz: IcedTea-Web Plugin (using IcedTea-Web 1.3)
(13:43:51) xranby: you can place the jamvm libjvm.so inside the server or client dir to force it
(13:44:06) xranby: jre/lib/amd64/server
(13:45:13) mz: yes, think that's going to be necessary...
(13:46:28) xranby: for the record: (the reccomended way to test jamvm in combination with icedtea is to build icedtea with --enable-jamvm)
(13:46:52) mz: yep, the applet runs with jamvm
(13:47:00) xranby: ok cool thank you for testing

Xerxes Rånby (xranby) wrote :

Workaround:
edit /etc/java-*-openjdk/jvm*.cfg
and put
-jamvm KNOWN
on top of the list.

(In reply to comment #0)

> OpenJDK Zero VM (build 22.0-b10, mixed mode)
> Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
> [12:12:7511309852:ERROR:nss_util.cc(452)] Error initializing NSS without a
> persistent database: libsoftokn3.so: cannot open shared object file: Permission
> denied

May i know what you doing?
If accessing NSS consider your applet must be signed.
Also consider libsoftokn3.so has a "broken" dependency with libsqlite3.so (you can see it using ldd)

Can you reproduce this in a normal application? Or is it specific to running as an applet?

Changed in openjdk:
importance: Unknown → Medium
status: Unknown → Confirmed

The angelesgl2es1 applet is using mixed signed and unsigned code.
This testcase now pass using the icedtea-web hg HEAD that include the fix for bug 1592 .
http://icedtea.classpath.org//hg/icedtea-web?cmd=changeset;node=526fb9663b14

Marking as duplicate of bug 1592

*** This bug has been marked as a duplicate of bug 1592 ***

Changed in openjdk:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.