commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sun, Dapeng" <dapeng....@intel.com>
Subject RE: [VOTE] Release CRYPTO 1.0.0 based on RC1
Date Fri, 29 Jul 2016 06:40:13 GMT
Thank Jörg for the testing.

>>I am building crypto with my compiler zoo on Gentoo Linux with OpenSSL 1.02h installed.
I don't have environment with Gentoo Linux, I just tested the library with OpenJDK on pure
Ubuntu OS: OpenJDK 7 on Ubuntu 14.04 and OpenJDK 8 on Ubuntu 16.04, All of them are passed:

Here are the steps for the pure Ubuntu OS
1. Install essential tools
apt-get update
apt-get install openjdk-7-jdk (on 14.04)/ apt-get install openjdk-8-jdk (on 16.04)
apt-get install make gcc g++ git

2.Install Openssl development tools
apt-get install libssl-dev

3.Set maven and JAVA_HOME

4.git clone the source code and run "mvn clean test"

Here are the version for the two environment
For Ubuntu 16.04
Java version is
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

Openssl version is
OpenSSL 1.0.2g-fips  1 Mar 2016

For Ubuntu 14.04
Java version is 
java version "1.7.0_101"
OpenJDK Runtime Environment (IcedTea 2.6.6) (7u101-2.6.6-0ubuntu0.14.04.1) OpenJDK 64-Bit
Server VM (build 24.95-b01, mixed mode)

Openssl version is
OpenSSL 1.0.1f 6 Jan 2014

Is your Openssl got from OS repo, if you compiled it yourself, do you add "shared" to you
config args before make?

>> However, the build first fails and then hangs in a unit test when building with IBM
JDK 7

About building CRYPTO on IBM JDK, I wonder if we should support it, because even for different
minor versions of IBM JDK 7, the JNI header files may be changed, the change would be cause
some weird failures at native. But the binary would be right, I have test the RC1 on latest
IBM JDK 7 from their official website, all the tests are okay.

About the build fails, I did't encounter it before, if it is the same environment with openjdk,
I think we can fix the Openssl shade issue first, if we encounter it again, we can run the
pure unit tests, I uploaded them to my personal repo: https://github.com/sundapeng/TCRYPTO.git,
could you help verify it in your environment?( The cached files in maven should be cleaned
before test, for example: rm ~/.m2/repository/org/apache/commons/commons-crypto/ -rf). 

About the test hang, if the hanging UT is the test for JavaSecureRandom, it should be an issue
about SecureRandom in JDK. https://bugs.openjdk.java.net/browse/JDK-6577564


Here is the IBM JDK in my environment:
java version "1.7.0"
Java(TM) SE Runtime Environment (build pxa6470_27sr3fp40-20160422_01(SR3 FP40))
IBM J9 VM (build 2.7, JRE 1.7.0 Linux amd64-64 Compressed References 20160406_298393 (JIT
enabled, AOT enabled)
J9VM - R27_Java727_SR3_20160406_0942_B298393
JIT  - tr.r13.java_20160328_114186
GC   - R27_Java727_SR3_20160406_0942_B298393_CMPRSS
J9CL - 20160406_298393)
JCL - 20160421_01 based on Oracle jdk7u101-b14


Regards
Dapeng

-----Original Message-----
From: Jörg Schaible [mailto:joerg.schaible@gmx.de] 
Sent: Friday, July 29, 2016 5:04 AM
To: dev@commons.apache.org
Subject: Re: [VOTE] Release CRYPTO 1.0.0 based on RC1

Hi,

I am building crypto with my compiler zoo on Gentoo Linux with OpenSSL 1.02h installed. Even
compiling with Java 9 works, tests fail only because of a missing jce.

Running the tests I get always those two warnings:

==================== %< ====================== Running org.apache.commons.crypto.NativeCodeLoaderTest
** WARN: Native (JNI) code was not loaded: java.lang.UnsatisfiedLinkError: 
/tmp/commons-crypto-9c688d6a-fc55-4a35-9d78-79cedd4ad842-libcommons-
crypto.so: /tmp/commons-crypto-9c688d6a-fc55-4a35-9d78-79cedd4ad842-
libcommons-crypto.so: failed to map segment from shared object Tests run: 5, Failures: 0,
Errors: 0, Skipped: 3, Time elapsed: 0.008 sec - in org.apache.commons.crypto.NativeCodeLoaderTest
Running org.apache.commons.crypto.jna.OpenSslNativeJnaTest
** WARN: JNA could not be enabled: 
/tmp/jna--1154654109/jna4836274946397519400.tmp: 
/tmp/jna--1154654109/jna4836274946397519400.tmp: failed to map segment from shared object
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in org.apache.commons.crypto.jna.OpenSslNativeJnaTest
==================== %< ======================

