| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
lib couldn't be loaded (avoid showing misleading orig exception)
.. and detail some debug output. Both, own exception and debug output expose NativeLibrary.getSystemEnvLibraryPaths()
|
| |
|
|
|
|
| |
executables
|
|
|
|
| |
for System related Operations
|
|
|
|
| |
'jogamp.debug.JNILibLoader.Perf'
|
|
|
|
|
|
|
| |
single-slim-jar, #2 fat-jar, #3 Classpath + TAG.class
We shall attempt the official recommendation of deployment first (single-slim-jar)
not wasting time trying a 'nativeLibraryPath' lookup within the classpath.
|
|
|
|
|
|
|
|
| |
'natives/os.and.arch', reducing JAR search.
Since all native libraries are now contained within 'natives/os.and.arch',
we don't need to search the whole JAR file anymore
but simply can copy the content of the defined folder - if existing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
extension mechanism
NativeLibrary:
API change: Removed searchSystemPathFirst argument to the
open and enumerateLibraryPaths methods.
Removed the generic sun.boot.library.path system path and the
MacOS specific Frameworks paths from enumerateLibraryPaths.
JNILibLoaderBase, PlatformPropsImpl & TestElfReader01:
Updated to handle the NativeLibrary API change.
This change will prevent JogAmp modules to pickup and load unsupported
and old SUN JOGL 1 natives that may have been deployed with the JRE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Uri:
- Add error correction (fix) of path at ctor
in case a a contained Uri is requested from an opaque one.
The latter might come from URI/URL and is not properly encoded!
See Uri.PARSE_HINT_FIX_PATH
- Simplify conversion methods:
- valueOf(URI/URL): Re-encode only if not opaque
- getNativeFilePath() -> toFile()
- Move IOUtil Uri related constants to class Uri
- Add DEBUG and DEBUG_SHOWFIX
- Complete adoption of URI -> Uri changes
- IOUtil, JarUtil and TempJarCache still holds some
left over deprecated methods, which will be removed
after officially starting 2.3.0 (JOGL dependencies)
- Otherwise not URI utilization left
- Tests
- Cleaned ip TestUri01 and TestUri03Resolving
- TestUri03Resolving also tests URL -> Uri,
and hence mentioned Uri.PARSE_HINT_FIX_PATH
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In situations, where the native-jar file is not located within
the same parent URI as it's java-jar file, our location mechanism fails.
This patch adds a classloader based native-jar file location mechanism as a fallback,
requiring the native jar file to be included in the users CLASSPATH.
Classloader based location algorithm in JNILibLoaderBase.addNativeJarLibsImpl(..):
- Extract the 'module-name' from the given classFromJavaJar's package name,
i.e. the last package-part: 'jogamp.common.Debug' -> 'common'
Hence it is important to pass a 'classFromJavaJar',
which last package segment reflects the module-name!
- <os.and.arch> -> <os_and_arch_dot>, e.g. linux-amd64 -> linux.amd64 (linux/amd64)
- Locate class 'jogamp.nativetag.<module-name>.<os_and_arch_dot>.TAG',
e.g. 'jogamp.nativetag.common.linux.amd64.TAG'
- Use located class's JarFile URI .. continue as usual
Injection of above mentioned TAG class via gluegen-cpptasks-base.xml macro 'native.tag.jar':
- Creates dummy TAG.java code
- Compiles TAG.java
- Creates the native-jar file
Example:
<native.tag.jar objdir="${build}/obj"
nativejarfile="${build}/gluegen-rt-natives-${os.and.arch}.jar"
manifestfile="${build}/Manifest-rt-natives.temp"
module="common"
includelibs="*gluegen-rt.${native.library.suffix}" />
Note that the manifest file uses a matching Extension-Name:
Extension-Name: jogamp.nativetag.common
|
|
|
|
|
|
|
| |
'[-noawt,-mobile,-core,-android]?' in API-doc, ...
- rename addNativeJarLibsWhenInitialized(..) -> addNativeJarLibsWithTempJarCache(..)
to fix grammar and expose proper semantics.
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
src/java/com/jogamp/common/os/Platform.java
src/junit/com/jogamp/common/util/TestTempJarCache.java
(re-injected that api-doc of addNativeJarLibsImpl)
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Bug: 1023
Bug: 1024
|
| |
| |
| |
| | |
of the method.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
|
|/ |
|
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Always use the jar-basename when calling TempJarCache.addNativeLibs(..),
otherwise it is mapped and loaded multiple times leading to different native libraries.
Simplify addNativeJarLibsImpl(..) argument semantics by passing complete jarBasename
and nativeJarBasename (w/ suffix).
Added manual test scripts validating [gluegen + jogl] usage
with multi (Bug 843) and fat (Bug 845) jar configurations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'os.and.arch' libraries]
JNILibLoaderBase.addNativeJarLibsImpl(..):
If the modules's jar file contains the folder 'natives/<os.and.arch>/'
we assume a big-fat jar and attempt to load all native libraries from the same.
The test for above folder is performed via the class ClassLoader's getResource(..)
and is considered inexpensive.
If the folder exists and native libraries could be loaded, the method returns successfull.
Otherwise, the 'slim' jar file is attempted to be loaded, even if such folder exist.
|
|
|
|
| |
native URI root and jar file.
|
|
|
|
| |
module dependencies, added more API doc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compatible w/ file scheme.
Regression of (Bug 683, Commit b98825eb7cfb61aead4a7dff57471cd2d2c26823).
The URI encoded path cannot be read by File I/O (if file scheme), since the latter
requests an UTF8/16 name, not an URI encoded name (i.e. %20 for space).
The encoded URL is produced if calling 'uri.toURL()' and hence
the new 'IOUtil.toURL(URI)' provides a custom conversion recovering the UTF name via 'new File(uri).getPath()'.
Tested w/
- synthetic URI/URL coposition (unit test)
- manual w/ moving 'build' to 'build öä lala' for gluegen, joal and jogl.
+++
Misc.:
- 'URI JarUtil.getURIDirname(URI)' -> 'URI IOUtil.getDirname(URI)'
++
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and privileged access)
This review focuses on how we perform permission checks,
or better - do we circumvent some assuming full privileges ?
Some native methods do need extra permission validation, i.e. loading native libraries.
Further more AccessController.doPrivileged(..) shall not cover generic code
exposing a critical feature to the user.
Further more .. we should rely on the SecuritManager, i.e. AccessControlContext's
'checkPermission(Permission)' code to comply w/ fine grained permission access.
It is also possible to have full permission w/o having any certificates (-> policy file).
+++
We remove implicit AccessController.doPrivileged(..) from within our trusted code
for generic methods, like Property access, temp. files.
+++
SecurityUtil:
- Remove 'getCommonAccessControlContext(Class<?> clz)',
which returned a local AccessControlContext for later restriction
if the passed class contains all certificates as the 'trusted' GlueGen class has.
- Simply expose convenient permission check methods relying on
SecurityManager / AccessControlContext.
PropertyAccess:
- 'protected static void addTrustedPrefix(..)' requires AllPermissions if SecurityManager is installed.
- Remove implicit doPrivileged(..) triggered by passed AccessControlContext instance,
only leave it for trusted prefixes.
IOUtil:
- Remove all doPrivileged(..) - Elevation shall be performed by caller.
DynamicLinker:
- 'public long openLibraryLocal(..)' and 'public long openLibraryGlobal(..)'
may throw SecurityException, if a SecurityManager is installed and the dyn. link permission
is not granted in the calling code.
Implemented in their respective Unix, OSX and Windows manifestation.
Caller has to elevate privileges via 'doPrivileged(..) {}' !
+++
Tests:
- Property access
- File access
- Native library loading
Manual Applet test (unsigned, but w/ SecurityManager and policy file):
> gluegen/test/applet
Applet has been tested w/ signed JAR w/ Firefox and Java7 on GNU/Linux as well.
Manual Application test (unsigned, but w/ SecurityManager and policy file):
com.jogamp.junit.sec.TestSecIOUtil01
- Run w/ SecurityManager and policy file:
- gluegen/scripts/runtest-secmgr.sh
- Run w/o SecurityManager:
- gluegen/scripts/runtest.sh
|
|
|
|
| |
to remove DNS Lookups etc ..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- NativeLibrary Fix
- enumerateLibraryPaths(..):
- Properly iterate through all prefix _and_ suffix.
- Make public for JNILibLoaderBase.loadLibraryInternal(..)
- isValidNativeLibraryName(..):
- Stop iterating through prefix, if previously found
but suffix doesn't match.
- JNILibLoaderBase.loadLibraryInternal(..) Enhancement
- Mark customLibLoader FIXME: remove (we will get rid of jnlp.launcher.class)
- If System.load(TempJarCache) and System.loadLibrary(plainLibName) fails,
use NativeLibrary.enumerateLibraryPaths() w/ System.load(..) as last resort.
Tested on Linux x86_64 Java6 and OSX Java7 manually, no regressions expected.
|
|
|
|
|
|
|
| |
JNILibLoaderBase.loadLibraryInternal() to NativeLibrary.findLibrary(..)
This allows using TempJarCache (if used/initialized) for native 'tool' libraries as well.
This is the case of JOAL's attempt to load the provided 'libopenal.so'
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Derivation
+++
JNILibLoaderBase.addNativeJarLibs(..): Add API doc
JNILibLoaderBase:
"addNativeJarLibs(Class<?> classFromJavaJar, String allNativeJarBaseName, String[] atomicNativeJarBaseNames)" ->
"addNativeJarLibs(Class<?>[] classesFromJavaJars, String singleJarMarker, String[] stripBasenameSuffixes)"
Derive the 'all' (1st choice) native JAR URL solely on the given class's JAR URL.
Examples:
JOCL:
// only: jocl.jar -> jocl-natives-'os.and.arch'.jar
addNativeJarLibs(new Class<?>[] { JOCLJNILibLoader.class }, null, null );
JOGL:
final ClassLoader cl = GLProfile.class.getClassLoader();
// either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar] -> jogl-all-natives-<os.and.arch>.jar
// or: nativewindow-core.jar -> nativewindow-natives-<os.and.arch>.jar,
// jogl-core.jar -> jogl-natives-<os.and.arch>.jar,
// (newt-core.jar -> newt-natives-<os.and.arch>.jar)? (if available)
final String newtFactoryClassName = "com.jogamp.newt.NewtFactory";
final Class<?>[] classesFromJavaJars = new Class<?>[] { NWJNILibLoader.class, GLProfile.class, null };
if( ReflectionUtil.isClassAvailable(newtFactoryClassName, cl) ) {
classesFromJavaJars[2] = ReflectionUtil.getClass(newtFactoryClassName, false, cl);
}
JNILibLoaderBase.addNativeJarLibs(classesFromJavaJars, "-all", new String[] { "-noawt", "-mobile", "-core" } );
Efficiency / Performance:
- Reduced JAR URL lookup calls JarUtil.getJarURL(..) - JNILibLoaderBase, Platform, JarUtil
- Attempt loading Jar files (native, class, ..) only once - TempJarCache
Code Cleanup (IOUtil, JarUtil, :
- IOException if not found
- IllegalArgumentException if null argument
+++
jogamp.android-launcher.jar -> jogamp-android-launcher.jar
+++
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1468286bf569a493e4fdb887d5f3732f88c8cec3) 'update' scenario in same JVM instance.
TempFileCache/LauncherTempFileCache were using the system property
'jnlp.jogamp.tmp.cache.root', if set.
However, in case one JVM launched an old GlueGen (Applet)
and then launching a new GlueGen (Applet) w/ a new tmpDir location,
the property is still set but the tmpRootDir location does not exist.
This patch tolerates this situation and cont. setting a new tmpRootDir.
Example:
JVM1.GlueGen1 tmpDir: /tmp/, tmpRootDir: /tmp/jogamp.tmp.cache_000000/
JVM1.GlueGen2 tmpDir: /tmp/jogamp_0000/, tmpRootDir: /tmp/jogamp_0000/file_cache/
Misc:
- IOUtil: Always use 'jogamp_xxxx' as the sys-temp subfolder for tmpDir
- JNILibLoaderBase: Remove unised import
- TempJarCache.validateCertificates(): Add OK DEBUG output.
|
|
|
|
|
|
|
|
|
|
|
|
| |
library loading
Some Platform field declarations and it's static initialization has been delegated
to it's new abstract super class PlatformPropsImpl to solve
static initialization interdependencies w/ the GlueGen native library loading
and it's derived information {@link #getMachineDescription()}, {@link #is32Bit()}, ..<br>
This mechanism is preferred in this case to avoid synchronization and locking
and allow better performance accessing the mentioned fields/methods.
|
|
|
|
| |
System.loadLibrary(libraryPath) -> System.load(libraryPath)
|
|
|
|
|
|
|
|
|
|
|
| |
tool native libraries.
NativeLibrary: Expose 'String findLibrary(String libName, ClassLoader loader)',
allowing utilization of System.load(loader.findLibrary(libName)).
JNILibLoaderBase.loadLibrary(): Add optional ClassLoader argument, used to locate the library
DynamicLibraryBundle: Use DynamicLibraryInfo's ClassLoader to find native libraries (tool + jni)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PropertyAccess: Fix security code, grant access to common 'trusted' properties
- SecurityUtil
- Generalize cert validation for JAR and property access
- Grant access to common AccessControlContext for 'same' cert
- PropertyAccess:
- Fix security code: Passing the current AccessControlContext from the caller
didn't include priviledges.
- Grant access to common 'trusted' properties,
which removes the need of passing the AccessControlContext for general properties
like 'jnlp.', 'jogamp.' ..
- Enable registering 'trusted' properties, when caller's cert is 'same'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Platform, IOUtil, ..
- Intro.: PropertyAccess
- Base class of all Debug impl, reduces redundancies.
- jnlpAlias'ed trusted property is queried within local AccessControlContext
to avoid 'JRE' implementation differences (should not be required).
- throw NPE and IllegalArgumentException for invalid property key
- Added safe PropertyAccess
- JNILibLoaderBase: sun.jnlp.applet.launcher
- Platform: jogamp.gluegen.UseTempJarCache
- IOUtil: java.io.tmpdir
|
|
|
|
| |
IllegalArgumentException) - solves case using plain class instead of JAR file
|
|
|
|
| |
our lifecycle. JarFile's hash almost always differs.
|
|
|
|
|
|
|
|
| |
JNILibLoaderBase's 'addNativeJarLibs(Class<?> classFromJavaJar, String allNativeJarBaseName, String[] atomicNativeJarBaseNames)'
now just attempts to load the 'all' variant, and will continue w/ atomics if not successful (ie not available).
It skips the validation of a 'allJavaJarPrefix', ie validating the 'classFromJavaJar holding JAR file,
which allows GLUEGEN/JOGL classes to be contained in JAR files other than the original.
|
|
|
|
|
|
|
|
| |
Add unit test.
Misc.:
- IOUtil: Add toURL* methods
- TempJarCache: Add 'URL getResource(String)'
|
|
|
|
| |
'atomic' variants
|
| |
|
|
|
|
| |
Platform static init after loading native library.
|
|
|
|
| |
Certificates if caller has any. Add Convenient JNILibLoaderBase.addNativeJarLibs(..) method.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TempJarCache.bootstrapNativeLib(..) usage
- Moving to Platform solves former interdependencies between GlueGenJNILibLoader/Platform
- TempJarCache is being setup w/ bootstraping the gluegen-rt native lib jar file.
Interesting here is that when using Oracle's JRE w/ Applets/JNLP the
current dbg output is:
gluegen-rt: url-root http://risa/deployment/test/jau02s/jar/
gluegen-rt: nativeJarURL jar:http://risa/deployment/test/jau02s/jar/gluegen-rt-natives-linux-amd64.jar!/
gluegen-rt: nativeJar /home/sven/.java/deployment/cache/6.0/49/3c6d1e31-2c90f42e
IE the JRE implementation already deduces the online link to the Applet/JNLP cache.
This makes the implementation much simpler, ie. same for application and Applets/JNLP.
Have to verify w/ other Java impl. sure - and add same logic for the JOGL part.
|
|
|
|
|
|
| |
- JNILibLoaderBase: If TempJarCache is active, try find native library in cached JARs
- TempJarCache: Add bootstrabNativeLib(..) allowing bootstraping gluegen-rt from JAR w/o needing it
- JARUtil: minor edits (final)
|
|
|
|
|
|
|
|
| |
gluegen-rt native lib as well
- removed redundance
- move proper JNLPAppletLauncher custom libloader code into JNILibLoaderBase
- prepares for new JAR temp cache ..
|
| |
|