summaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/common
Commit message (Collapse)AuthorAgeFilesLines
* Bug 980: Refine Bitstream API 'signed' and 'unsigned' semantics - ↵Sven Gothel2014-02-211-5/+1
| | | | readUInt32(..) must return long due to EOF
* Bug 980: Use Bitsream class for jogamp.common.os.elf.**Sven Gothel2014-02-202-18/+12
|
* Bug 958 - Add support for OpenJDK version notationSven Gothel2014-02-161-3/+10
| | | | | | | | | | | | | | | | | | Manu <[email protected]>: In OpenJDK, Java version notation is a little different from Oracle JDK one: OpenJDK uses "-u" instead of "_" to separate the version number from the update number, i.e. "1.7.0-u60-b04" vs "1.7.0_60-ea". That would be nice to take this into account in the static initializer of jogamp.common.os.PlatformPropsImpl class. You could simply replace the line: final int usIdx = JAVA_VERSION.lastIndexOf("_"); by: final int usIdx = JAVA_VERSION.replace("-u", "_").lastIndexOf("_"); If you want to program it better, you can also test the "java.runtime.name" property that returns "OpenJDK Runtime Environment" for OpenJDK. See also bug #944 https://jogamp.org/bugzilla/show_bug.cgi?id=944 +++ Done .. avoding the replace op.
* Bug 856 - Android: Support dual ABI (x86 i686 *and* ARMv7arm), i.e. pick ↵Sven Gothel2014-01-244-145/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'best' ABI - Use 'os.arch' as a prelim CPUType for MachineDescription - Always attempt to load a binary and parse it's elf header - Linux: self-exe - Android: gluegen-rt library - Other: java lib - Always use details (ABI) if ARM - Android: Check CPU_TYPE and CPU_TYPE2 // FIXME / HACK: // We use sCPUType for MachineDescriptionRuntime.getStatic() // until we have determined the final CPU_TYPE, etc. // MachineDescriptionRuntime gets notified via MachineDescriptionRuntime.notifyPropsInitialized() below. // // We could use Elf Ehdr's machine value to determine the bit-size // used for it's offset table! // However, 'os.arch' should be a good guess for this task. Tested manually on - Linux x86, x86_64, armhf (raspi) - Android intel and arm - Windows x86_64 - OSX x86_64
* Bug 944 - Platform doesn't parse early-access java-version string properly ↵Sven Gothel2014-01-141-5/+4
| | | | | | | | | (JAVA_VERSION_UPDATE) Fix JAVA_VERSION_UPDATE for early release versions. Early access java versions are e.g. '1.7.0_60-ea' where releases simply are named: '1.7.0_60'.
* PlatformPropsImpl: Add static class OSXVersion w/ selected OSX VersionNumbersSven Gothel2013-10-241-1/+11
|
* gluegen: add all missing @Override annotationsHarvey Harrison2013-10-177-0/+10
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: remove trailing whitespaceHarvey Harrison2013-10-1723-437/+437
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Bug 816: Add Platform.JAVA_VERSION_UPDATE - Allowing to determin whether JVM ↵Sven Gothel2013-09-221-0/+15
| | | | is >= 1.7.0u40
* Remedy for Bug 782: Issue Debug.initSingleton() or Debug.debug(..) before ↵Sven Gothel2013-07-171-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | calling 'PropertyAccess.isPropertyDefined(propName, default)' through Debug class. Calling 'Debug.isPropertyDefined(propName, default)' may be 'optimized' to 'PropertyAccess.isPropertyDefined(propName, default)', which would skip the modules Debug's class initialization. Iff that happens, an AccessControlException may happen, due to requesting an insecure property, since modules own Debug class has not been added it's trusted prefixes from within it's init block yet. This seems to be a bug of the JVM .. to me, however .. the above description is the only able to explain the issue at hand. +++ Fix calls Debug class own static methods, either Debug.initSingleton() or Debug.debug(), before calling 'isPropertyDefined(propName, default)'. +++ Also mark Debug class static methods final! +++
* Fix a typo (Retruns => Returns)Sylvestre Ledru2013-07-101-1/+1
|
* UnixDynamicLinkerImpl: Unify impl. of openLibraryLocal(..), ↵Sven Gothel2013-06-254-115/+32
| | | | openLibraryGlobal(..) and lookupSymbolGlobal(..) - removing duplicate code.
* Fix SingletonInstanceServerSocket.kill(): Needs to mark alive=false in case ↵Sven Gothel2013-06-251-1/+1
| | | | of JVM shutdown!
* Fix commit eb842815498f5926828b49c48fffce22fc9586a2: Adding missing filesSven Gothel2013-06-222-0/+179
|
* Security: Tighten DynamicLinker*, NativeLibrary and DynamicLibraryBundle ↵Sven Gothel2013-06-214-27/+63
| | | | | | | | | | | | | | | | | | | | | | access (2) - Completes 23341a2df2d2ea36784a16fa1db8bc7385351a12 - Replace 'DynamicLinker' interface w/ well documented one - All DynamicLinker methods are now considered secure, i.e.: - open/lookup and close utilize reference counting on handle via a hash map. - lookupSymbol(..) and close(..) impl. validate the passed library handle whether it's retrieved via open*. This is the fast path, not that expensive. - lookupSymbolGlobal(..) performs Check acccess of 'new RuntimePermission("loadLibrary.*")' if SecurityManager is installed. This is the slow path. - DynamicLibraryBundleInfo now reflects the security requirements, i.e. whether priviledged access is needed.
* DynamicLinker*: Proper Override notationSven Gothel2013-06-204-3/+15
|
* Security: Tighten DynamicLinker*, NativeLibrary and DynamicLibraryBundle access.Sven Gothel2013-06-204-66/+137
|
* Robostness: Catch Throwables on NativeLibrary.open(..) and be verbose in ↵Sven Gothel2013-06-182-1/+9
| | | | DEBUG mode ; DynamicLinker: Add 'String getLastError()'.
* Fix DynamicLinker Impl: Add Bionic specialization using Bionic's non POSIX ↵Sven Gothel2013-06-164-58/+83
| | | | | | | | | | | | | | | values; Using same pattern for Mac OS X. Add Bionic specialization using Bionic's non POSIX values - derive from UnixDynamicLinkerImpl - specify own flag and mode values - use UnixDynamicLinkerImpl native code Using same pattern for Mac OS X - derive from UnixDynamicLinkerImpl - specify own flag and mode values - use UnixDynamicLinkerImpl native code - drop MacOSXDynamicLinkerImpl native code
* Fix Bug 749: Add Support for Solaris SPARC 32bitBritta Eckhardt2013-06-131-12/+17
|
* Bug 752: Review Code Vulnerabilities (Permission Checks of new exposed code ↵Sven Gothel2013-06-114-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Enhance VersionNumber*: Use only RegExp and cache default (no wrapped ↵Sven Gothel2013-05-311-2/+2
| | | | whitespace tokenizer); String match: Store end-of-match and flag defined components.
* RecursiveThreadGroupLockImpl01Unfairish: Fix DEBUG outputSven Gothel2013-05-051-3/+4
|
* gluegen: remove executable bit from java and c source filesHarvey Harrison2013-04-093-0/+0
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Fix RecursiveLockImpl* corner case: Timeout reached but lock released -> ↵Sven Gothel2013-03-182-16/+20
| | | | | | Assume Lock If timeout has been reached but the lock has been released, the lock has to be assumed.
* Promote AWTEDTExecutor to public package com.jogamp.common.util.awt ; ↵Sven Gothel2013-02-281-110/+0
| | | | Exclude java.part.awt in android gluegen-rt.
* Bug 681: Add Elf Parsing for other OS than Linux, if ARM and !ANDROID using ↵Sven Gothel2013-02-091-34/+83
| | | | | | | | /proc/self/exe (Linux) or a found java/jvm native lib. - PlatformPropsImpl.queryABITypeImpl: Check Elf Header for ARM + !ANDROID (i.e. add other OS than Linux, use native java/jmv lib) - NativeLibrary.enumerateLibraryPaths: Add 'sun.boot.library.path' to enumeration! - TestElfReader01: Add test for finding java/jvm native lib and parse it
* Bug 681: Use ELF Header + ARM EABI Section Parsing in PlatformPropsImpl to ↵Sven Gothel2013-02-082-22/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to distinguish ARM soft-float/hard-float (part-2) + /** + * Returns the {@link ABIType} of the current platform using given {@link CPUType cpuType} + * and {@link OSType osType} as a hint. + * <p> + * Note the following queries are performed: + * <ul> + * <li> not {@link CPUFamily#ARM} -> {@link ABIType#GENERIC_ABI} </li> + * <li> else + * <ul> + * <li> not {@link OSType#LINUX} -> {@link ABIType#EABI_GNU_ARMEL} </li> + * <li> else + * <ul> + * <li> Elf ARM Tags -> {@link ABIType#EABI_GNU_ARMEL}, {@link ABIType#EABI_GNU_ARMHF} </li> + * </ul></li> + * </ul></li> + * </ul> + * </p> + * <p> + * Elf ARM Tags are read using {@link ElfHeader}, .. and {@link SectionArmAttributes#abiVFPArgsAcceptsVFPVariant(byte)}. + * </p> + * + * @param cpuType + * @param osType + * @return + */ + private static final ABIType queryABITypeImpl(CPUType cpuType, OSType osType) {
* Bug 681: Add Basic ELF Header + ARM EABI Section Parsing, allowing to ↵Sven Gothel2013-02-087-0/+1683
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | distinguish ARM soft-float/hard-float (part-1) https://jogamp.org/bugzilla/show_bug.cgi?id=681 + * References: + * <ul> + * <li>http://linux.die.net/man/5/elf</li> + * <li>http://www.sco.com/developers/gabi/latest/contents.html</li> + * <li>http://infocenter.arm.com/ + * <ul> + * <li>ARM IHI 0044E, current through ABI release 2.09</li> + * <li>ARM IHI 0045D, current through ABI release 2.09</li> + * </ul></li> Added self contained jogamp.common.os.elf package w/ entry point class ElfHeader to read a RandomAccessFile and parse it as an ELF file. ELF Parsing completness: - Header: OK - SectionHeader: OK - Section Type SHT_ARM_ATTRIBUTES: OK - Will be read into SectionArmAttributes - Used to distinguisgh soft/hard VFP float Tested manually on: - Linux intel 32bit / 64bit, arm soft-float and hard-float
* Modified Java 1.5 Buffers patch 2b7d1b1d25cb2cd73311ec9159b465f0391bf5e0 - ↵Sven Gothel2013-01-191-7/+13
| | | | | | | | | | | | | | May break GCJ/ECJ .. needs to be revised. - Adding JAVA_6 in PlatformPropsImpl - Buffers.isDirect() chooses fast-path iff JAVA_6, otherwise using reflection (GCJ/ECJ) - Adding JAVA_6 info in VersionUtil - API doc: Refine JAVA_SE and JAVA_6 spec. TODO: In case GCJ etc is unable to compile the JAVA_6 code even though it uses a static condition (probably not), We have to wrap isStatic in an own class, one for JAVA_6 and one for <= 1.5. This will be a good exercise for further issues we may have w/ Java <= 1.5.
* Merge remote-tracking branch 'xranby/gcj-gij'Sven Gothel2013-01-181-2/+4
|\
| * PlatformPropsImpl: JAVA_RUNTIME_NAME is null using GCJ gij JRE.Xerxes Rånby2013-01-181-2/+4
| | | | | | | | Signed-off-by: Xerxes Rånby <[email protected]>
* | Android Completion for launching main() class via MainLauncher; Fix ↵Sven Gothel2013-01-181-2/+25
|/ | | | | | | | | | | | | | ActivityLauncher order of delegation/super activity callbacks. - StaticContext: - Add ViewGroup for standalone tests w/ UI - MainLauncher/LauncherUtil: - Complete launching a main() class from our activity launcher - adding main-cmdline-args - ActivityLauncher - Fix order of delegation/super activity callbacks.
* Refine AWTEDTExecutor.invoke(..): Allow control whether a non AWT-EDT may ↵Sven Gothel2012-12-281-15/+36
| | | | | | | execute the runnable. For some 'rare' AWT/GL lifecycle actions, it is required to only run the command on the AWT-EDT, hence adding an argument determining the restriction.
* gluegen: replace Thread name with name of lock file in ↵Harvey Harrison2012-10-161-1/+1
| | | | | | | | | | | | SingletonInstanceFileLock error message The getName() call here is currently calling Thread.getName() inherited by the anonymous inner class. This is ambiguous, and likely meant to call the getName() method of SingletonInstanceFileLock, which would output the lockfile name. In any event, infoPrefix() is already adding the Thread name for us. Signed-off-by: Harvey Harrison <[email protected]>
* SingletonInstanceServerSocket: serverSocket.setReuseAddress(true); // reuse ↵Sven Gothel2012-10-041-0/+1
| | | | same port w/ subsequent instance, i.e. overcome TO state when JVM crashed
* SingletonInstanceServerSocket: Add unit tests; Create new server Thread @ ↵Sven Gothel2012-09-212-18/+18
| | | | start, otherwise we may collide w/ a failed start. Misc: Cleanup / reuse strings.
* SingletonInstanceServerSocket: Add kill @ JVM Shutdown _and_ if normal ↵Sven Gothel2012-09-212-8/+42
| | | | unlock fails ; Added unit tests.
* AWTEDTExecutor: Add convenient "invoke(Object treeLock, boolean wait, ↵Sven Gothel2012-09-101-1/+25
| | | | Runnable r)" to be used directly
* Change/Lower ARM Requierements for GNU/Linux & Android-GNU/Linux ARM: ↵Sven Gothel2012-08-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ARMv7hf -> ARMv6hf, ARMv7-soft -> ARMv5te/ARMV6 (soft) platform build config files: lib/gluegen-cpptasks-linux-armv7.xml -> lib/gluegen-cpptasks-linux-armv6.xml lib/gluegen-cpptasks-linux-armv7hf.xml -> lib/gluegen-cpptasks-linux-armv6hf.xml properties: isLinuxARMv7 -> isLinuxARMv6 isLinuxARMv7Armel -> isLinuxARMv6Armel isLinuxARMv7Armhf -> isLinuxARMv6Armhf isAndroidARMv7 -> isAndroidARMv6 isAndroidARMv7Armel -> isAndroidARMv6Armel isAndroidARMv7Armhf -> isAndroidARMv6Armhf targets: compiler.cfg.linux.armv7 -> compiler.cfg.linux.armv6 linker.cfg.linux.armv7 -> linker.cfg.linux.armv6 compiler.cfg.linux.armv6: <compilerarg value="-fpic" /> <compilerarg value="-march=armv5te" /> <compilerarg value="-marm" /> <compilerarg value="-mfloat-abi=softfp" /> <linkerarg value="-fpic" /> <linkerarg value="-march=armv5te" /> <linkerarg value="-marm" /> <linkerarg value="-mfloat-abi=softfp" /> <linkerarg value="-nostdlib" /> <linkerarg value="-Bdynamic" /> compiler.cfg.linux.armv6hf: <compilerarg value="-fpic" /> <compilerarg value="-march=armv6" /> <compilerarg value="-marm" /> <compilerarg value="-mfloat-abi=hard" /> <linkerarg value="-fpic" /> <linkerarg value="-march=armv6" /> <linkerarg value="-marm" /> <linkerarg value="-mfloat-abi=hard" /> <linkerarg value="-nostdlib" /> <linkerarg value="-Bdynamic" /> gluegen-cpptasks-android-armv6.xml: <compilerarg value="-fpic" /> <compilerarg value="-march=armv6" /> <compilerarg value="-mfloat-abi=softfp" /> <compilerarg value="-marm" /> <linkerarg value="-march=armv6" /> <linkerarg value="-mfloat-abi=softfp" /> <linkerarg value="-marm" /> <linkerarg value="-nostdlib" /> <linkerarg value="-Bdynamic" />
* Lock Cleanup (API Change)Sven Gothel2012-06-276-17/+64
| | | | | | | | - LockExt -> ThreadLock - clarifying semantics (API Change) - ThreadLock: Remove isOwner(), use isOwner(Thread.currentThread) - adding @Override
* Fix Platform static initialization interdependencies w/ GlueGen native ↵Sven Gothel2012-06-182-7/+319
| | | | | | | | | | | | 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.
* Fix Bug 587: Use alternative storage location if platform's temp directory ↵Sven Gothel2012-06-162-6/+4
| | | | | | | | | | | | | | | | | | | | | is mounted w/ noexec ; IOUtil API change! Test whether executable files can be launched in temporary folder by trying to run an empty executable file - if !( WINDOWS | OPENKODE ) TempDir: 1) ${java.io.tmpdir}/jogamp 2) $XDG_CACHE_HOME/jogamp - if !( ANDROID | MACOS | WINDOWS | OPENKODE ) 3) $HOME/.jogamp $XDG_CACHE_HOME defaults to $HOME/.cache - TempFileCache: ${TempDir}/file_cache -> ${java.io.tmpdir}/jogamp/file_cache - LauncherTempFileCache: ${TempDir}/file_cache -> ${java.io.tmpdir}/jogamp/file_cache +++ AndroidUtils*.getTempRoot(): Remove unused AccessControlContext param
* Fix Bug 583: Remove Android compile-time dependencies and exclude Android ↵Sven Gothel2012-06-043-5/+139
| | | | | | | | | | | | | specific classes for non Android platforms. Android specifics are delegated via class AndroidUtils, which uses reflection to call AndroidUtilsImpl if platform is Android. Android code is confined to the packages: jogamp.common.os.android.* jogamp.android.launcher.* and only included when compiled for the Android platform.
* GlueGenVersionActivity: Add Scroller ..Sven Gothel2012-05-041-1/+5
|
* StringBuffer -> StringBuilder (Local objects, no concurrency)Sven Gothel2012-04-161-1/+1
|
* ActivityLauncher/LauncherUtil: Clear properties 'onDestroy()'Sven Gothel2012-04-091-8/+11
|
* Platform: Add AWT_AVAILABLE 'knowledge'; RunnableExecutor: Add AWTEDT impl. ↵Sven Gothel2012-03-261-0/+65
| | | | / API doc cleanup; DynamicLibraryBundle: Add getDefaultRunnableExecutor()
* Add 'asset' URLConnection; IOUtil uses URLConnection / incr. effeciency; ↵Sven Gothel2012-03-172-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android ClassLoaderUtil cleanup; - Add 'asset' URLConnection - Please read API doc 'PiggybackURLConnection' and 'AssetURLConnection' - Solves generic resource handling where platform locations may differ, ie ClassLoader lookup on Android in the 'assets/' subfolder. - New Android 'AssetDexClassLoader' uses 'assets/' folder for findResource(..) - aapt.signed (our APK ant task) - uses 'assets/' folder - adds the 'assetsdir' attribute allowing to copy other assets into the APK - IOUtil uses URLConnection / incr. effeciency - using URLConnection on all getResource(..) since URL is connected anyways for validation and URLConnection can be used by caller right away - String getRelativeOf(URL, String) -> URL getRelativeOf(URL, String) - preserves scheme, authority, etc - simple parentOf handling, more efficient - reusing new 'asset' protocol impl. - Android ClassLoaderUtil cleanup; - Use createClassLoader(..) impl for build-in static jogamp and user APKs, which removes code redundancy Tests: New code path, especially 'assets' are covered by new unit tests, no regressions on Linux.
* PropertyAccess: Push down 'isPropertyDefined(final String property, final ↵Sven Gothel2012-03-131-0/+4
| | | | | | boolean jnlpAlias)' for trusted properties The method shall be called by the respective Debug specialization, which registers the trusted property prefix.