The build of the shared library produces additional warnings for OpenJDK 7 (and OpenJDK 8
produces same warning):
==================== %< ====================== [INFO] --- maven-antrun-plugin:1.8:run (make)
@ commons-crypto --- [INFO] Executing tasks

make:
     [exec] "/home/joehni/.gentoo/java-config-2/current-user-vm/bin/javah" - force -classpath
target/classes -o target/jni- classes/org/apache/commons/crypto/random/OpenSslCryptoRandomNative.h
org.apache.commons.crypto.random.OpenSslCryptoRandomNative
     [exec] gcc -Ilib/inc_linux -I/home/joehni/.gentoo/java- config-2/current-user-vm/include
-Ilib/inc_mac -O2 -fPIC -fvisibility=hidden
-m64 -Ilib/include -I/usr/include -
I"src/main/native/org/apache/commons/crypto/" -I"/home/joehni/.gentoo/java- config-2/current-user-vm/include/linux"
-I"target/jni- classes/org/apache/commons/crypto/cipher" -I"target/jni- classes/org/apache/commons/crypto/random"
-c src/main/native/org/apache/commons/crypto/random/OpenSslCryptoRandomNative.c
-o target/commons-crypto-1.0.0-Linux-x86_64/OpenSslCryptoRandomNative.o
     [exec] In file included from
src/main/native/org/apache/commons/crypto/random/OpenSslCryptoRandomNative.c:19:0:
     [exec]
src/main/native/org/apache/commons/crypto/random/org_apache_commons_crypto_random.h:24:0:

warning: "UNUSED" redefined
     [exec]  #define UNUSED(x) ((void)(x))
     [exec]  ^
     [exec] In file included from /home/joehni/.gentoo/java- config-2/current-user-vm/include/jni.h:45:0,
     [exec]                  from 
src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h:71,
     [exec]                  from 
src/main/native/org/apache/commons/crypto/random/org_apache_commons_crypto_random.h:22,
     [exec]                  from 
src/main/native/org/apache/commons/crypto/random/OpenSslCryptoRandomNative.c:19:
     [exec] /home/joehni/.gentoo/java-config-2/current-user-
vm/include/linux/jni_md.h:40:0: note: this is the location of the previous definition
     [exec]    #define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
     [exec]  ^
     [exec] "/home/joehni/.gentoo/java-config-2/current-user-vm/bin/javah" - force -classpath
target/classes -o target/jni- classes/org/apache/commons/crypto/cipher/OpenSslNative.h
org.apache.commons.crypto.cipher.OpenSslNative
     [exec] gcc -Ilib/inc_linux -I/home/joehni/.gentoo/java- config-2/current-user-vm/include
-Ilib/inc_mac -O2 -fPIC -fvisibility=hidden
-m64 -Ilib/include -I/usr/include -
I"src/main/native/org/apache/commons/crypto/" -I"/home/joehni/.gentoo/java- config-2/current-user-vm/include/linux"
-I"target/jni- classes/org/apache/commons/crypto/cipher" -I"target/jni- classes/org/apache/commons/crypto/random"
-c src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c -o target/commons-crypto-1.0.0-Linux-x86_64/OpenSslNative.o
     [exec] "/home/joehni/.gentoo/java-config-2/current-user-vm/bin/javah" - force -classpath
target/classes -o target/jni- classes/org/apache/commons/crypto/OpenSslInfoNative.h
org.apache.commons.crypto.OpenSslInfoNative
     [exec] gcc -Ilib/inc_linux -I/home/joehni/.gentoo/java- config-2/current-user-vm/include
-Ilib/inc_mac -O2 -fPIC -fvisibility=hidden
-m64 -Ilib/include -I/usr/include -
I"src/main/native/org/apache/commons/crypto/" -I"/home/joehni/.gentoo/java- config-2/current-user-vm/include/linux"
-I"target/jni- classes/org/apache/commons/crypto/cipher" -I"target/jni- classes/org/apache/commons/crypto/random"
-DVERSION='"1.0.0"' - DPROJECT_NAME='"Apache Commons Crypto"' -I"target/jni- classes/org/apache/commons/crypto"
-c src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c -o target/commons-crypto-1.0.0-Linux-x86_64/OpenSslInfoNative.o
     [exec] g++ -Ilib/inc_linux -I/home/joehni/.gentoo/java- config-2/current-user-vm/include
