Giter Club home page Giter Club logo

jnr-ffi's People

Contributors

aploese avatar basshelal avatar bkgood avatar charleskorn avatar emcrisostomo avatar enebo avatar eregon avatar gdiet avatar gilles-duboscq avatar goto1134 avatar headius avatar henriquemotaesteves avatar jernst avatar johan-lecuyer avatar jsorel avatar laffer1 avatar mkristian avatar mpoindexter avatar nabijaczleweli avatar nirvdrum avatar ntkme avatar panxuefeng-loongson avatar pepijnve avatar pjenvey avatar praj-foss avatar tduehr avatar theprez avatar vp-of-awesome avatar vvs avatar zhanhb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jnr-ffi's Issues

Make Struct.Function public

Right now Struct.Function is protected which prevents us from assigning the value of the function pointer after construction of the derived Struct class. Most of the other inner classes are declared public which allows assignment and update at any time so it seems like an oversight to not make this one public too.

The reason this is useful is when you are wrapping a C-api where you need to implement callbacks. For different implementations you will want to specify different callbacks. So your derived Struct will only be initializing the function pointers to zero and an owning class would set them. As a workaround I'm following the same strategy as the developer of jnr-fuse... define my own AbstractMember that is a straight copy of Function but made public. But I really don't want to duplicate code.

Return a struct by value

Unless I missed something there is no way in jnr-ffi, to bind a function which return a struct by value.

This available at jffi level using Invoker.invoke or Invoker.invokeStruct but it would be nice to have it a jnr-ffi level.

Question on @Direct struct parameters

Hi I'm new using JNR and I have a question regarding the "Direct" annotation on struct parameters.
When I read the comment in the code, I understood that adding this annotation would allow to store the struct in direct memory before passing it to native code, to make it persistent for later access.

But I have made the following experiment :

My testlib.c:

#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>

struct SimpleStruct {
	double doubleMember;
};

//local copy of doubleMember value
double  localDoubleMember;

//local pointer to the struct
struct SimpleStruct * localStruct;

bool compareDoubleMemberAndLocalCopy(){
	return localStruct->doubleMember == localDoubleMember;
}
bool setStruct(struct SimpleStruct *simpleStruct) {
	localStruct = simpleStruct;
	localDoubleMember = simpleStruct->doubleMember;
	return compareDoubleMemberAndLocalCopy();
}
bool setDirectStruct(struct SimpleStruct *simpleStruct){
	 return setStruct(simpleStruct);
}
bool setStructByPointer( struct SimpleStruct *simpleStruct){
	 return setStruct(simpleStruct);
}

Corresponding java lib :

public interface TestLib {	
	
	public class SimpleStruct extends Struct{
		protected SimpleStruct(Runtime runtime) {
			super(runtime);
		}
		public Double doubleMember = new Double();	
	}
	public boolean setStructByPointer(Pointer structPointer);
	public boolean setDirectStruct(@Direct SimpleStruct struct);
	public boolean setStruct(SimpleStruct struct);
	public boolean compareDoubleMemberAndLocalCopy();
	
}

And finally my test case:

public class TestCase {

	public static void main(String[] args) {
		TestLib testLib = LibraryLoader.create(TestLib.class).load(args[0]);
		
		SimpleStruct simpleStruct = new SimpleStruct(Runtime.getSystemRuntime());
		simpleStruct.doubleMember.set(42.0);
		
		boolean areEqual = false;
		
		areEqual = testLib.setStruct(simpleStruct);
		System.out.println("Simple set struct : " + areEqual);
		
		areEqual= testLib.compareDoubleMemberAndLocalCopy();
		System.out.println("After simple set struct : " + areEqual);
		
		areEqual=testLib.setDirectStruct(simpleStruct);
		System.out.println("Direct set direct struct : " + areEqual);
		
		areEqual=testLib.compareDoubleMemberAndLocalCopy();
		System.out.println("After set direct struct : " + areEqual);
		
		//here we explicitly allocate direct memory for the struct
		Pointer structPointer = Memory.allocateDirect(Runtime.getRuntime(testLib), Struct.size(simpleStruct));
		structPointer.putDouble(simpleStruct.doubleMember.offset(),42.0);
		
		areEqual=testLib.setStructByPointer(structPointer);
		System.out.println("Set Pointer: " + areEqual);
		
		areEqual=testLib.compareDoubleMemberAndLocalCopy();
		System.out.println("After Set Pointer : " + areEqual);
	}
}

I have the following output :

Simple set struct : true
After simple set struct : false
Direct set direct struct : true
After set direct struct : false
Set Pointer: true
After Set Pointer : true

We see that simple setStruct and setDirectStruct seem to behave the same, in both case the struct content is lost in native code. It is only preserved if I explicitly allocate Direct memory for the struct (setStructByPointer).

Is it normal? If yes what is finally the effect of the "Direct" annotation?

Thanks in advance,

Best regards,

Sebastien

ReflectASM

I found a nice library ReflectASM to replace slow reflection.

Currently I'm not ready to help with testing it, but I think, it should be used due to the benchmarks on the repo.

Utilize critical jffi invokes to bind compatible functions and pass-through primitives

While discussing ways to implement #68, user @Spasi opened our eyes to the magic of HotSpot's JavaCritical "Critical Natives" feature described here:

http://stackoverflow.com/questions/36298111/is-it-possible-to-use-sun-misc-unsafe-to-call-c-functions-without-jni/36309652#36309652

The potential for jnr-* here is tremendous:

  • We could make critical-compatible function calls much cheaper...possibly no overhead at all.
  • We could provide better performance for calls that pass around arrays of primitives, like IO operations.

In thinking through the original feature request at #68 and combining it with the whirl of ideas going through my head right now, here's some rough direction...

Basically we'd add new invoke endpoints to jffi that are JavaCritical. When supported and requested by a user (jnr-ffi on up, probably an annotation), we'd use these endpoints to do invocation. Ignoring the function called, we already meet most of the requirements for JavaCritical since most (all?) forms of Foreign.invoke just takes primitive arguments.

This would feed into supporting primitive arrays, since a JavaCritical-assisted FFI-bound function could get at that array directly. This would probably be done via a parameter annotation indicating that the array should be passed through following JavaCritical's requirements, and on the other side our new endpoints would pass it on to the function.

It seems like the initial work to add new JavaCritical endpoints and support for them in jnr-* wouldn't be too bad. It's the first change in a long time that requires rebuilding all our native bits, but there's compelling reasons to go forward.

Doc + thread safety

Using JNR and love it! Three questions:

  1. where's the right place to ask questions ;)
  2. Thread safety: is it safe to make concurrent calls via a generated lib interface sharing the same Runtime? (Seems to work but wanted to check)
  3. Any docs on how jnr works anywhere? Watched the presentation on YouTube - but a bit high level

Any info much appreciated!

__stdcall

I'm using JNR and trying to call to __stdcall function. I've already tried to load library with stdcall() convention:

mTemplateApi = LibraryLoader.create(FPTemplateAPI.class).stdcall().load("FPTemplateAPI");

And tried to annotate method with @StdCall.

public interface FPTemplateAP  
{
    @StdCall
    Pointer CreateTemplateImage(@In ByteBuffer aTemplate,
                                @Out IntByReference aWidth,
                                @Out IntByReference aHeight,
                                @In boolean aColor);

}

As result I get the following error when I try to call to method:

Exception in thread "main" java.lang.UnsatisfiedLinkError: The operation completed successfully.

at jnr.ffi.provider.jffi.AsmRuntime.newUnsatisifiedLinkError(AsmRuntime.java:40)

UPD: I made another dll that has method, that delegates to this one with __stdcall methods, and it works fine. But still need solution for my problem.

Disable signing for snapshot builds

Signatures are only really needed for releases; executing the signing plugin on snapshot builds is unnecessary and can interfere with continuous integration systems (see, e.g., the current build breakage on Travis CI).

Default Struct.StringRef constructor creates Integer.MAX_VALUE string?

I'm trying to understand the best way to use jnr-ffi to pass byte buffers into a native library, and am confused by the intended use of Struct.String and Struct.StringRef. I assumed that the former was intended for use in structures like

struct inlined_string {
    char string_field[kFieldSize];
}

and the latter for structures like

struct reference_string {
    char *string_ref_field;
}

I get this impression given that the set method of Struct.String writes directly to memory, while that of Struct.StringRef allocates new memory and then writes. The default constructor for both, however, sets the string length to Integer.MAX_VALUE, or 2**31 - 1, and this value is used for allocation, rather than the input value size. This leads to failed allocations (the Struct.length is multiplied by 4, leading to integer overflow) unless a maximum value size is specified in advance.

It seems like the proper thing to do for Struct.StringRef.set(String value) would be to allocate enough storage for the passed-in value, rather than a large default. Am I understanding the intentions of these types correctly? I'm happy to submit a patch if so.

uid_t/gid_t should be UINT on sparcv9, not SLONG

The incorrect type appears to be specified in:

src/main/java/jnr/ffi/provider/jffi/platform/sparcv9/solaris/TypeAliases.java

Looks like in some update to Solaris 10, Sun cleaned up the header file to report uid_t as uint32_t:

https://docs.oracle.com/cd/E19082-01/820-0543/gfraf/index.html

whereas before it was long on 32 bit and int on 64 bit.. so in any case always a 32 bit value.

I don't have a Solaris system to check on. But I looked at Illumos code. This:

https://github.com/illumos/illumos-gate/blob/master/usr/src/boot/include/unistd.h

has:

#ifndef _GID_T_DECLARED
typedef __gid_t gid_t;
#define _GID_T_DECLARED
#endif
...
#ifndef _UID_T_DECLARED
typedef __uid_t uid_t;
#define _UID_T_DECLARED
#endif

and __uid_t and gid_t are declared in:

https://github.com/illumos/illumos-gate/blob/master/usr/src/boot/sys/sys/_types.h

as:

typedef __uint32_t __gid_t;
typedef __uint32_t __uid_t;

There's another header file with definitions here:

https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/sys/types.h

effectively the same:

#ifndef _UID_T
#define _UID_T
typedef unsigned int uid_t; /* UID type /
#endif /
_UID_T */

typedef uid_t gid_t; /* GID type */

jnr-ffi fails LoadLibraryTest pp64el on ubuntu 14.

We are attempt to get jnr-ffi to work on the openPower ppc64el architecture and. After adding the TypeAlias.java file and adding PPC64EL to the Platform.java file we were able to get a clean compile and the tests starting up with out complaining it can't find the TypeAlias file.

However, when we attempt a maven test, they ALL fail. Tracing this, we found that all tests fail during the LoadLibrary section, so we isolated just this test, as all tests do this as their first step.

when we execute we see:

[tulgpu002 jnr-ffi] $ mvn -Dtest=jnr.ffi.LibraryLoaderTest test -e -X | tee test.log
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running jnr.ffi.LibraryLoaderTest
OpenJDK 64-Bit Server VM warning: You have loaded library /tmp/jffi7887071048754543889.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Tests run: 7, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.392 sec <<< FAILURE!

Results :

Tests in error:
  mapperWithFuctionMapper(jnr.ffi.LibraryLoaderTest)
  optionWithFunctionMapper(jnr.ffi.LibraryLoaderTest)
  mapMethod(jnr.ffi.LibraryLoaderTest)
  functionMappersCombine(jnr.ffi.LibraryLoaderTest)

Tests run: 7, Failures: 0, Errors: 4, Skipped: 0

Enabling -X on this we see:

