[ 
https://issues.apache.org/jira/browse/HDFS-7520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14299467#comment-14299467
 ] 

Chris Nauroth commented on HDFS-7520:
-------------------------------------

My best guess is that this happens when the build finds an OpenSSL, but it's 
too old for us to use.  According to the CMake logic, we'd skip compilation of 
OpensslCipher.c:

{code}
if (OPENSSL_LIBRARY AND OPENSSL_INCLUDE_DIR)
    GET_FILENAME_COMPONENT(HADOOP_OPENSSL_LIBRARY ${OPENSSL_LIBRARY} NAME)
    INCLUDE(CheckCSourceCompiles)
    SET(OLD_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
    SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
    CHECK_C_SOURCE_COMPILES("#include 
\"${OPENSSL_INCLUDE_DIR}/openssl/evp.h\"\nint main(int argc, char **argv) { 
return !EVP_aes_256_ctr; }" HAS_NEW_ENOUGH_OPENSSL)
    SET(CMAKE_REQUIRED_INCLUDES ${OLD_CMAKE_REQUIRED_INCLUDES})
    if(NOT HAS_NEW_ENOUGH_OPENSSL)
        MESSAGE("The OpenSSL library installed at ${OPENSSL_LIBRARY} is too 
old.  You need a version at least new enough to have EVP_aes_256_ctr.")
    else(NOT HAS_NEW_ENOUGH_OPENSSL)
        SET(USABLE_OPENSSL 1)
    endif(NOT HAS_NEW_ENOUGH_OPENSSL)
endif (OPENSSL_LIBRARY AND OPENSSL_INCLUDE_DIR)
if (USABLE_OPENSSL)
    SET(OPENSSL_SOURCE_FILES
        "${D}/crypto/OpensslCipher.c"
        "${D}/crypto/random/OpensslSecureRandom.c")
{code}

However, the check for {{buildSupportsOpenssl}} is driven by 
{{HADOOP_OPENSSL_LIBRARY}}, and I believe the CMake logic still left that 
defined:

{code}
JNIEXPORT jboolean JNICALL 
Java_org_apache_hadoop_util_NativeCodeLoader_buildSupportsOpenssl
  (JNIEnv *env, jclass clazz)
{
#ifdef HADOOP_OPENSSL_LIBRARY
  return JNI_TRUE;
#else
  return JNI_FALSE;
#endif
}
{code}

At the Java layer, this would cause it to think the build supports OpenSSL, 
therefore it calls {{initIDs}}, but they symbol isn't really in libhadoop.so.  
Therefore, it's an {{UnsatisfiedLinkError}} with message set to the signature 
of the Java native method.

Colin, if you know you saw this happening with a particular version of OpenSSL, 
would you please comment?  That would help Anu with a repro.  Thanks!

> checknative should display a nicer error message when openssl support is not 
> compiled in
> ----------------------------------------------------------------------------------------
>
>                 Key: HDFS-7520
>                 URL: https://issues.apache.org/jira/browse/HDFS-7520
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.6.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Anu Engineer
>
> checknative should display a nicer error message when openssl support is not 
> compiled in.  Currently, it displays this:
> {code}
> [cmccabe@keter hadoop]$ hadoop checknative
> 14/12/12 14:08:43 INFO bzip2.Bzip2Factory: Successfully loaded & initialized 
> native-bzip2 library system-native
> 14/12/12 14:08:43 INFO zlib.ZlibFactory: Successfully loaded & initialized 
> native-zlib library
> Native library checking:
> hadoop:  true /usr/lib/hadoop/lib/native/libhadoop.so.1.0.0
> zlib:    true /lib64/libz.so.1
> snappy:  true /usr/lib64/libsnappy.so.1
> lz4:     true revision:99
> bzip2:   true /lib64/libbz2.so.1
> openssl: false org.apache.hadoop.crypto.OpensslCipher.initIDs()V
> {code}
> Instead, we should display something like this, if openssl is not supported 
> by the current build:
> {code}
> openssl: false Hadoop was built without openssl support.
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to