-Ilib/inc_mac -O2 -fPIC -fvisibility=hidden
-m64 -Ilib/include  -I/usr/include -I"/home/joehni/.gentoo/java- config-2/current-user-vm/include/linux"
-I"target/jni- classes/org/apache/commons/crypto/cipher" -I"target/jni- classes/org/apache/commons/crypto/random"
-o target/commons-crypto-1.0.0- Linux-x86_64/libcommons-crypto.so target/commons-crypto-1.0.0-Linux-
x86_64/OpenSslCryptoRandomNative.o target/commons-crypto-1.0.0-Linux-
x86_64/OpenSslNative.o target/commons-crypto-1.0.0-Linux-
x86_64/OpenSslInfoNative.o -shared -static-libgcc -static-libstdc++
     [exec] strip target/commons-crypto-1.0.0-Linux-x86_64/libcommons-
crypto.so
     [exec] cp target/commons-crypto-1.0.0-Linux-x86_64/libcommons-crypto.so
target/classes/org/apache/commons/crypto/native/Linux/x86_64/libcommons-
crypto.so
     [exec] cp target/commons-crypto-1.0.0-Linux-x86_64/libcommons-crypto.so
target/classes/org/apache/commons/crypto/native/Linux/x86_64/libcommons-
crypto.so
==================== %< ====================== $ java -version java version "1.7.0_101"
OpenJDK Runtime Environment (IcedTea 2.6.6) (Gentoo icedtea-7.2.6.6) OpenJDK 64-Bit Server
VM (build 24.95-b01, mixed mode) ==================== %< ======================


However, the build first fails and then hangs in a unit test when building with IBM JDK 7:
==================== %< ====================== [...]
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.commons.crypto.stream.CtrCryptoStreamTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.129 sec - in org.apache.commons.crypto.stream.CtrCryptoStreamTest
Running org.apache.commons.crypto.stream.CtrNoPaddingCipherStreamTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.05 sec - in org.apache.commons.crypto.stream.CtrNoPaddingCipherStreamTest
Running org.apache.commons.crypto.stream.PositionedCryptoInputStreamTest
Tests run: 2, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 0.068 sec <<< FAILURE!
- in org.apache.commons.crypto.stream.PositionedCryptoInputStreamTest
doTestJCE(org.apache.commons.crypto.stream.PositionedCryptoInputStreamTest)
Time elapsed: 0.057 sec  <<< ERROR!
java.nio.BufferUnderflowException
        at
org.apache.commons.crypto.stream.PositionedCryptoInputStreamTest.testPositionedReadLoop(PositionedCryptoInputStreamTest.java:226)
        at
org.apache.commons.crypto.stream.PositionedCryptoInputStreamTest.doPositionedReadTests(PositionedCryptoInputStreamTest.java:154)
        at
org.apache.commons.crypto.stream.PositionedCryptoInputStreamTest.testCipher(PositionedCryptoInputStreamTest.java:107)
        at
org.apache.commons.crypto.stream.PositionedCryptoInputStreamTest.doTestJCE(PositionedCryptoInputStreamTest.java:97)

Running org.apache.commons.crypto.stream.CbcNoPaddingCipherStreamTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.115 sec - in org.apache.commons.crypto.stream.CbcNoPaddingCipherStreamTest
Running org.apache.commons.crypto.stream.CbcPkcs5PaddingCipherStreamTest
^C
==================== %< ====================== $ java -version java version "1.7.0"
Java(TM) SE Runtime Environment (build pxa6470sr5-20130619_01(SR5)) IBM J9 VM (build 2.6,
JRE 1.7.0 Linux amd64-64 Compressed References
20130617_152572 (JIT enabled, AOT enabled) J9VM - R26_Java726_SR5_20130617_1436_B152572
JIT  - r11.b04_20130528_38954ifx1
GC   - R26_Java726_SR5_20130617_1436_B152572_CMPRSS
J9CL - 20130617_152572)
JCL - 20130616_01 based on Oracle 7u25-b12 ==================== %< ======================

Cheers,
Jörg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org

Mime
View raw message