[tulgpu002 jnr-ffi] $ mvn -Dtest=jnr.ffi.LibraryLoaderTest test -e -X 
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_75, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-ppc64el/jre
Default locale: en_US, platform encoding: ISO-8859-1
OS name: "linux", version: "3.16.0-30-generic", arch: "ppc64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /gpfs/DDNgpfs1/ralphbel/.m2/settings.xml
[DEBUG] Using local repository at /gpfs/DDNgpfs1/ralphbel/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /gpfs/DDNgpfs1/ralphbel/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project com.github.jnr:jnr-ffi:jar:2.0.3-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[plexus.core, parent: null]
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: com.github.jnr:jnr-ffi:jar:2.0.3-SNAPSHOT
[DEBUG] Tasks:   [test]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building jnr-ffi 2.0.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project:       com.github.jnr:jnr-ffi:2.0.3-SNAPSHOT
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): [compile, test]
[DEBUG] Repositories (dependencies): [sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots, snapshots), central (http://repo.maven.apache.org/maven2, releases)]
[DEBUG] Repositories (plugins)     : [central (http://repo.maven.apache.org/maven2, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce (enforce-maven)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <fail default-value="true">${enforcer.fail}</fail>
  <failFast default-value="false">${enforcer.failFast}</failFast>
  <ignoreCache default-value="false">${enforcer.ignoreCache}</ignoreCache>
  <project>${project}</project>
  <rules>
    <requireMavenVersion>
      <version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
      <message>Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums respectively.</message>
    </requireMavenVersion>
  </rules>
  <session>${session}</session>
  <skip default-value="false">${enforcer.skip}</skip>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-resources-plugin:2.3:resources (default-resources)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <encoding default-value="${project.build.sourceEncoding}">${encoding}</encoding>
  <escapeString>${maven.resources.escapeString}</escapeString>
  <filters>${project.build.filters}</filters>
  <includeEmptyDirs default-value="false">${maven.resources.includeEmptyDirs}</includeEmptyDirs>
  <outputDirectory>${project.build.outputDirectory}</outputDirectory>
  <overwrite default-value="false">${maven.resources.overwrite}</overwrite>
  <project>${project}</project>
  <resources>${project.resources}</resources>
  <session>${session}</session>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <basedir>${basedir}</basedir>
  <buildDirectory>${project.build.directory}</buildDirectory>
  <classpathElements>${project.compileClasspathElements}</classpathElements>
  <compileSourceRoots>${project.compileSourceRoots}</compileSourceRoots>
  <compilerId default-value="javac">${maven.compiler.compilerId}</compilerId>
  <compilerVersion>${maven.compiler.compilerVersion}</compilerVersion>
  <debug default-value="true">${maven.compiler.debug}</debug>
  <encoding>${maven.compiler.encoding}</encoding>
  <executable>${maven.compiler.executable}</executable>
  <failOnError default-value="true">${maven.compiler.failOnError}</failOnError>
  <fork default-value="false"/>
  <maxmem>${maven.compiler.maxmem}</maxmem>
  <meminitial>${maven.compiler.meminitial}</meminitial>
  <optimize default-value="false">${maven.compiler.optimize}</optimize>
  <outputDirectory>${project.build.outputDirectory}</outputDirectory>
  <outputFileName>${project.build.finalName}</outputFileName>
  <projectArtifact>${project.artifact}</projectArtifact>
  <showDeprecation default-value="false">${maven.compiler.showDeprecation}</showDeprecation>
  <showWarnings default-value="false">${maven.compiler.showWarnings}</showWarnings>
  <source>${maven.compiler.source}</source>
  <staleMillis default-value="0">${lastModGranularityMs}</staleMillis>
  <target>${maven.compiler.target}</target>
  <verbose default-value="false">${maven.compiler.verbose}</verbose>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-resources-plugin:2.3:testResources (default-testResources)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <encoding default-value="${project.build.sourceEncoding}">${encoding}</encoding>
  <escapeString>${maven.resources.escapeString}</escapeString>
  <filters>${project.build.filters}</filters>
  <includeEmptyDirs default-value="false">${maven.resources.includeEmptyDirs}</includeEmptyDirs>
  <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
  <overwrite default-value="false">${maven.resources.overwrite}</overwrite>
  <project>${project}</project>
  <resources>${project.testResources}</resources>
  <session>${session}</session>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-compiler-plugin:2.0.2:testCompile (default-testCompile)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <basedir>${basedir}</basedir>
  <buildDirectory>${project.build.directory}</buildDirectory>
  <classpathElements>${project.testClasspathElements}</classpathElements>
  <compileSourceRoots>${project.testCompileSourceRoots}</compileSourceRoots>
  <compilerId default-value="javac">${maven.compiler.compilerId}</compilerId>
  <compilerVersion>${maven.compiler.compilerVersion}</compilerVersion>
  <debug default-value="true">${maven.compiler.debug}</debug>
  <encoding>${maven.compiler.encoding}</encoding>
  <executable>${maven.compiler.executable}</executable>
  <failOnError default-value="true">${maven.compiler.failOnError}</failOnError>
  <fork default-value="false"/>
  <maxmem>${maven.compiler.maxmem}</maxmem>
  <meminitial>${maven.compiler.meminitial}</meminitial>
  <optimize default-value="false">${maven.compiler.optimize}</optimize>
  <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
  <outputFileName>${project.build.finalName}</outputFileName>
  <showDeprecation default-value="false">${maven.compiler.showDeprecation}</showDeprecation>
  <showWarnings default-value="false">${maven.compiler.showWarnings}</showWarnings>
  <skip>${maven.test.skip}</skip>
  <source>${maven.compiler.source}</source>
  <staleMillis default-value="0">${lastModGranularityMs}</staleMillis>
  <target>${maven.compiler.target}</target>
  <verbose default-value="false">${maven.compiler.verbose}</verbose>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-antrun-plugin:1.1:run (default)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <artifacts>${plugin.artifacts}</artifacts>
  <project>${project}</project>
  <sourceRoot>${sourceRoot}</sourceRoot>
  <tasks>
    <exec dir="/gpfs/DDNgpfs1/ralphbel/jnr-ffi" executable="make" failonerror="true">
      <arg line="-f libtest/GNUmakefile"/>
      <arg line="BUILD_DIR=/gpfs/DDNgpfs1/ralphbel/jnr-ffi/target"/>
      <arg line="CPU=ppc64"/>
    </exec>${tasks}</tasks>
  <testSourceRoot>${testSourceRoot}</testSourceRoot>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test (default-test)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <argLine>${argLine}</argLine>
  <basedir>${basedir}</basedir>
  <childDelegation default-value="false">${childDelegation}</childDelegation>
  <classesDirectory>${project.build.outputDirectory}</classesDirectory>
  <classpathElements>${project.testClasspathElements}</classpathElements>
  <debugForkedProcess>${maven.surefire.debug}</debugForkedProcess>
  <disableXmlReport default-value="false">${disableXmlReport}</disableXmlReport>
  <enableAssertions default-value="true">${enableAssertions}</enableAssertions>
  <excludedGroups>${excludedGroups}</excludedGroups>
  <failIfNoTests>${failIfNoTests}</failIfNoTests>
  <forkMode default-value="once">${forkMode}</forkMode>
  <forkedProcessTimeoutInSeconds>${surefire.timeout}</forkedProcessTimeoutInSeconds>
  <groups>${groups}</groups>
  <junitArtifactName default-value="junit:junit">${junitArtifactName}</junitArtifactName>
  <jvm>${jvm}</jvm>
  <localRepository>${localRepository}</localRepository>
  <parallel>${parallel}</parallel>
  <pluginArtifactMap>${plugin.artifactMap}</pluginArtifactMap>
  <printSummary default-value="true">${surefire.printSummary}</printSummary>
  <project>${project}</project>
  <projectArtifactMap>${project.artifactMap}</projectArtifactMap>
  <redirectTestOutputToFile default-value="false">${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile>
  <remoteRepositories>${project.pluginArtifactRepositories}</remoteRepositories>
  <reportFormat default-value="brief">${surefire.reportFormat}</reportFormat>
  <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
  <session>${session}</session>
  <skip>${maven.test.skip}</skip>
  <skipExec>${maven.test.skip.exec}</skipExec>
  <skipTests>${skipTests}</skipTests>
  <systemProperties>
    <property>
      <name>jnr.ffi.library.path</name>
      <value>/gpfs/DDNgpfs1/ralphbel/jnr-ffi/target</value>
    </property>
  </systemProperties>
  <test>${test}</test>
  <testClassesDirectory>${project.build.testOutputDirectory}</testClassesDirectory>
  <testFailureIgnore>${maven.test.failure.ignore}</testFailureIgnore>
  <testNGArtifactName default-value="org.testng:testng">${testNGArtifactName}</testNGArtifactName>
  <testSourceDirectory>${project.build.testSourceDirectory}</testSourceDirectory>
  <threadCount>${threadCount}</threadCount>
  <trimStackTrace default-value="true">${trimStackTrace}</trimStackTrace>
  <useFile default-value="true">${surefire.useFile}</useFile>
  <useSystemClassLoader>${surefire.useSystemClassLoader}</useSystemClassLoader>
  <workingDirectory>${basedir}</workingDirectory>
</configuration>
[DEBUG] =======================================================================
[DEBUG] com.github.jnr:jnr-ffi:jar:2.0.3-SNAPSHOT
[DEBUG]    junit:junit:jar:4.11:test
[DEBUG]       org.hamcrest:hamcrest-core:jar:1.3:test
[DEBUG]    com.github.jnr:jffi:jar:1.2.8:compile
[DEBUG]    com.github.jnr:jffi:jar:native:1.2.8:runtime
[DEBUG]    org.ow2.asm:asm:jar:5.0.3:compile
[DEBUG]    org.ow2.asm:asm-commons:jar:5.0.3:compile
[DEBUG]    org.ow2.asm:asm-analysis:jar:5.0.3:compile
[DEBUG]    org.ow2.asm:asm-tree:jar:5.0.3:compile
[DEBUG]    org.ow2.asm:asm-util:jar:5.0.3:compile
[DEBUG]    com.github.jnr:jnr-x86asm:jar:1.0.2:compile
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ jnr-ffi ---
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG]   Imported: org.sonatype.aether.transfer < plexus.core
[DEBUG]   Imported: org.apache.maven.exception < plexus.core
[DEBUG]   Imported: org.sonatype.aether.metadata < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG]   Imported: org.sonatype.aether.collection < plexus.core
[DEBUG]   Imported: org.sonatype.aether.version < plexus.core
[DEBUG]   Imported: org.apache.maven.monitor < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG]   Imported: org.apache.maven.profiles < plexus.core
[DEBUG]   Imported: org.sonatype.aether.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
[DEBUG]   Imported: org.apache.maven.execution < plexus.core
[DEBUG]   Imported: org.sonatype.aether.artifact < plexus.core
[DEBUG]   Imported: org.sonatype.aether.spi < plexus.core
[DEBUG]   Imported: org.apache.maven.reporting < plexus.core
[DEBUG]   Imported: org.apache.maven.usability < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG]   Imported: org.sonatype.aether.graph < plexus.core
[DEBUG]   Imported: org.sonatype.aether.* < plexus.core
[DEBUG]   Imported: org.apache.maven.settings < plexus.core
[DEBUG]   Imported: org.codehaus.classworlds < plexus.core
[DEBUG]   Imported: org.sonatype.aether.impl < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
[DEBUG]   Imported: org.sonatype.aether.deployment < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG]   Imported: org.apache.maven.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.cli < plexus.core
[DEBUG]   Imported: org.sonatype.aether.installation < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG]   Imported: org.apache.maven.project < plexus.core
[DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.artifact < plexus.core
[DEBUG]   Imported: org.apache.maven.model < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG]   Imported: org.sonatype.aether.resolution < plexus.core
[DEBUG]   Imported: org.apache.maven.plugin < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG] Populating class realm maven.api
[DEBUG] org.apache.maven.plugins:maven-enforcer-plugin:jar:1.0:
[DEBUG]    org.apache.maven:maven-artifact:jar:2.0.9:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.9:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-settings:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-model:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.0.9:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG]          junit:junit:jar:3.8.2:test (scope managed from compile) (version managed from 3.8.1)
[DEBUG]    org.apache.maven:maven-core:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9:compile
[DEBUG]       org.apache.maven.reporting:maven-reporting-api:jar:2.0.9:compile
[DEBUG]          org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-10:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-error-diagnostics:jar:2.0.9:compile
[DEBUG]       commons-cli:commons-cli:jar:1.0:compile
[DEBUG]       org.apache.maven:maven-plugin-descriptor:jar:2.0.9:compile
[DEBUG]       org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile
[DEBUG]       org.apache.maven:maven-monitor:jar:2.0.9:compile
[DEBUG]       classworlds:classworlds:jar:1.1:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.5.8:compile
[DEBUG]    commons-lang:commons-lang:jar:2.3:compile
[DEBUG]    org.apache.maven.enforcer:enforcer-api:jar:1.0:compile
[DEBUG]    org.apache.maven.enforcer:enforcer-rules:jar:1.0:compile
[DEBUG]       org.apache.maven.shared:maven-common-artifact-filters:jar:1.2:compile
[DEBUG]          org.apache.maven.shared:maven-plugin-testing-harness:jar:1.1:test (scope managed from compile)
[DEBUG]             org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-7:test
[DEBUG]       org.beanshell:bsh:jar:2.0b4:compile
[DEBUG]       org.apache.maven.shared:maven-dependency-tree:jar:1.2:compile
[DEBUG]       org.codehaus.plexus:plexus-i18n:jar:1.0-beta-6:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.0
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.0
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.0
[DEBUG]   Included: org.apache.maven.plugins:maven-enforcer-plugin:jar:1.0
[DEBUG]   Included: org.apache.maven.reporting:maven-reporting-api:jar:2.0.9
[DEBUG]   Included: org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-10
[DEBUG]   Included: commons-cli:commons-cli:jar:1.0
[DEBUG]   Included: org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.5.8
[DEBUG]   Included: commons-lang:commons-lang:jar:2.3
[DEBUG]   Included: org.apache.maven.enforcer:enforcer-api:jar:1.0
[DEBUG]   Included: org.apache.maven.enforcer:enforcer-rules:jar:1.0
[DEBUG]   Included: org.apache.maven.shared:maven-common-artifact-filters:jar:1.2
[DEBUG]   Included: org.beanshell:bsh:jar:2.0b4
[DEBUG]   Included: org.apache.maven.shared:maven-dependency-tree:jar:1.2
[DEBUG]   Included: org.codehaus.plexus:plexus-i18n:jar:1.0-beta-6
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.9
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[DEBUG]   Excluded: junit:junit:jar:3.8.2
[DEBUG]   Excluded: org.apache.maven:maven-core:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-error-diagnostics:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-monitor:jar:2.0.9
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1
[DEBUG]   Excluded: org.apache.maven.shared:maven-plugin-testing-harness:jar:1.1
[DEBUG]   Excluded: org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-7
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.0, parent: sun.misc.Launcher$AppClassLoader@a574b2]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce' with basic configurator -->
[DEBUG]   (s) fail = true
[DEBUG]   (s) failFast = false
[DEBUG]   (f) ignoreCache = false
[DEBUG]   (s) project = MavenProject: com.github.jnr:jnr-ffi:2.0.3-SNAPSHOT @ /gpfs/DDNgpfs1/ralphbel/jnr-ffi/pom.xml
[DEBUG]   (s) version = (,2.1.0),(2.1.0,2.2.0),(2.2.0,)
[DEBUG]   (f) message = Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums respectively.
[DEBUG]   (s) rules = [org.apache.maven.plugins.enforcer.RequireMavenVersion@659174b2]
[DEBUG]   (s) session = org.apache.maven.execution.MavenSession@4c875c1c
[DEBUG]   (s) skip = false
[DEBUG] -- end configuration --
[DEBUG] Executing rule: org.apache.maven.plugins.enforcer.RequireMavenVersion
[DEBUG] Rule org.apache.maven.plugins.enforcer.RequireMavenVersion is cacheable.
[DEBUG] Detected Maven Version: 3.0.5
[DEBUG] Detected Maven Version: 3.0.5 is allowed in the range (,2.1.0),(2.1.0,2.2.0),(2.2.0,).
[INFO] 
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ jnr-ffi ---
[DEBUG] org.apache.maven.plugins:maven-resources-plugin:jar:2.3:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.6:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-settings:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-model:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
[DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:2.0.6:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG]          junit:junit:jar:3.8.1:compile
[DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.5.6:compile
[DEBUG]    org.apache.maven.shared:maven-filtering:jar:1.0-beta-2:compile
[DEBUG]       org.apache.maven:maven-core:jar:2.0.6:compile
[DEBUG]          org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.6:compile
[DEBUG]          org.apache.maven.reporting:maven-reporting-api:jar:2.0.6:compile
[DEBUG]             org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7:compile
[DEBUG]          org.apache.maven:maven-error-diagnostics:jar:2.0.6:compile
[DEBUG]          commons-cli:commons-cli:jar:1.0:compile
[DEBUG]          org.apache.maven:maven-plugin-descriptor:jar:2.0.6:compile
[DEBUG]          org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile
[DEBUG]       org.apache.maven:maven-monitor:jar:2.0.6:compile
[DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.6:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-resources-plugin:2.3
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-resources-plugin:2.3
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-resources-plugin:2.3
[DEBUG]   Included: org.apache.maven.plugins:maven-resources-plugin:jar:2.3
[DEBUG]   Included: junit:junit:jar:3.8.1
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.5.6
[DEBUG]   Included: org.apache.maven.shared:maven-filtering:jar:1.0-beta-2
[DEBUG]   Included: org.apache.maven.reporting:maven-reporting-api:jar:2.0.6
[DEBUG]   Included: org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7
[DEBUG]   Included: commons-cli:commons-cli:jar:1.0
[DEBUG]   Included: org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.6
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.6
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
[DEBUG]   Excluded: org.apache.maven:maven-core:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-error-diagnostics:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-monitor:jar:2.0.6
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-resources-plugin:2.3:resources from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-resources-plugin:2.3, parent: sun.misc.Launcher$AppClassLoader@a574b2]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-resources-plugin:2.3:resources' with basic configurator -->
[DEBUG]   (f) encoding = UTF-8
[DEBUG]   (f) filters = []
[DEBUG]   (s) includeEmptyDirs = false
[DEBUG]   (s) outputDirectory = /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/classes
[DEBUG]   (s) overwrite = false
[DEBUG]   (f) project = MavenProject: com.github.jnr:jnr-ffi:2.0.3-SNAPSHOT @ /gpfs/DDNgpfs1/ralphbel/jnr-ffi/pom.xml
[DEBUG]   (s) resources = [Resource {targetPath: null, filtering: false, FileSet {directory: /gpfs/DDNgpfs1/ralphbel/jnr-ffi/src/main/resources, PatternSet [includes: {}, excludes: {}]}}]
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@4c875c1c
[DEBUG] -- end configuration --
[DEBUG] properties used {java.vendor=Oracle Corporation, env.LESSOPEN=| /usr/bin/lesspipe %s, sun.java.launcher=SUN_STANDARD, sun.management.compiler=HotSpot 64-Bit Server Compiler, env.LSF_BINDIR=/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/bin, os.name=Linux, sun.boot.class.path=/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/resources.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/rt.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/jsse.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/jce.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/charsets.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/rhino.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/jfr.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/classes, env.PWD=/gpfs/DDNgpfs1/ralphbel/jnr-ffi, env.LANG=en_US, java.vm.specification.vendor=Oracle Corporation, java.runtime.version=1.7.0_75-b13, project.build.sourceEncoding=UTF-8, user.name=ralphbel, maven.build.version=Apache Maven 3.0.5, env.USER=ralphbel, env.SHELL=/bin/bash, env.LSF_LIBDIR=/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/lib, env.SSH_TTY=/dev/pts/2, env.PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games, user.language=en, sun.boot.library.path=/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/ppc64, classworlds.conf=/usr/share/maven/bin/m2.conf, env.SSH_CONNECTION=10.0.0.2 32818 10.0.0.7 22, java.version=1.7.0_75, env.SSH_CLIENT=10.0.0.2 32818 22, user.timezone=, sun.arch.data.model=64, java.endorsed.dirs=/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/endorsed, sun.cpu.isalist=, sun.jnu.encoding=ISO-8859-1, file.encoding.pkg=sun.io, env.SHLVL=2, file.separator=/, java.specification.name=Java Platform API Specification, java.class.version=51.0, user.country=US, java.home=/usr/lib/jvm/java-7-openjdk-ppc64el/jre, java.vm.info=mixed mode, env.LOGNAME=ralphbel, os.version=3.16.0-30-generic, maven.compiler.target=1.6, path.separator=:, java.vm.version=24.75-b04, env.LANGUAGE=en_US:, env.JAVA_HOME=/usr/lib/jvm/java-7-openjdk-ppc64el, java.awt.printerjob=sun.print.PSPrinterJob, env.TERM=xterm, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.X11.XToolkit, env.MANPATH=/shared/lsf/9.1/man:, user.home=/gpfs/DDNgpfs1/ralphbel, env.OLDPWD=/gpfs/DDNgpfs1/ralphbel/jnr-ffi, java.specification.vendor=Oracle Corporation, test=jnr.ffi.LibraryLoaderTest, java.library.path=/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/lib:/usr/local/cuda/lib64:/usr/java/packages/lib/ppc64:/usr/lib/powerpc64le-linux-gnu/jni:/lib/powerpc64le-linux-gnu:/usr/lib/powerpc64le-linux-gnu:/usr/lib/jni:/lib:/usr/lib, java.vendor.url=http://java.oracle.com/, java.vm.vendor=Oracle Corporation, maven.home=/usr/share/maven, java.runtime.name=OpenJDK Runtime Environment, sun.java.command=org.codehaus.plexus.classworlds.launcher.Launcher -Dtest=jnr.ffi.LibraryLoaderTest test -e -X, java.class.path=/usr/share/maven/boot/plexus-classworlds-2.x.jar, sonatypeOssDistMgmtSnapshotsUrl=https://oss.sonatype.org/content/repositories/snapshots/, env.XDG_SESSION_ID=584, env.LSF_ENVDIR=/shared/lsf/conf, maven.version=3.0.5, java.vm.specification.name=Java Virtual Machine Specification, github.global.server=github, java.vm.specification.version=1.7, sun.os.patch.level=unknown, sun.cpu.endian=little, env.HOME=/gpfs/DDNgpfs1/ralphbel, env.LD_LIBRARY_PATH=/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/lib:/usr/local/cuda/lib64, java.io.tmpdir=/tmp, env.LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:, java.vendor.url.bug=http://bugreport.sun.com/bugreport/, env.LSF_SERVERDIR=/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/etc, maven.compiler.source=1.6, java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment, os.arch=ppc64, env.XDG_RUNTIME_DIR=/run/user/0, java.ext.dirs=/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/ext:/usr/java/packages/lib/ext, user.dir=/gpfs/DDNgpfs1/ralphbel/jnr-ffi, line.separator=
, java.vm.name=OpenJDK 64-Bit Server VM, env.BINARY_TYPE_HPC=, file.encoding=ISO-8859-1, env.MAIL=/var/mail/ralphbel, asm.version=5.0.3, java.specification.version=1.7, env.LESSCLOSE=/usr/bin/lesspipe %s %s}
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[DEBUG] resource with targetPath null
directory /gpfs/DDNgpfs1/ralphbel/jnr-ffi/src/main/resources
excludes []
includes []
[INFO] skip non existing resourceDirectory /gpfs/DDNgpfs1/ralphbel/jnr-ffi/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ jnr-ffi ---
[DEBUG] org.apache.maven.plugins:maven-compiler-plugin:jar:2.0.2:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.0.4:compile
[DEBUG]    org.codehaus.plexus:plexus-compiler-api:jar:1.5.3:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:compile
[DEBUG]          junit:junit:jar:3.8.1:compile
[DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG]    org.codehaus.plexus:plexus-compiler-manager:jar:1.5.3:compile
[DEBUG]    org.codehaus.plexus:plexus-compiler-javac:jar:1.5.3:runtime
[DEBUG]    org.apache.maven:maven-artifact:jar:2.0:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-compiler-plugin:2.0.2
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-compiler-plugin:2.0.2
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-compiler-plugin:2.0.2
[DEBUG]   Included: org.apache.maven.plugins:maven-compiler-plugin:jar:2.0.2
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG]   Included: org.codehaus.plexus:plexus-compiler-api:jar:1.5.3
[DEBUG]   Included: junit:junit:jar:3.8.1
[DEBUG]   Included: org.codehaus.plexus:plexus-compiler-manager:jar:1.5.3
[DEBUG]   Included: org.codehaus.plexus:plexus-compiler-javac:jar:1.5.3
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-compiler-plugin:2.0.2, parent: sun.misc.Launcher$AppClassLoader@a574b2]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile' with basic configurator -->
[DEBUG]   (f) basedir = /gpfs/DDNgpfs1/ralphbel/jnr-ffi
[DEBUG]   (f) buildDirectory = /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target
[DEBUG]   (f) classpathElements = [/gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/classes, /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jffi/1.2.8/jffi-1.2.8.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-util/5.0.3/asm-util-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar]
[DEBUG]   (f) compileSourceRoots = [/gpfs/DDNgpfs1/ralphbel/jnr-ffi/src/main/java]
[DEBUG]   (f) compilerId = javac
[DEBUG]   (f) debug = true
[DEBUG]   (f) failOnError = true
[DEBUG]   (f) fork = false
[DEBUG]   (f) optimize = false
[DEBUG]   (f) outputDirectory = /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/classes
[DEBUG]   (f) outputFileName = jnr-ffi-2.0.3-SNAPSHOT
[DEBUG]   (f) projectArtifact = com.github.jnr:jnr-ffi:jar:2.0.3-SNAPSHOT
[DEBUG]   (f) showDeprecation = false
[DEBUG]   (f) showWarnings = false
[DEBUG]   (f) source = 1.6
[DEBUG]   (f) staleMillis = 0
[DEBUG]   (f) target = 1.6
[DEBUG]   (f) verbose = false
[DEBUG] -- end configuration --
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [/gpfs/DDNgpfs1/ralphbel/jnr-ffi/src/main/java]
[DEBUG] Classpath: [/gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/classes
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jffi/1.2.8/jffi-1.2.8.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-util/5.0.3/asm-util-5.0.3.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar]
[DEBUG] Output directory: /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/classes
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ jnr-ffi ---
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-resources-plugin:2.3:testResources from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-resources-plugin:2.3, parent: sun.misc.Launcher$AppClassLoader@a574b2]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-resources-plugin:2.3:testResources' with basic configurator -->
[DEBUG]   (f) encoding = UTF-8
[DEBUG]   (f) filters = []
[DEBUG]   (s) includeEmptyDirs = false
[DEBUG]   (s) outputDirectory = /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/test-classes
[DEBUG]   (s) overwrite = false
[DEBUG]   (f) project = MavenProject: com.github.jnr:jnr-ffi:2.0.3-SNAPSHOT @ /gpfs/DDNgpfs1/ralphbel/jnr-ffi/pom.xml
[DEBUG]   (s) resources = [Resource {targetPath: null, filtering: false, FileSet {directory: /gpfs/DDNgpfs1/ralphbel/jnr-ffi/src/test/resources, PatternSet [includes: {}, excludes: {}]}}]
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@4c875c1c
[DEBUG] -- end configuration --
[DEBUG] properties used {java.vendor=Oracle Corporation, env.LESSOPEN=| /usr/bin/lesspipe %s, sun.java.launcher=SUN_STANDARD, sun.management.compiler=HotSpot 64-Bit Server Compiler, env.LSF_BINDIR=/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/bin, os.name=Linux, sun.boot.class.path=/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/resources.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/rt.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/jsse.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/jce.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/charsets.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/rhino.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/jfr.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/classes, env.PWD=/gpfs/DDNgpfs1/ralphbel/jnr-ffi, env.LANG=en_US, java.vm.specification.vendor=Oracle Corporation, java.runtime.version=1.7.0_75-b13, project.build.sourceEncoding=UTF-8, user.name=ralphbel, maven.build.version=Apache Maven 3.0.5, env.USER=ralphbel, env.SHELL=/bin/bash, env.LSF_LIBDIR=/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/lib, env.SSH_TTY=/dev/pts/2, env.PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games, user.language=en, sun.boot.library.path=/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/ppc64, classworlds.conf=/usr/share/maven/bin/m2.conf, env.SSH_CONNECTION=10.0.0.2 32818 10.0.0.7 22, java.version=1.7.0_75, env.SSH_CLIENT=10.0.0.2 32818 22, user.timezone=, sun.arch.data.model=64, java.endorsed.dirs=/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/endorsed, sun.cpu.isalist=, sun.jnu.encoding=ISO-8859-1, file.encoding.pkg=sun.io, env.SHLVL=2, file.separator=/, java.specification.name=Java Platform API Specification, java.class.version=51.0, user.country=US, java.home=/usr/lib/jvm/java-7-openjdk-ppc64el/jre, java.vm.info=mixed mode, env.LOGNAME=ralphbel, os.version=3.16.0-30-generic, maven.compiler.target=1.6, path.separator=:, java.vm.version=24.75-b04, env.LANGUAGE=en_US:, env.JAVA_HOME=/usr/lib/jvm/java-7-openjdk-ppc64el, java.awt.printerjob=sun.print.PSPrinterJob, env.TERM=xterm, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.X11.XToolkit, env.MANPATH=/shared/lsf/9.1/man:, user.home=/gpfs/DDNgpfs1/ralphbel, env.OLDPWD=/gpfs/DDNgpfs1/ralphbel/jnr-ffi, java.specification.vendor=Oracle Corporation, test=jnr.ffi.LibraryLoaderTest, java.library.path=/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/lib:/usr/local/cuda/lib64:/usr/java/packages/lib/ppc64:/usr/lib/powerpc64le-linux-gnu/jni:/lib/powerpc64le-linux-gnu:/usr/lib/powerpc64le-linux-gnu:/usr/lib/jni:/lib:/usr/lib, java.vendor.url=http://java.oracle.com/, java.vm.vendor=Oracle Corporation, maven.home=/usr/share/maven, java.runtime.name=OpenJDK Runtime Environment, sun.java.command=org.codehaus.plexus.classworlds.launcher.Launcher -Dtest=jnr.ffi.LibraryLoaderTest test -e -X, java.class.path=/usr/share/maven/boot/plexus-classworlds-2.x.jar, sonatypeOssDistMgmtSnapshotsUrl=https://oss.sonatype.org/content/repositories/snapshots/, env.XDG_SESSION_ID=584, env.LSF_ENVDIR=/shared/lsf/conf, maven.version=3.0.5, java.vm.specification.name=Java Virtual Machine Specification, github.global.server=github, java.vm.specification.version=1.7, sun.os.patch.level=unknown, sun.cpu.endian=little, env.HOME=/gpfs/DDNgpfs1/ralphbel, env.LD_LIBRARY_PATH=/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/lib:/usr/local/cuda/lib64, java.io.tmpdir=/tmp, env.LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:, java.vendor.url.bug=http://bugreport.sun.com/bugreport/, env.LSF_SERVERDIR=/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/etc, maven.compiler.source=1.6, java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment, os.arch=ppc64, env.XDG_RUNTIME_DIR=/run/user/0, java.ext.dirs=/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/ext:/usr/java/packages/lib/ext, user.dir=/gpfs/DDNgpfs1/ralphbel/jnr-ffi, line.separator=
, java.vm.name=OpenJDK 64-Bit Server VM, env.BINARY_TYPE_HPC=, file.encoding=ISO-8859-1, env.MAIL=/var/mail/ralphbel, asm.version=5.0.3, java.specification.version=1.7, env.LESSCLOSE=/usr/bin/lesspipe %s %s}
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[DEBUG] resource with targetPath null
directory /gpfs/DDNgpfs1/ralphbel/jnr-ffi/src/test/resources
excludes []
includes []
[INFO] skip non existing resourceDirectory /gpfs/DDNgpfs1/ralphbel/jnr-ffi/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ jnr-ffi ---
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-compiler-plugin:2.0.2:testCompile from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-compiler-plugin:2.0.2, parent: sun.misc.Launcher$AppClassLoader@a574b2]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-compiler-plugin:2.0.2:testCompile' with basic configurator -->
[DEBUG]   (f) basedir = /gpfs/DDNgpfs1/ralphbel/jnr-ffi
[DEBUG]   (f) buildDirectory = /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target
[DEBUG]   (f) classpathElements = [/gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/test-classes, /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/classes, /gpfs/DDNgpfs1/ralphbel/.m2/repository/junit/junit/4.11/junit-4.11.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jffi/1.2.8/jffi-1.2.8.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jffi/1.2.8/jffi-1.2.8-native.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-util/5.0.3/asm-util-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar]
[DEBUG]   (f) compileSourceRoots = [/gpfs/DDNgpfs1/ralphbel/jnr-ffi/src/test/java]
[DEBUG]   (f) compilerId = javac
[DEBUG]   (f) debug = true
[DEBUG]   (f) failOnError = true
[DEBUG]   (f) fork = false
[DEBUG]   (f) optimize = false
[DEBUG]   (f) outputDirectory = /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/test-classes
[DEBUG]   (f) outputFileName = jnr-ffi-2.0.3-SNAPSHOT
[DEBUG]   (f) showDeprecation = false
[DEBUG]   (f) showWarnings = false
[DEBUG]   (f) source = 1.6
[DEBUG]   (f) staleMillis = 0
[DEBUG]   (f) target = 1.6
[DEBUG]   (f) verbose = false
[DEBUG] -- end configuration --
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [/gpfs/DDNgpfs1/ralphbel/jnr-ffi/src/test/java]
[DEBUG] Classpath: [/gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/test-classes
 /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/classes
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/junit/junit/4.11/junit-4.11.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jffi/1.2.8/jffi-1.2.8.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jffi/1.2.8/jffi-1.2.8-native.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-util/5.0.3/asm-util-5.0.3.jar
 /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar]
