Andy Isaacson created HADOOP-9001:
-------------------------------------

             Summary: libhadoop.so links against wrong OpenJDK libjvm.so
                 Key: HADOOP-9001
                 URL: https://issues.apache.org/jira/browse/HADOOP-9001
             Project: Hadoop Common
          Issue Type: Bug
            Reporter: Andy Isaacson
            Priority: Minor


After building against OpenJDK 6b24-1.11.4-3 (Debian amd64) using
bq. {{mvn -Pnative,dist clean package -Dmaven.javadoc.skip=true -DskipTests 
-Dtar}}
the resulting binaries {{libhadoop.so}} and {{libhdfs.so}} are linked to the 
wrong {{libjvm.so}}:
{code}
% LD_LIBRARY_PATH=/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server ldd 
hadoop-dist/target/hadoop-3.0.0-SNAPSHOT/lib/native/libhadoop.so.1.0.0
        linux-vdso.so.1 =>  (0x00007fff8c7ff000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f31df30e000)
        libjvm.so.0 => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f31def86000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f31df73d000)
{code}
Inspecting the build output it appears that {{JNIFlags.cmake}} decided, 
mysteriously, to link against 
{{/usr/lib/jvm/default-java/jre/lib/amd64/jamvm/libjvm.so}}, based on:
{code}
     [exec] JAVA_HOME=, 
JAVA_JVM_LIBRARY=/usr/lib/jvm/default-java/jre/lib/amd64/jamvm/libjvm.so
     [exec] JAVA_INCLUDE_PATH=/usr/lib/jvm/default-java/include, 
JAVA_INCLUDE_PATH2=/usr/lib/jvm/default-java/include/linux
     [exec] Located all JNI components successfully.
{code}

The "jamvm" is not mentioned anywhere in my environment or any symlinks in 
/usr, so apparently cmake iterated over the directories in 
{{/usr/lib/jvm/default-java/jre/lib/amd64}} to find it.  The following 
{{libjvm.so}} files are present on this machine:
{code}
-rw-r--r-- 1 root root  1050190 Sep  2 13:38 
/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/cacao/libjvm.so
-rw-r--r-- 1 root root  1554628 Sep  2 11:21 
/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/jamvm/libjvm.so
-rw-r--r-- 1 root root 12193850 Sep  2 13:38 
/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server/libjvm.so
{code}

Note the difference between {{libjvm.so}} and {{libjvm.so.0}}; the latter seems 
to come from the {{DT_SONAME}} in {{jamvm/libjvm.so}}, but that library seems 
to just be broken since there's no {{libjvm.so.0}} symlink anywhere on the 
filesystem.  I suspect *that* is a bug in OpenJDK but we should just avoid the 
issue by finding the right value for {{JAVA_JVM_LIBRARY}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to