[DEBUG] Output directory: /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/test-classes
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-antrun-plugin:1.1:run (default) @ jnr-ffi ---
[DEBUG] org.apache.maven.plugins:maven-antrun-plugin:jar:1.1:
[DEBUG]    org.apache.maven:maven-project:jar:2.0.1:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.0.1:compile
[DEBUG]       org.apache.maven:maven-model:jar:2.0.1:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.0.1:compile
[DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.0.1:compile
[DEBUG]       org.codehaus.plexus:plexus-utils:jar:1.0.5:compile
[DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:2.0.1:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:compile (version managed from 1.0-alpha-9)
[DEBUG]          junit:junit:jar:3.8.1:compile
[DEBUG]    ant:ant-launcher:jar:1.6.5:runtime
[DEBUG]    ant:ant:jar:1.6.5:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.1:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-antrun-plugin:1.1
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-antrun-plugin:1.1
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-antrun-plugin:1.1
[DEBUG]   Included: org.apache.maven.plugins:maven-antrun-plugin:jar:1.1
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.0.5
[DEBUG]   Included: junit:junit:jar:3.8.1
[DEBUG]   Included: ant:ant-launcher:jar:1.6.5
[DEBUG]   Included: ant:ant:jar:1.6.5
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.1
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.1
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.1
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.1
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.1
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.1
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.1
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-antrun-plugin:1.1:run from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-antrun-plugin:1.1, parent: sun.misc.Launcher$AppClassLoader@a574b2]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-antrun-plugin:1.1:run' with override configurator -->
[DEBUG]   (f) artifacts = [org.apache.maven.plugins:maven-antrun-plugin:maven-plugin:1.1:, org.codehaus.plexus:plexus-utils:jar:1.0.5:compile, junit:junit:jar:3.8.1:compile, ant:ant-launcher:jar:1.6.5:runtime, ant:ant:jar:1.6.5:compile]
[DEBUG]   (f) project = MavenProject: com.github.jnr:jnr-ffi:2.0.3-SNAPSHOT @ /gpfs/DDNgpfs1/ralphbel/jnr-ffi/pom.xml
[DEBUG]   (f) tasks = 
[DEBUG] -- end configuration --
[INFO] Executing tasks
[DEBUG] getProperty(ns=null, name=ant.reuse.loader, user=false)
     [exec] make: Nothing to be done for 'all'.
[INFO] Executed tasks
[INFO] 
[INFO] --- maven-surefire-plugin:2.4.2:test (default-test) @ jnr-ffi ---
[DEBUG] org.apache.maven.plugins:maven-surefire-plugin:jar:2.4.2:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0:compile
[DEBUG]    org.apache.maven.surefire:surefire-booter:jar:2.4.2:compile
[DEBUG]       org.apache.maven.surefire:surefire-api:jar:2.4.2:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.4.9:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:2.0:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-model:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.0:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:compile
[DEBUG]          junit:junit:jar:3.8.1:compile
[DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG]    org.apache.maven:maven-core:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-settings:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-plugin-parameter-documenter:jar:2.0:compile
[DEBUG]       org.apache.maven.reporting:maven-reporting-api:jar:2.0:compile
[DEBUG]          doxia:doxia-sink-api:jar:1.0-alpha-4:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-error-diagnostics:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.0:compile
[DEBUG]       commons-cli:commons-cli:jar:1.0:compile
[DEBUG]       org.apache.maven:maven-plugin-descriptor:jar:2.0:compile
[DEBUG]       org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile
[DEBUG]       org.apache.maven:maven-monitor:jar:2.0:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-surefire-plugin:2.4.2
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-surefire-plugin:2.4.2
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-surefire-plugin:2.4.2
[DEBUG]   Included: org.apache.maven.plugins:maven-surefire-plugin:jar:2.4.2
[DEBUG]   Included: org.apache.maven.surefire:surefire-booter:jar:2.4.2
[DEBUG]   Included: org.apache.maven.surefire:surefire-api:jar:2.4.2
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.4.9
[DEBUG]   Included: junit:junit:jar:3.8.1
[DEBUG]   Included: org.apache.maven.reporting:maven-reporting-api:jar:2.0
[DEBUG]   Included: doxia:doxia-sink-api:jar:1.0-alpha-4
[DEBUG]   Included: commons-cli:commons-cli:jar:1.0
[DEBUG]   Included: org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
[DEBUG]   Excluded: org.apache.maven:maven-core:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-plugin-parameter-documenter:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-error-diagnostics:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-monitor:jar:2.0
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-surefire-plugin:2.4.2, parent: sun.misc.Launcher$AppClassLoader@a574b2]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test' with basic configurator -->
[DEBUG]   (f) basedir = /gpfs/DDNgpfs1/ralphbel/jnr-ffi
[DEBUG]   (f) childDelegation = false
[DEBUG]   (f) classesDirectory = /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/classes
[DEBUG]   (f) classpathElements = [/gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/test-classes, /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/classes, /gpfs/DDNgpfs1/ralphbel/.m2/repository/junit/junit/4.11/junit-4.11.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jffi/1.2.8/jffi-1.2.8.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jffi/1.2.8/jffi-1.2.8-native.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-util/5.0.3/asm-util-5.0.3.jar, /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar]
[DEBUG]   (f) disableXmlReport = false
[DEBUG]   (f) enableAssertions = true
[DEBUG]   (f) forkMode = once
[DEBUG]   (f) junitArtifactName = junit:junit
[DEBUG]   (f) localRepository =        id: local
      url: file:///gpfs/DDNgpfs1/ralphbel/.m2/repository/
   layout: none

[DEBUG]   (f) pluginArtifactMap = {org.apache.maven.plugins:maven-surefire-plugin=org.apache.maven.plugins:maven-surefire-plugin:maven-plugin:2.4.2:, org.apache.maven.surefire:surefire-booter=org.apache.maven.surefire:surefire-booter:jar:2.4.2:compile, org.apache.maven.surefire:surefire-api=org.apache.maven.surefire:surefire-api:jar:2.4.2:compile, org.codehaus.plexus:plexus-utils=org.codehaus.plexus:plexus-utils:jar:1.4.9:compile, junit:junit=junit:junit:jar:3.8.1:compile, org.apache.maven.reporting:maven-reporting-api=org.apache.maven.reporting:maven-reporting-api:jar:2.0:compile, doxia:doxia-sink-api=doxia:doxia-sink-api:jar:1.0-alpha-4:compile, commons-cli:commons-cli=commons-cli:commons-cli:jar:1.0:compile, org.codehaus.plexus:plexus-interactivity-api=org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile}
[DEBUG]   (f) printSummary = true
[DEBUG]   (f) project = MavenProject: com.github.jnr:jnr-ffi:2.0.3-SNAPSHOT @ /gpfs/DDNgpfs1/ralphbel/jnr-ffi/pom.xml
[DEBUG]   (f) projectArtifactMap = {junit:junit=junit:junit:jar:4.11:test, org.hamcrest:hamcrest-core=org.hamcrest:hamcrest-core:jar:1.3:test, com.github.jnr:jffi=com.github.jnr:jffi:jar:native:1.2.8:runtime, org.ow2.asm:asm=org.ow2.asm:asm:jar:5.0.3:compile, org.ow2.asm:asm-commons=org.ow2.asm:asm-commons:jar:5.0.3:compile, org.ow2.asm:asm-analysis=org.ow2.asm:asm-analysis:jar:5.0.3:compile, org.ow2.asm:asm-tree=org.ow2.asm:asm-tree:jar:5.0.3:compile, org.ow2.asm:asm-util=org.ow2.asm:asm-util:jar:5.0.3:compile, com.github.jnr:jnr-x86asm=com.github.jnr:jnr-x86asm:jar:1.0.2:compile}
[DEBUG]   (f) redirectTestOutputToFile = false
[DEBUG]   (f) remoteRepositories = [       id: central
      url: http://repo.maven.apache.org/maven2
   layout: default
snapshots: [enabled => false, update => daily]
 releases: [enabled => true, update => never]
]
[DEBUG]   (f) reportFormat = brief
[DEBUG]   (f) reportsDirectory = /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/surefire-reports
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@4c875c1c
[DEBUG]   (f) systemProperties = {jnr.ffi.library.path=/gpfs/DDNgpfs1/ralphbel/jnr-ffi/target}
[DEBUG]   (f) test = jnr.ffi.LibraryLoaderTest
[DEBUG]   (f) testClassesDirectory = /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/test-classes
[DEBUG]   (f) testNGArtifactName = org.testng:testng
[DEBUG]   (f) testSourceDirectory = /gpfs/DDNgpfs1/ralphbel/jnr-ffi/src/test/java
[DEBUG]   (f) trimStackTrace = true
[DEBUG]   (f) useFile = true
[DEBUG]   (f) workingDirectory = /gpfs/DDNgpfs1/ralphbel/jnr-ffi
[DEBUG] -- end configuration --
[DEBUG] dummy:dummy:jar:1.0 (selected for null)
[DEBUG]   org.apache.maven.surefire:surefire-booter:jar:2.4.2:compile (selected for compile)
[DEBUG]     org.apache.maven.surefire:surefire-api:jar:2.4.2:compile (selected for compile)
[DEBUG] Adding to surefire booter test classpath: /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/apache/maven/surefire/surefire-booter/2.4.2/surefire-booter-2.4.2.jar
[DEBUG] Adding to surefire booter test classpath: /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/apache/maven/surefire/surefire-api/2.4.2/surefire-api-2.4.2.jar
[DEBUG] dummy:dummy:jar:1.0 (selected for null)
[DEBUG]   org.apache.maven.surefire:surefire-junit4:jar:2.4.2:test (selected for test)
[DEBUG]     junit:junit:jar:4.0:test (selected for test)
[DEBUG]     org.apache.maven.surefire:surefire-api:jar:2.4.2:test (selected for test)
[DEBUG] Adding to surefire test classpath: /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/apache/maven/surefire/surefire-junit4/2.4.2/surefire-junit4-2.4.2.jar
[DEBUG] Adding to surefire test classpath: /gpfs/DDNgpfs1/ralphbel/.m2/repository/junit/junit/4.0/junit-4.0.jar
[DEBUG] Adding to surefire test classpath: /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/apache/maven/surefire/surefire-api/2.4.2/surefire-api-2.4.2.jar
[DEBUG] Test Classpath :
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/test-classes
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/classes
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/.m2/repository/junit/junit/4.11/junit-4.11.jar
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jffi/1.2.8/jffi-1.2.8.jar
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jffi/1.2.8/jffi-1.2.8-native.jar
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/.m2/repository/org/ow2/asm/asm-util/5.0.3/asm-util-5.0.3.jar
[DEBUG]   /gpfs/DDNgpfs1/ralphbel/.m2/repository/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar
[DEBUG] Setting system property [java.vendor]=[Oracle Corporation]
[DEBUG] Setting system property [env.LESSOPEN]=[| /usr/bin/lesspipe %s]
[DEBUG] Setting system property [localRepository]=[/gpfs/DDNgpfs1/ralphbel/.m2/repository]
[DEBUG] Setting system property [sun.java.launcher]=[SUN_STANDARD]
[DEBUG] Setting system property [sun.management.compiler]=[HotSpot 64-Bit Server Compiler]
[DEBUG] Setting system property [env.LSF_BINDIR]=[/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/bin]
[DEBUG] Setting system property [os.name]=[Linux]
[DEBUG] Setting system property [sun.boot.class.path]=[/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/resources.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/rt.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/jsse.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/jce.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/charsets.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/rhino.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/jfr.jar:/usr/lib/jvm/java-7-openjdk-ppc64el/jre/classes]
[DEBUG] Setting system property [env.PWD]=[/gpfs/DDNgpfs1/ralphbel/jnr-ffi]
[DEBUG] Setting system property [env.LANG]=[en_US]
[DEBUG] Setting system property [java.vm.specification.vendor]=[Oracle Corporation]
[DEBUG] Setting system property [java.runtime.version]=[1.7.0_75-b13]
[DEBUG] Setting system property [user.name]=[ralphbel]
[DEBUG] Setting system property [maven.build.version]=[Apache Maven 3.0.5]
[DEBUG] Setting system property [env.USER]=[ralphbel]
[DEBUG] Setting system property [env.SHELL]=[/bin/bash]
[DEBUG] Setting system property [env.LSF_LIBDIR]=[/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/lib]
[DEBUG] Setting system property [env.SSH_TTY]=[/dev/pts/2]
[DEBUG] Setting system property [env.PATH]=[/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games]
[DEBUG] Setting system property [user.language]=[en]
[DEBUG] Setting system property [sun.boot.library.path]=[/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/ppc64]
[DEBUG] Setting system property [classworlds.conf]=[/usr/share/maven/bin/m2.conf]
[DEBUG] Setting system property [env.SSH_CONNECTION]=[10.0.0.2 32818 10.0.0.7 22]
[DEBUG] Setting system property [java.version]=[1.7.0_75]
[DEBUG] Setting system property [env.SSH_CLIENT]=[10.0.0.2 32818 22]
[DEBUG] Setting system property [user.timezone]=[]
[DEBUG] Setting system property [sun.arch.data.model]=[64]
[DEBUG] Setting system property [java.endorsed.dirs]=[/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/endorsed]
[DEBUG] Setting system property [sun.cpu.isalist]=[]
[DEBUG] Setting system property [sun.jnu.encoding]=[ISO-8859-1]
[DEBUG] Setting system property [file.encoding.pkg]=[sun.io]
[DEBUG] Setting system property [env.SHLVL]=[2]
[DEBUG] Setting system property [file.separator]=[/]
[DEBUG] Setting system property [java.specification.name]=[Java Platform API Specification]
[DEBUG] Setting system property [java.class.version]=[51.0]
[DEBUG] Setting system property [user.country]=[US]
[DEBUG] Setting system property [java.home]=[/usr/lib/jvm/java-7-openjdk-ppc64el/jre]
[DEBUG] Setting system property [java.vm.info]=[mixed mode]
[DEBUG] Setting system property [env.LOGNAME]=[ralphbel]
[DEBUG] Setting system property [os.version]=[3.16.0-30-generic]
[DEBUG] Setting system property [path.separator]=[:]
[DEBUG] Setting system property [java.vm.version]=[24.75-b04]
[DEBUG] Setting system property [env.LANGUAGE]=[en_US:]
[DEBUG] Setting system property [env.JAVA_HOME]=[/usr/lib/jvm/java-7-openjdk-ppc64el]
[DEBUG] Setting system property [java.awt.printerjob]=[sun.print.PSPrinterJob]
[DEBUG] Setting system property [env.TERM]=[xterm]
[DEBUG] Setting system property [sun.io.unicode.encoding]=[UnicodeLittle]
[DEBUG] Setting system property [jnr.ffi.library.path]=[/gpfs/DDNgpfs1/ralphbel/jnr-ffi/target]
[DEBUG] Setting system property [awt.toolkit]=[sun.awt.X11.XToolkit]
[DEBUG] Setting system property [env.MANPATH]=[/shared/lsf/9.1/man:]
[DEBUG] Setting system property [user.home]=[/gpfs/DDNgpfs1/ralphbel]
[DEBUG] Setting system property [env.OLDPWD]=[/gpfs/DDNgpfs1/ralphbel/jnr-ffi]
[DEBUG] Setting system property [java.specification.vendor]=[Oracle Corporation]
[DEBUG] Setting system property [test]=[jnr.ffi.LibraryLoaderTest]
[DEBUG] Setting system property [java.library.path]=[/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/lib:/usr/local/cuda/lib64:/usr/java/packages/lib/ppc64:/usr/lib/powerpc64le-linux-gnu/jni:/lib/powerpc64le-linux-gnu:/usr/lib/powerpc64le-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
[DEBUG] Setting system property [java.vendor.url]=[http://java.oracle.com/]
[DEBUG] Setting system property [java.vm.vendor]=[Oracle Corporation]
[DEBUG] Setting system property [maven.home]=[/usr/share/maven]
[DEBUG] Setting system property [java.runtime.name]=[OpenJDK Runtime Environment]
[DEBUG] Setting system property [sun.java.command]=[org.codehaus.plexus.classworlds.launcher.Launcher -Dtest=jnr.ffi.LibraryLoaderTest test -e -X]
[DEBUG] Setting system property [java.class.path]=[/usr/share/maven/boot/plexus-classworlds-2.x.jar]
[DEBUG] Setting system property [env.XDG_SESSION_ID]=[584]
[DEBUG] Setting system property [env.LSF_ENVDIR]=[/shared/lsf/conf]
[DEBUG] Setting system property [maven.version]=[3.0.5]
[DEBUG] Setting system property [java.vm.specification.name]=[Java Virtual Machine Specification]
[DEBUG] Setting system property [java.vm.specification.version]=[1.7]
[DEBUG] Setting system property [sun.cpu.endian]=[little]
[DEBUG] Setting system property [sun.os.patch.level]=[unknown]
[DEBUG] Setting system property [env.HOME]=[/gpfs/DDNgpfs1/ralphbel]
[DEBUG] Setting system property [env.LS_COLORS]=[rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:]
[DEBUG] Setting system property [java.io.tmpdir]=[/tmp]
[DEBUG] Setting system property [env.LD_LIBRARY_PATH]=[/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/lib:/usr/local/cuda/lib64]
[DEBUG] Setting system property [java.vendor.url.bug]=[http://bugreport.sun.com/bugreport/]
[DEBUG] Setting system property [env.LSF_SERVERDIR]=[/shared/lsf/9.1/linux3.13-glibc2.19-ppc64le/etc]
[DEBUG] Setting system property [os.arch]=[ppc64]
[DEBUG] Setting system property [java.awt.graphicsenv]=[sun.awt.X11GraphicsEnvironment]
[DEBUG] Setting system property [java.ext.dirs]=[/usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/ext:/usr/java/packages/lib/ext]
[DEBUG] Setting system property [env.XDG_RUNTIME_DIR]=[/run/user/0]
[DEBUG] Setting system property [user.dir]=[/gpfs/DDNgpfs1/ralphbel/jnr-ffi]
[DEBUG] Setting system property [line.separator]=[
]
[DEBUG] Setting system property [java.vm.name]=[OpenJDK 64-Bit Server VM]
[DEBUG] Setting system property [basedir]=[/gpfs/DDNgpfs1/ralphbel/jnr-ffi]
[DEBUG] Setting system property [env.BINARY_TYPE_HPC]=[]
[DEBUG] Setting system property [env.MAIL]=[/var/mail/ralphbel]
[DEBUG] Setting system property [file.encoding]=[ISO-8859-1]
[DEBUG] Setting system property [java.specification.version]=[1.7]
[DEBUG] Setting system property [env.LESSCLOSE]=[/usr/bin/lesspipe %s %s]
[DEBUG] Using JVM: /usr/lib/jvm/java-7-openjdk-ppc64el/jre/bin/java
[INFO] Surefire report directory: /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/surefire-reports
Forking command line: /bin/sh -c "cd /gpfs/DDNgpfs1/ralphbel/jnr-ffi && /usr/lib/jvm/java-7-openjdk-ppc64el/jre/bin/java -jar /tmp/surefirebooter5720510904835221455.jar /tmp/surefire8937670906845062094tmp /tmp/surefire9185341452076952346tmp"

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running jnr.ffi.LibraryLoaderTest
OpenJDK 64-Bit Server VM warning: You have loaded library /tmp/jffi3064546001316340959.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Tests run: 7, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.43 sec <<< FAILURE!

Results :

Tests in error: 
  mapperWithFuctionMapper(jnr.ffi.LibraryLoaderTest)
  optionWithFunctionMapper(jnr.ffi.LibraryLoaderTest)
  mapMethod(jnr.ffi.LibraryLoaderTest)
  functionMappersCombine(jnr.ffi.LibraryLoaderTest)

Tests run: 7, Failures: 0, Errors: 4, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.354s
[INFO] Finished at: Sun Mar 15 15:08:44 EDT 2015
[INFO] Final Memory: 12M/183M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test (default-test) on project jnr-ffi: There are test failures.
[ERROR] 
[ERROR] Please refer to /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test (default-test) on project jnr-ffi: There are test failures.

Please refer to /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/surefire-reports for the individual test results.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /gpfs/DDNgpfs1/ralphbel/jnr-ffi/target/surefire-reports for the individual test results.
    at org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:530)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Problem with sqlite3_create_function_v2

Hello,
I am getting the following error when calling sqlite3_create_function_v2:

21: misuse at line 134792 of [e9bb4cf40f]

https://www.sqlite.org/2016/sqlite-autoconf-3120000.tar.gz

  if( zFunctionName==0 ||
      (xSFunc && (xFinal || xStep)) || 
      (!xSFunc && (xFinal && !xStep)) ||
      (!xSFunc && (!xFinal && xStep)) ||
      (nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG) ||
      (255<(nName = sqlite3Strlen30( zFunctionName))) ){
    return SQLITE_MISUSE_BKPT; // line 134792
  }

https://github.com/gwenn/sqlite-jna/blob/jnr/src/main/java/org/sqlite/SQLite.java#L769

@IgnoreError
int sqlite3_create_function_v2(@In Pointer pDb, @In @Encoding("UTF-8")String functionName, int nArg, int eTextRep, @In Pointer pApp, @In ScalarCallback xFunc, @In AggregateStepCallback xStep, @In AggregateFinalCallback xFinal, @In Pointer xDestroy);

https://github.com/gwenn/sqlite-jna/blob/jnr/src/main/java/org/sqlite/SQLite.java#L379

static int sqlite3_create_function_v2(Pointer pDb, String functionName, int nArg, int eTextRep, Pointer pApp, ScalarCallback xFunc, AggregateStepCallback xStep, AggregateFinalCallback xFinal, Pointer xDestroy) {
    return library.sqlite3_create_function_v2(pDb, functionName, nArg, eTextRep, pApp, xFunc, xStep, xFinal, xDestroy);
}

If I manually change the signature and force callback(s) to be null, it works:

static int sqlite3_create_function_v2(Pointer pDb, String functionName, int nArg, int eTextRep, Pointer pApp, ScalarCallback xFunc, AggregateStepCallback xStep, AggregateFinalCallback xFinal, Pointer xDestroy) {
    return library.sqlite3_create_function_v2(pDb, functionName, nArg, eTextRep, pApp, null, xStep, xFinal, xDestroy);
}
// ...
@IgnoreError
int sqlite3_create_function_v2(@In Pointer pDb, @In @Encoding("UTF-8")String functionName, int nArg, int eTextRep, @In Pointer pApp, @In Pointer xFunc, @In AggregateStepCallback xStep, @In AggregateFinalCallback xFinal, @In Pointer xDestroy);

or

static int sqlite3_create_function_v2(Pointer pDb, String functionName, int nArg, int eTextRep, Pointer pApp, ScalarCallback xFunc, AggregateStepCallback xStep, AggregateFinalCallback xFinal, Pointer xDestroy) {
    return library.sqlite3_create_function_v2(pDb, functionName, nArg, eTextRep, pApp, xFunc, null, null, xDestroy);
}
// ...
@IgnoreError
int sqlite3_create_function_v2(@In Pointer pDb, @In @Encoding("UTF-8")String functionName, int nArg, int eTextRep, @In Pointer pApp, @In ScalarCallback xFunc, @In Pointer xStep, @In Pointer xFinal, @In Pointer xDestroy);

It seems that JNR is passing a non-null function pointer to C even when the Java callback/delegate is null.
Regards.

Loading LibC on Fedora picks the 32-bit version for a 64-bit JVM.

Trying a simple hello world in jruby on Fedora produces this:

$ uname -a
Linux localhost.localdomain 3.16.6-200.fc20.x86_64 #1 SMP Wed Oct 15 13:06:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ java -version (the system jdk)
java version "1.7.0_71"
OpenJDK Runtime Environment (fedora-2.5.3.0.fc20-x86_64 u71-b14)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
$ bin/jruby -e 'p :hello'
Native.java:69:in `libc': java.lang.NoClassDefFoundError: Could not initialize class jnr.enxio.channels.Native$SingletonHolder
    from Native.java:112:in `write'
    from NativeDeviceChannel.java:86:in `write'
    from PosixShim.java:90:in `write'
    from OpenFile.java:594:in `flushBufferSync'
    from OpenFile.java:585:in `flushBufferSync2'
    from OpenFile.java:578:in `flushBufferAsync2'
    from OpenFile.java:571:in `flushBuffer'
    from OpenFile.java:426:in `io_fflush'
    from RubyIO.java:2154:in `flushRaw'
    from RubyIO.java:2136:in `flush'
    from RubyKernel.java:498:in `p'
    from RubyKernel$INVOKER$s$0$0$p.gen:-1:in `call'
    from JavaMethod.java:679:in `call'
    from DynamicMethod.java:206:in `call'
    from CachingCallSite.java:295:in `cacheAndCall'
    from CachingCallSite.java:157:in `call'
    from -e:-1:in `invokeOther0:p'
    from -e:1:in `__script__'
    from NativeMethodAccessorImpl.java:-2:in `invoke0'
    from NativeMethodAccessorImpl.java:57:in `invoke'
    from DelegatingMethodAccessorImpl.java:43:in `invoke'
    from Method.java:606:in `invoke'
    from Compiler.java:73:in `__file__'
    from Compiler.java:93:in `load'
    from Ruby.java:805:in `runScript'
    from Ruby.java:798:in `runScript'
    from Ruby.java:749:in `runNormally'
    from Ruby.java:559:in `runFromMain'
    from Main.java:405:in `doRunFromMain'
    from Main.java:300:in `internalRun'
    from Main.java:227:in `run'
    from Main.java:199:in `main'

I have both 64-bit and 32-bit libc because some apps still require 32-bit.
The java.library.path is
/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib,
so it should definitely pick /usr/lib64/libc.so and not /usr/lib/libc.so.6.
Notive there is also /lib/libc.so.6 which is 32-bit.

I cannot find any apparent wrong logic in https://github.com/jnr/jnr-ffi/blob/master/src/main/java/jnr/ffi/Platform.java#L424-L473 but it has some hidden complexity so the bug might still be there or around.
In any case, the loader should definitely consider only compatible architectures and not just take the latest version.

How can I test a version of jnr-ffi I modified with jruby?

See jruby/jruby#2016 for more details.

Passing heap-allocated byte[]s

We are using JNR-FFI to wrap the C LMDB library in LmdbJava. LMDB requires a MDB_val with a size and pointer to the data. This works fine with direct ByteBuffers (where we can fetch the memory address and capacity from the buffer and put it directly into memory we allocated for the struct), but we've had a request to support heap-allocated byte[]s. We can copy the byte[] to a direct buffer, but this has considerable cost and performance is a major consideration of LMDB users.

Is there some way we can fetch the on-heap byte[] address and protect it from being moved during the timespan of an JNR-FFF native call? GetByteArrayElements in JNINativeInterface might be suitable, but I cannot see any information on how to use it. Any suggestions appreciated.

LocateLibrary Filename filter doesn't locate libraries in some instances (Platform$Linux.locateLibrary()).

There is an issue with the locateLibrary method in Platform$Linux.locateLibrary() method ( https://github.com/jnr/jnr-ffi/blob/master/src/main/java/jnr/ffi/Platform.java Line 424), in that it only looks for: lib.so or lib.so.[0-9]+. which may miss some instances of libraries that don't follow this convention.

For example, on Debian/Ubuntu, libssl (part of OpenSSL) is installed only as /lib/x86_64-linux-gnu/libssl.so.1.0.0 (eg, https://packages.debian.org/sid/amd64/libssl1.0.0/filelist for full list). The current regex will fail to locate this library.

The obvious temporary work around is to symlink libssl.so.1.0.0 to libssl.so.1 (or just libssl.so), but this will have to be done for all instances of libraries that don't do this already, and makes it painful for software developers having to support multiple OS installations.

While personally I believe this is a distribution issue (for not installing all libraries with the expected convention), JNR should also be smart enough to handle these types of oddities with shared libraries.

I've tested changing the regex pattern to
Pattern p = Pattern.compile("lib" + libName + "\.so(\.[0-9]+)*$");
and this appears to work well, and this new pattern no longer requires testing for an exact match either, as the pattern simple looks for "libssl.so" followed by zero or more ".[0-9]+" number groups. The alternative is to remove the last $ from the original regex pattern, so it doesn't match end of string...

Additionally, when scanning for highest version, the substring() method (line 453) will have to handle the new format (mulitple groups of version digits) as well,
eg
String num = path.substring(path.lastIndexOf(".so.") + 4);
num = num.substring(0, num.indexOf("."));

The above only takes into account the first digit, but this was good enough for our implementations.

Inner Structs cannot be send to C functions due wrong ToNativeConverter

Inner Structs fields are not correctly converted to native when passed as function parameter.
For example:

public InnerSt extends Struct {
  public Signed16 a = new Signed16();
  ...
}
public St extends Struct {
  public Signed32 b = new Signed32();
  public InnerSt inner = inner(new InnerSt(getRuntime());
  ...
}

When calling a function and sending the inner struct as argument:

St st = new St(runtime);
some_c_func(st.inner);

The structured is not correctly received in the c function.

Debugging the code I found that the problem is on StructByReferenceToNativeConverter which does:

    public Pointer toNative(Struct value, ToNativeContext ctx) {
        return value != null ? Struct.getMemory(value, flags) : null;
    }

Returning a Pointer to the enclosing Struct. (Struct$Info.getMemory() does return enclosing != null ? enclosing.__info.getMemory(flags) ).

A fix could be:

    public Pointer toNative(Struct value, ToNativeContext ctx) {
    	if (value == null)
    		return null;
        Pointer memory = Struct.getMemory(value, 0);
	if (value.__info.enclosing != null) {
        	offset = value.__info.getOffset();
        	Pointer innerMemory = memory.slice(offset);
        	return innerMemory;
        }
	return memory;
    }

Probably accessing __info field is not the best and some accessors should be added to Struct (i.e: isInner(), getOffset() )

I have tested a workaround which does this on a custom ToNativeConverter and it works nice.

I can probably provide a pull request if someone considers this is the proper way to fix it.

Provide user docs

As a potential user of JNR i would like to start with some documentation, but i can't find any!
Here is what i would like to see:

  • a "Get started" guide
  • cookbook with mapping samples of C/C++ functions, callbacks, pointer, stucts, datatype conversion and so on to JNR/Java
  • JavaDocs
  • Design guidlines
  • comparison to JNI and JNA with samples
  • a link to a user Forum or google group
  • tutorial how to setup a build enviroment for Win, Mac, Linux ..
  • you name it

JNA has some good documentationfor a reference -> http://twall.github.io/jna/4.1.0/overview-summary.html

Support explicit packing alignment in structures

Some C libraries use the pack compiler pragma to explicitly control alignment of structure fields for ABI compatibility across multiple architectures (e.g. libkrb5 on OSX). This causes problems when passing structures across the jnr-ffi boundary to and from native libraries. For example, the structure

#pragma pack(push, 2)
struct foo {
    uint32_t value;
    void *pointer;
};

will have size 12 in native code, but will have 16 if defined thusly in jnr-ffi:

class Foo extends Struct {
    u_int32_t value = new u_int32_t();
    Pointer pointer = new Pointer();
    // ...
 }

leading to incorrect values for Foo.pointer.get(). We can address this by adding a @Pack annotation that takes an explicit padding value on a per-structure basis.

Bad LD_LIBRARY_PATH bits can get into load logic

While trying to reproduce jruby/jruby#3409, I ended up setting LD_LIBRARY_PATH to /lib32, causing it to appear in java.library.path. For whatever reason, the filtering applied by #52 did not filter this path out, and I was able to cause the same error in a somewhat artificial way.

I think it worthwhile to figure out why the same filtering did not apply to my env var in case other users have a situation where they've got a bad (or unusual?) set of LD*_LIBRARY_PATHs that might trigger a similar bad library load.

can not create provider

with code Class.forName("jnr.ffi.provider.jffi.Provider").newInstance(); it throws exception:
Exception in thread "main" java.lang.ExceptionInInitializerError
at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:49)
at jnr.ffi.provider.jffi.Provider.(Provider.java:29)
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)

the NativeRuntime has a private class constructor, and it cause the exception

"Expecting to find integer on stack" when using @Delegate

I'm getting a runtime exception when trying to use a delegate.

Exception in thread "main" java.lang.RuntimeException: java.lang.VerifyError: (class: foo/External$Lib$jnr$ffi$2, method: Process signature: (Lfoo/External$FailureCallback;J[B)Z) Expecting to find integer on stack
    at jnr.ffi.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:201)
    at jnr.ffi.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:59)
    at jnr.ffi.provider.jffi.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:43)
    at jnr.ffi.LibraryLoader.load(LibraryLoader.java:228)
    at jnr.ffi.LibraryLoader.load(LibraryLoader.java:201)

The code I'm using is simply:

 protected interface Lib  {
    boolean Process(byte[] data, Callback callback);
 }

 public static interface Callback {
    @Delegate public void call();
 }

The problem seems to be something to do with the parameter types because changing data from byte[] to long works fine.

jnr.ffi on ppc64le ubuntu 14.10 and IBM JDK fails PointerTest.

Under the IBM JDK we get the following error:

------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running jnr.ffi.PointerTest
RB: PointerTest::pointerArraySetElement
ptr_set_array_element (nil), 0
Unhandled exception
Type=Segmentation error vmState=0x00040000
J9Generic_Signal_Number=00000004 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001

I added instrumentation to isolate the problem:

diff --git a/libtest/PointerTest.c b/libtest/PointerTest.c
index ce642bb..c291c6e 100644
--- a/libtest/PointerTest.c
+++ b/libtest/PointerTest.c
@@ -54,12 +54,15 @@ TEST(pointer);
 void*
 ptr_return_array_element(void **ptrArray, int arrayIndex)
 {
+    printf("ptr_return_array_element %p, %d\n", ptrArray, arrayIndex);  fflush(stdout);
     return ptrArray[arrayIndex];
 }

 void
 ptr_set_array_element(void **ptrArray, int arrayIndex, void *value)
 {
+       printf("ptr_set_array_element %p, %d\n", ptrArray, arrayIndex);  fflush(stdout);
+       printf("ptr_set_array_element *%p, %d\n", *ptrArray, arrayIndex);  fflush(stdout);
     ptrArray[arrayIndex] = value;
 }

diff --git a/src/test/java/jnr/ffi/PointerTest.java b/src/test/java/jnr/ffi/PointerTest.java
index ac6afbf..faa2a18 100644
--- a/src/test/java/jnr/ffi/PointerTest.java
+++ b/src/test/java/jnr/ffi/PointerTest.java
@@ -381,6 +381,7 @@ public class PointerTest {

     @Test
     public void pointerArraySetElement() {
+        System.out.print("RB: PointerTest::pointerArraySetElement\n");
         Pointer[] ary = new Pointer[10];
         Pointer p1 = runtime.getMemoryManager().newPointer(0xdeadbeef & runtime.addressMask());
         Pointer p2 = runtime.getMemoryManager().newPointer(0xfee1dead & runtime.addressMask());
@@ -388,6 +389,7 @@ public class PointerTest {
         assertEquals(p1, ary[0]);
         testlib.ptr_set_array_element(ary, 9, p2);
         assertEquals(p2, ary[9]);
+        System.out.print("RB: PointerTest::pointerArraySetElement-\n");
     }

     @Test public void mixObjectsAndPrimitives() {

The telemetry above shows that we enter the "ptr_set_array_element" function but our pointer is nill.

This is similar to [https://github.com//issues/32,](#32, but not quite the same,

We get through the pointerSetArrayElement test, but fail on the pointerGetArrayElement test for that one.

jnr.ffi.LibraryLoader.load ignore previously set FunctionMappers.

jnr.ffi.LibraryLoader.load ignore previously set FunctionMappers.

LibraryLoader.mapper(FunctionMapper) set LibraryLoader.optionMap but load() only use LibraryLoader.functionMappers. There is currently no way to fill LibraryLoader.functionMappers with custom mappers.

AsmClassLoader cannot load class when jnr itself is not loaded by the system class loader

Version: com.github.jnr:jnr-ffi:2.0.7 found on Maven repository

AsmClassLoader throws java.lang.ClassNotFoundException: jnr.ffi.provider.jffi.NativeClosureProxy when it is about to define a class but jnr-ffi classes are not loaded by the ClassLoader.getSystemClassLoader. This is usually triggered by creating closures from jnr-ffi.

One reason for jnr-ffi not being loaded by the system class loader is because it is part of a ScalaTest test case, in which case ScalaTest seems to have its own class loader that loads both jnr-ffi and the class being tested. Because of this, the same application works fine when run stand-alone, but fails when tested by ScalaTest.

The reason, I think, is that AsmClassLoader is created in NativeRuntime, when an AsmClassLoader is created with ClassLoader.getSystemClassLoader() as its parent. The problem here is that NativeRuntime itself may not be loaded by the system class loader.

The following program can reproduce this problem. But if the test body is copied to a stand-alone application, no exceptions will be thrown.

package jnr.ffi.provider.jffi

import org.scalatest.FlatSpec
import org.scalatest.Matchers

import jnr.ffi.Runtime
import junk.jnr.rpncalc.ClosureType1

class AsmClassLoaderTest extends FlatSpec with Matchers {
  "AsmClassLoader" should "load jnr-ffi-related classes" in {
    val rt = Runtime.getSystemRuntime().asInstanceOf[NativeRuntime]
    val cm = rt.getClosureManager()

    val clos = new ClosureType1 {
      override def invoke(x: Int, y: Int): Double = (x + y).toDouble
    }

    try {
      val ptr = cm.getClosurePointer(classOf[ClosureType1], clos)
    } catch {
      case e: RuntimeException => println(s"Caught exception from getClosurePointer: ${e.getClass}: ${e.getMessage}")
    }

    val thisl = this.getClass.getClassLoader
    val rtl = rt.getClass.getClassLoader
    val cml = cm.getClass.getClassLoader
    val acl = new AsmClassLoader(ClassLoader.getSystemClassLoader)
    val acl2 = new AsmClassLoader(rtl)
    val syscl = ClassLoader.getSystemClassLoader

    println("Point1")
    println(s"thisl=${thisl}")
    println(s"rtl=${rtl}")
    println(s"cml=${cml}")
    println(s"acl=${acl}")
    println(s"acl.getParent=${acl.getParent}")
    println(s"acl2=${acl2}")
    println(s"acl2.getParent=${acl2.getParent}")

    val clsName = "jnr.ffi.provider.jffi.NativeClosureProxy"
    val cls1 = rtl.loadClass(clsName)
    println(s"cls1=${cls1}")
    try {
      val cls2 = acl.loadClass(clsName)
      println(s"cls2=${cls2}")
    } catch {
      case e: ClassNotFoundException => println(s"Caught exception from AsmClassLoader: ${e.getClass}: ${e.getMessage}")
    }
    val cls3 = acl2.loadClass(clsName)
    println(s"cls3=${cls3}")
    try {
      val cls4 = syscl.loadClass(clsName)
      println(s"cls4=${cls4}")
    } catch {
      case e: ClassNotFoundException => println(s"Caught exception from system class loader: ${e.getClass}: ${e.getMessage}")
    }

    println("Point2")
  }
}

When run with ScalaTest, the output is:

Run starting. Expected test count is: 1
AsmClassLoaderTest:
AsmClassLoader
Caught exception from getClosurePointer: class java.lang.RuntimeException: java.lang.NoClassDefFoundError: jnr/ffi/provider/jffi/NativeClosureProxy
Point1
syscl=sun.misc.Launcher$AppClassLoader@33909752
thisl=java.net.URLClassLoader@33c7353a
rtl=java.net.URLClassLoader@33c7353a
cml=java.net.URLClassLoader@33c7353a
acl=jnr.ffi.provider.jffi.AsmClassLoader@2de8284b
acl.getParent=sun.misc.Launcher$AppClassLoader@33909752
acl2=jnr.ffi.provider.jffi.AsmClassLoader@396e2f39
acl2.getParent=java.net.URLClassLoader@33c7353a
cls1=class jnr.ffi.provider.jffi.NativeClosureProxy
Caught exception from AsmClassLoader: class java.lang.ClassNotFoundException: jnr.ffi.provider.jffi.NativeClosureProxy
cls3=class jnr.ffi.provider.jffi.NativeClosureProxy
Caught exception from system class loader: class java.lang.ClassNotFoundException: jnr.ffi.provider.jffi.NativeClosureProxy
Point2
- should load jnr-ffi-related classes
Run completed in 461 milliseconds.
Total number of tests run: 1
Suites: completed 1, aborted 0
Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0
All tests passed.

Stack trace of AsmClassLoader.loadClass:

java.lang.ClassNotFoundException: jnr.ffi.provider.jffi.NativeClosureProxy
    at java.lang.ClassLoader.findClass(ClassLoader.java:530)
    at jnr.ffi.provider.jffi.AsmClassLoader.findClass(AsmClassLoader.java:51)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at jnr.ffi.provider.jffi.AsmClassLoaderTest$$anonfun$1.apply$mcV$sp(AsmClassLoaderTest.scala:45)
    at jnr.ffi.provider.jffi.AsmClassLoaderTest$$anonfun$1.apply(AsmClassLoaderTest.scala:11)
    at jnr.ffi.provider.jffi.AsmClassLoaderTest$$anonfun$1.apply(AsmClassLoaderTest.scala:11)
    at org.scalatest.Transformer$$anonfun$apply$1.apply$mcV$sp(Transformer.scala:22)
    at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
    at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
    at org.scalatest.Transformer.apply(Transformer.scala:22)
    at org.scalatest.Transformer.apply(Transformer.scala:20)
    at org.scalatest.FlatSpecLike$$anon$1.apply(FlatSpecLike.scala:1647)
    at org.scalatest.Suite$class.withFixture(Suite.scala:1122)
    at org.scalatest.FlatSpec.withFixture(FlatSpec.scala:1683)
    at org.scalatest.FlatSpecLike$class.invokeWithFixture$1(FlatSpecLike.scala:1644)
    at org.scalatest.FlatSpecLike$$anonfun$runTest$1.apply(FlatSpecLike.scala:1656)
    at org.scalatest.FlatSpecLike$$anonfun$runTest$1.apply(FlatSpecLike.scala:1656)
    at org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
    at org.scalatest.FlatSpecLike$class.runTest(FlatSpecLike.scala:1656)
    at org.scalatest.FlatSpec.runTest(FlatSpec.scala:1683)
    at org.scalatest.FlatSpecLike$$anonfun$runTests$1.apply(FlatSpecLike.scala:1714)
    at org.scalatest.FlatSpecLike$$anonfun$runTests$1.apply(FlatSpecLike.scala:1714)
    at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:413)
    at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
    at org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:390)
    at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:427)
    at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
    at org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:396)
    at org.scalatest.SuperEngine.runTestsImpl(Engine.scala:483)
    at org.scalatest.FlatSpecLike$class.runTests(FlatSpecLike.scala:1714)
    at org.scalatest.FlatSpec.runTests(FlatSpec.scala:1683)
    at org.scalatest.Suite$class.run(Suite.scala:1424)
    at org.scalatest.FlatSpec.org$scalatest$FlatSpecLike$$super$run(FlatSpec.scala:1683)
    at org.scalatest.FlatSpecLike$$anonfun$run$1.apply(FlatSpecLike.scala:1760)
    at org.scalatest.FlatSpecLike$$anonfun$run$1.apply(FlatSpecLike.scala:1760)
    at org.scalatest.SuperEngine.runImpl(Engine.scala:545)
    at org.scalatest.FlatSpecLike$class.run(FlatSpecLike.scala:1760)
    at org.scalatest.FlatSpec.run(FlatSpec.scala:1683)
    at org.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:55)
    at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2563)
    at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2557)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2557)
    at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1044)
    at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1043)
    at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2722)
    at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1043)
    at org.scalatest.tools.Runner$.main(Runner.scala:860)
    at org.scalatest.tools.Runner.main(Runner.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at scala.tools.eclipse.scalatest.launching.ScalaTestLauncher$.main(ScalaTestLauncher.scala:20)
    at scala.tools.eclipse.scalatest.launching.ScalaTestLauncher.main(ScalaTestLauncher.scala)

I copied the test body to a standalone Scala App, run it again, and output is:

Point1
syscl=sun.misc.Launcher$AppClassLoader@659e0bfd
thisl=sun.misc.Launcher$AppClassLoader@659e0bfd
rtl=sun.misc.Launcher$AppClassLoader@659e0bfd
cml=sun.misc.Launcher$AppClassLoader@659e0bfd
acl=jnr.ffi.provider.jffi.AsmClassLoader@7cef4e59
acl.getParent=sun.misc.Launcher$AppClassLoader@659e0bfd
acl2=jnr.ffi.provider.jffi.AsmClassLoader@64b8f8f4
acl2.getParent=sun.misc.Launcher$AppClassLoader@659e0bfd
cls1=class jnr.ffi.provider.jffi.NativeClosureProxy
cls2=class jnr.ffi.provider.jffi.NativeClosureProxy
cls3=class jnr.ffi.provider.jffi.NativeClosureProxy
cls4=class jnr.ffi.provider.jffi.NativeClosureProxy
Point2

more then 2 level inner Structs

if you have a 3-level inner Struct, it's members offsets are set against the top-level Struct, so the first byte of the 3-level Struct is displayed with the value of the top-level Struct first byte.

Struct.UTFString.get() fails for UTF-16

This fails due to the underlying call to IO.getZeroTerminatedByteArray - this should really be looking for double nulls not single nulls for wide Charsets.

ToNativeContext/FromNativeContext are null when invoking a ToNativeConverter/FromNativeConverter for a closure

In ClosureUtil.getResultType and ClosureUtil.getParameterType the context is explicitly set to null. This causes the emitted code to invoke the converters with a null to/from native context. I tried setting the context in these methods, and it seems to work, is there a reason the native context is nulled in these methods?

I changed ClosureUtil line 59 from

 return new jnr.ffi.provider.FromNativeType(declaredJavaClass, nativeType, annotations, converter, null);

to

 return new jnr.ffi.provider.FromNativeType(declaredJavaClass, nativeType, annotations, converter, context);

Consider documenting IgnoreError annotation's target

I'm guessing that the correct target is on the method of the interface (picked that up from contextual cues). However, I did all of that, added unit tests that verify that the generated interface has jnr.ffi.annotations.IgnoreError annotations on every method (apologies for the Clojure), so I know the annotation is being correctly applied. I've ran benchmark tests, but this doesn't appear to have any effect (like #78) and potentially a very small negative performance impact; so this suggests to me that maybe I'm doing it wrong.

jnr-ffi library fails self test after adding type ppc64 TypeAliases

We are trying to use an opensource project "logstash" on a ppc64 architecure.

When running it spit out this error message:

SEVERE: failed to load type aliases: java.lang.ClassNotFoundException: jnr.ffi.provider.jffi.platform.ppc64.linux.TypeAliases

When i took a look at this source tree, I saw only the following platforms supported.

https://github.com/jnr/jnr-ffi/tree/master/src/main/java/jnr/ffi/provider/jffi/platform

        arm/linux   
    i386    
    mips/linux  
    mipsel/linux    
    ppc     
    s390/linux  
    s390x/linux     
    sparc/solaris   
    sparcv9/solaris     
    x86_64  

Is ppc64 and ppc64el support going to be available in this package?

Tests fail for arm

This library is used by the fabric8 docker-maven-plugin which produces the error:

ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.14.3-SNAPSHOT:build (default-cli) on project java-fatjar: Execution default-cli of goal io.fabric8:docker-maven-plugin:0.14.3-SNAPSHOT:build failed: An API incompatibility was encountered while executing io.fabric8:docker-maven-plugin:0.14.3-SNAPSHOT:build: java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider

Trying to build this on a RPi3 built ok but produces the following errors:


T E S T S

Running jnr.ffi.NumberTest
Tests run: 16, Failures: 0, Errors: 15, Skipped: 0, Time elapsed: 0.942 sec <<< FAILURE!
Running jnr.ffi.EnumTest
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.113 sec <<< FAILURE!
Running jnr.ffi.ResultConverterTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.042 sec <<< FAILURE!
Running jnr.ffi.BufferTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.06 sec <<< FAILURE!
Running jnr.ffi.struct.StructureTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.039 sec <<< FAILURE!
Running jnr.ffi.byref.PointerByReferenceTest
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.099 sec <<< FAILURE!
Running jnr.ffi.PointerTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.044 sec <<< FAILURE!
Running jnr.ffi.LibraryLoaderTest
Tests run: 7, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.104 sec <<< FAILURE!
Running jnr.ffi.ObjectReferenceManagerTest
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.109 sec <<< FAILURE!
Running jnr.ffi.LibraryTest
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.033 sec <<< FAILURE!
Running jnr.ffi.StringTest
Tests run: 7, Failures: 0, Errors: 7, Skipped: 0, Time elapsed: 0.135 sec <<< FAILURE!
Running jnr.ffi.MemoryIOTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.034 sec <<< FAILURE!
Running jnr.ffi.StringArrayTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.027 sec <<< FAILURE!
Running jnr.ffi.mapper.CachingTypeMapperTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.09 sec
Running jnr.ffi.byref.AddressByReferenceTest
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.092 sec <<< FAILURE!
Running jnr.ffi.DelegateTest
Tests run: 18, Failures: 0, Errors: 18, Skipped: 0, Time elapsed: 0.384 sec <<< FAILURE!
Running jnr.ffi.byref.ByteByReferenceTest
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 2.049 sec <<< FAILURE!
Running jnr.ffi.byref.IntByReferenceTest
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.076 sec <<< FAILURE!
Running jnr.ffi.InvocationTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.021 sec <<< FAILURE!
Running jnr.ffi.mapper.AnnotatedMappedTypeTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.019 sec <<< FAILURE!
Running jnr.ffi.TypeDefinitionTest
Tests run: 3, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.039 sec <<< FAILURE!
Running jnr.ffi.GlobalVariableTest
Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.054 sec <<< FAILURE!
Running jnr.ffi.struct.EnumTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
Running jnr.ffi.struct.AlignmentTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.02 sec <<< FAILURE!
Running jnr.ffi.struct.AsciiStringFieldTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.027 sec <<< FAILURE!
Running jnr.ffi.struct.ArrayTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.017 sec <<< FAILURE!
Running jnr.ffi.struct.StructLayoutTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.026 sec <<< FAILURE!
Running jnr.ffi.struct.UTF8StringFieldTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.023 sec <<< FAILURE!
Running jnr.ffi.struct.UnionTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.02 sec <<< FAILURE!
Running jnr.ffi.ArrayTest
Tests run: 8, Failures: 0, Errors: 8, Skipped: 0, Time elapsed: 0.127 sec <<< FAILURE!
Running jnr.ffi.LastErrorTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.023 sec <<< FAILURE!
Running jnr.ffi.struct.PaddingTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.017 sec <<< FAILURE!

Results :

Tests in error:
testDoubleDivision(jnr.ffi.NumberTest)
testDoubleMultiplication(jnr.ffi.NumberTest)
testFloatMultiplication(jnr.ffi.NumberTest)
testZeroExtension(jnr.ffi.NumberTest)
testBoxedLongAddition(jnr.ffi.NumberTest)
testFloatAddition(jnr.ffi.NumberTest)
testSignExtension(jnr.ffi.NumberTest)
testDoubleSubtraction(jnr.ffi.NumberTest)
testShortAddition(jnr.ffi.NumberTest)
testNativeLongAddition(jnr.ffi.NumberTest)
testFloatDivision(jnr.ffi.NumberTest)
testDoubleAddition(jnr.ffi.NumberTest)
testPrimitiveLongAddition(jnr.ffi.NumberTest)
testFloatSubtraction(jnr.ffi.NumberTest)
testByteAddition(jnr.ffi.NumberTest)
enumSetResult(jnr.ffi.EnumTest)
enumSetParameter(jnr.ffi.EnumTest)
returnEnum(jnr.ffi.EnumTest)
enumArgument(jnr.ffi.EnumTest)
jnr.ffi.ResultConverterTest
jnr.ffi.BufferTest
jnr.ffi.struct.StructureTest
outOnlyIntReferenceNotRead(jnr.ffi.byref.PointerByReferenceTest)
outOnlyIntReferenceGet(jnr.ffi.byref.PointerByReferenceTest)
inOnlyIntReferenceNotWritten(jnr.ffi.byref.PointerByReferenceTest)
inOnlyReferenceSet(jnr.ffi.byref.PointerByReferenceTest)
jnr.ffi.PointerTest
mapperWithFuctionMapper(jnr.ffi.LibraryLoaderTest)
optionWithFunctionMapper(jnr.ffi.LibraryLoaderTest)
mapMethod(jnr.ffi.LibraryLoaderTest)
functionMappersCombine(jnr.ffi.LibraryLoaderTest)
remove(jnr.ffi.ObjectReferenceManagerTest)
sameObjectReturned(jnr.ffi.ObjectReferenceManagerTest)
differentPointerReturnedForSameObject(jnr.ffi.ObjectReferenceManagerTest)
referenceEqualityOnly(jnr.ffi.ObjectReferenceManagerTest)
loadTestLib(jnr.ffi.LibraryTest)
testReadOnlyString(jnr.ffi.StringTest)
stringResult(jnr.ffi.StringTest)
testStringBuilderAppend(jnr.ffi.StringTest)
testSetStringBuilder(jnr.ffi.StringTest)
testStringBufferAppend(jnr.ffi.StringTest)
testStringParams(jnr.ffi.StringTest)
testSetStringBuffer(jnr.ffi.StringTest)
jnr.ffi.MemoryIOTest
jnr.ffi.StringArrayTest
outOnlyIntReferenceNotRead(jnr.ffi.byref.AddressByReferenceTest)
outOnlyIntReferenceGet(jnr.ffi.byref.AddressByReferenceTest)
inOnlyIntReferenceNotWritten(jnr.ffi.byref.AddressByReferenceTest)
inOnlyReferenceSet(jnr.ffi.byref.AddressByReferenceTest)
closureBrV(jnr.ffi.DelegateTest)
closureErV(jnr.ffi.DelegateTest)
closureIrV(jnr.ffi.DelegateTest)
closureSrV(jnr.ffi.DelegateTest)
closureVrB(jnr.ffi.DelegateTest)
closureVrD(jnr.ffi.DelegateTest)
closureVrE(jnr.ffi.DelegateTest)
closureVrF(jnr.ffi.DelegateTest)
closureVrI(jnr.ffi.DelegateTest)
closureVrL(jnr.ffi.DelegateTest)
closureVrS(jnr.ffi.DelegateTest)
closureVrV(jnr.ffi.DelegateTest)
callFunctionPointerIrV(jnr.ffi.DelegateTest)
callFunctionPointerVrV(jnr.ffi.DelegateTest)
closureStructIrV(jnr.ffi.DelegateTest)
reuseClosure(jnr.ffi.DelegateTest)
closureIrVBoxed(jnr.ffi.DelegateTest)
allocateMany(jnr.ffi.DelegateTest)
outOnlyByteReferenceNotRead(jnr.ffi.byref.ByteByReferenceTest)
inOnlyByteReferenceNotWritten(jnr.ffi.byref.ByteByReferenceTest)
outOnlyByteReferenceGet(jnr.ffi.byref.ByteByReferenceTest)
inOnlyReferenceSet(jnr.ffi.byref.ByteByReferenceTest)
outOnlyIntReferenceNotRead(jnr.ffi.byref.IntByReferenceTest)
inOnlyIntReferenceSet(jnr.ffi.byref.IntByReferenceTest)
outOnlyIntReferenceGet(jnr.ffi.byref.IntByReferenceTest)
inOnlyIntReferenceNotWritten(jnr.ffi.byref.IntByReferenceTest)
hammer(jnr.ffi.InvocationTest)
jnr.ffi.mapper.AnnotatedMappedTypeTest
addUnsigned8(jnr.ffi.TypeDefinitionTest)
returnUnsigned8(jnr.ffi.TypeDefinitionTest)
testIntegerVariableGet(jnr.ffi.GlobalVariableTest)
testIntegerVariableSet(jnr.ffi.GlobalVariableTest)
testCallbackVariableSet(jnr.ffi.GlobalVariableTest)
jnr.ffi.struct.EnumTest
jnr.ffi.struct.AlignmentTest
jnr.ffi.struct.AsciiStringFieldTest
jnr.ffi.struct.ArrayTest
jnr.ffi.struct.StructLayoutTest
jnr.ffi.struct.UTF8StringFieldTest
jnr.ffi.struct.UnionTest
shortByReference(jnr.ffi.ArrayTest)
doubleByReference(jnr.ffi.ArrayTest)
setLong32ByReference(jnr.ffi.ArrayTest)
setLongByReference(jnr.ffi.ArrayTest)
floatByReference(jnr.ffi.ArrayTest)
intByReference(jnr.ffi.ArrayTest)
byteByReference(jnr.ffi.ArrayTest)
getLongByReference(jnr.ffi.ArrayTest)
testLastError(jnr.ffi.LastErrorTest)
jnr.ffi.struct.PaddingTest

Tests run: 112, Failures: 0, Errors: 99, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:55.940s
[INFO] Finished at: Mon Apr 25 20:25:31 UTC 2016
[INFO] Final Memory: 15M/60M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test (default-test) on project jnr-ffi: There are test failures.
[ERROR]
[ERROR] Please refer to /home/pi/jnr-ffi/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[

call to getenv(String) does not terminate the string return value

The following code returns not just the USERNAME environment variable, but also every environment after that.
myusername USERPROFILE=C:\Users\myusername ...

Similar code used to work with jna. This is on Windows 7.

import jnr.ffi.provider.FFIProvider;
import jnr.posix.util.Platform;

public class NativeCallsTest {
   public interface CLibrary  {
         public int system(String cmd);
         public String getenv(String name);
}
public static void main(String[] args) {
  CLibrary _libc;

    jnr.ffi.LibraryLoader<CLibrary> loader = FFIProvider.getSystemProvider().createLibraryLoader(CLibrary.class);
    _libc = loader.load(Platform.IS_WINDOWS ? "msvcrt" : "c");
    System.out.println(_libc.getenv("USERNAME"));
  }
}

Support context class loader in NativeRuntime's closureManager

In some circumstances it would be useful to replace:

  private final NativeClosureManager closureManager = new NativeClosureManager(this,
            new SignatureTypeMapperAdapter(new DefaultTypeMapper()),
            new AsmClassLoader(ClassLoader.getSystemClassLoader()));

with

  private final NativeClosureManager closureManager = new NativeClosureManager(this,
            new SignatureTypeMapperAdapter(new DefaultTypeMapper()),
            new AsmClassLoader(Thread.currentThread().getContextClassLoader()));

A good example is with Spring Boot's nested jars which have the following restriction:

Launched applications should use Thread.getContextClassLoader() when loading classes (most libraries and frameworks will do this by default). Trying to load nested jar classes via ClassLoader.getSystemClassLoader() will fail.

Please see http://www.javaworld.com/article/2077344/core-java/find-a-way-out-of-the-classloader-maze.html for a good discussion of this.

How does the IgnoreError LibraryOption work?

I can't seem to find it anywhere in the code; the only mention is the annotation, but I believe that applies to individual methods (the inverse being SaveError). I thought the goal of LibraryOption was to set the default, however AFAICT IgnoreError isn't used anywhere. This matches my observation that adding LibraryOption/IgnoreError (I have a library that doesn't touch errno) doesn't impact performance at all.

Tests fail on Ubuntu 14.04 (32-bit)

When running tests on Ubuntu 14.04 (32-bit), I get the following result:

 Failed tests: 
  mixObjectsAndPrimitives(jnr.ffi.PointerTest)
  s8Array(jnr.ffi.struct.ArrayTest)

Tests in error: 
  shortByReference(jnr.ffi.ArrayTest)
  doubleByReference(jnr.ffi.ArrayTest)
  setLong32ByReference(jnr.ffi.ArrayTest)
  setLongByReference(jnr.ffi.ArrayTest)
  floatByReference(jnr.ffi.ArrayTest)
  intByReference(jnr.ffi.ArrayTest)
  byteByReference(jnr.ffi.ArrayTest)
  getLongByReference(jnr.ffi.ArrayTest)
  jnr.ffi.BufferTest

Tests run: 232, Failures: 2, Errors: 9, Skipped: 0

All "Tests in error" fail for the same reason:

java.lang.IllegalArgumentException: unsupported type class [J
    at jnr.ffi.provider.jffi.X86MethodGenerator.generateWrapper(X86MethodGenerator.java:148)
    at jnr.ffi.provider.jffi.X86MethodGenerator.generate(X86MethodGenerator.java:108)
    at jnr.ffi.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:132)
    at jnr.ffi.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:59)
    at jnr.ffi.provider.jffi.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:43)
    at jnr.ffi.LibraryLoader.load(LibraryLoader.java:269)
    at jnr.ffi.TstUtil.loadTestLib(TstUtil.java:38)
    at jnr.ffi.TstUtil.loadTestLib(TstUtil.java:28)
    at jnr.ffi.ArrayTest.setUpClass(ArrayTest.java:96)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)

If I run the tests with the option "jnr.ffi.x86asm.enabled" disabled, I get the same result, but the exception changes to:

java.lang.IllegalArgumentException: unsupported parameter type class [J
    at jnr.ffi.provider.jffi.AbstractFastNumericMethodGenerator.generate(AbstractFastNumericMethodGenerator.java:47)
    at jnr.ffi.provider.jffi.BaseMethodGenerator.generate(BaseMethodGenerator.java:42)
    at jnr.ffi.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:132)
    at jnr.ffi.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:59)
    at jnr.ffi.provider.jffi.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:43)
    at jnr.ffi.LibraryLoader.load(LibraryLoader.java:269)
    at jnr.ffi.TstUtil.loadTestLib(TstUtil.java:38)
    at jnr.ffi.TstUtil.loadTestLib(TstUtil.java:28)
    at jnr.ffi.ArrayTest.setUpClass(ArrayTest.java:96)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)

All "Failed tests" fail for a possible bug in "StructArrayParameterConverter.java ". I have a possible solution (https://github.com/henriqueesteves/jnr-ffi/commit/d43ac0e021eb1d45311d9bea8979197781b4a719), however, I have not submitted a pull request because I would like that all tests pass.

Possible to use clang block functions?

Hi.

This is more a question that an issue. I am trying to use an existing library (xpc) on OSX. This library are using clang code-blocks and one is defined like this:

typedef void (^xpc_handler_t)( xpc_object_t object);

The function I am trying to call needs to pass a code-block as one of the parameters:

 void xpc_connection_set_event_handler(xpc_connection_t connection, xpc_handler_t handler);

Is this possible, or do I need to start using JNI here?

BR,
Sten Roger

Allocating more than 2GiB of memory

The allocateDirect method of jnr.ffi.Memory takes an int size parameter for the size of the native memory. This limits the size to a maximum of 2GiB-1, that is, 2147483647 bytes.

But we wish to allocate more than 2GiB of memory (8GiB is not uncommon nowadays, and we have machines that have 16GiB of memory). Could you extend the API so that it accepts long size in addition to int size? As what I see, com.kenai.jffi.MemoryIO.allocateMemory already accepts long size parameter. So it shouldn't be difficult to make the change.

I understand that not all platforms are 64-bit. But the API can be design such that if the long size argument value is beyond the limit of the platform's memory, it just throws an out-of-memory error. That is, reject out-of-range values rather than out-of-range types.

Documentation for shipping native libraries in JARs

Is there any documentation for how to structure a JAR so that native libraries can get shipped as part of a distribution, and LibraryLoader will be able to load them? Ostensibly, LibraryLoader just takes filesystem paths.

Fix: ld script handling does not work on FreeBSD 10

There are two issues, one is that com.kenai.jffi.Library.getLastError() reports 'invalid file format' rather than 'invalid ELF header' on FreeBSD and under FreeBSD the first line of the linker script is a comment so find() is needed when calling the Matcher rather than lookingAt().

Resolution as follows..

andrews@fb10public:~/build/jnr-ffi/src/main/java/jnr/ffi/provider/jffi % diff NativeLibrary.java.original NativeLibrary.java
95c95,96
<     private static final Pattern BAD_ELF = Pattern.compile("(.*): invalid ELF header");

---
> //    private static final Pattern BAD_ELF = Pattern.compile("(.*): invalid ELF header");
>     private static final Pattern BAD_ELF = Pattern.compile("(.*): invalid (ELF header|file format)");
112c113,114
<                 if (sharedObject.lookingAt()) {

---
> //                if (sharedObject.lookingAt()) {
>                 if (sharedObject.find()) {

Performance question

Are there any performance benchmarks available? I was curious to understand how much overhead can be expected and how it compares to JNI (and other libraries).

IP/License issue found during Eclipse Legal review

JNR FFI 2.0.1 - Dual licensed ASL/LGPL. There appears to be 30 files that only contain the LGPL header. See Libtest and Test directories.

code/jnr-ffi-2.0.1/libtest/Benchmark.c
code/jnr-ffi-2.0.1/libtest/BufferTest.c
code/jnr-ffi-2.0.1/libtest/ClosureTest.c
code/jnr-ffi-2.0.1/libtest/GlobalVariable.c
code/jnr-ffi-2.0.1/libtest/LastErrorTest.c
code/jnr-ffi-2.0.1/libtest/NumberTest.c
code/jnr-ffi-2.0.1/libtest/PointerTest.c
code/jnr-ffi-2.0.1/libtest/ReferenceTest.c
code/jnr-ffi-2.0.1/libtest/StringTest.c
code/jnr-ffi-2.0.1/libtest/StructTest.c
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/ArrayTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/BufferTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/DelegateTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/EnumTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/LastErrorTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/LibraryTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/MemoryIOTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/NumberTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/PointerTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/StringTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/byref/AddressByReferenceTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/byref/ByteByReferenceTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/byref/IntByReferenceTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/byref/PointerByReferenceTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/struct/AsciiStringFieldTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/struct/EnumTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/struct/StructLayoutTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/struct/StructureTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/struct/UTF8StringFieldTest.java
code/jnr-ffi-2.0.1/src/test/java/jnr/ffi/struct/UnionTest.java
code/jnr-ffi-2.0.1/libtest/GlobalVariable.c                                                      

Benchmarks compared to direct-mapped JNA?

I looked around and couldn't find any performance benchmarks in comparison to direct-mapped JNA.

I did my own tests against direct-mapped JNA for WriteProcessMemory and found most of the time JNR is the same speed or 10% faster at best, and sometimes it's actually slower.

alighnment in structures

I now use a library that needs all structures to be packed without alignment. JNR now does not allow to do so. The only way to make it work properly is to set the offset when initializing inner fields.

I think, there should be a general option for the whole structure.

Struct.NumberField.getString() downcasts to int

If somebody does a String.valueOf(myStruct.foo)... where foo is a u_int64_t field... instead of String.valueOf(myStruct.foo.get()) which will be simple and safe, it looks to me like the code is doing an unintentional downcast to int.

I'm seeing the issue in Struct.NumberField:

    /**
     * Returns a string representation of this <code>Address</code>.
     *
     * @return a string representation of this <code>Address</code>.
     */
    @Override
    public java.lang.String toString() {
        return java.lang.Integer.toString(intValue(), 10);
    }

the intValue() call will be to Struct.IntegerAlias.intValue():

    @Override
    public int intValue() {
        return (int) get();
    }

which does the downcast. Perhaps call longValue() instead?

Passing pointer to native function for freeing

Hello!

It seems like i can't pass pointer allocated with MemoryManager in native code if it would be freed in native code.
What is right way to deal with native freeing, using MemoryIO or some public API is present?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.