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

Todd Lipcon commented on HDFS-14482:
------------------------------------

Seems the 'if (!state->env)' check just needs to be moved up above the call to 
initCachedClasses here

> Crash when using libhdfs with bad classpath
> -------------------------------------------
>
>                 Key: HDFS-14482
>                 URL: https://issues.apache.org/jira/browse/HDFS-14482
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Todd Lipcon
>            Assignee: Sahil Takiar
>            Priority: Major
>
> HDFS-14304 added a call to initCachedClasses in getJNIEnv after creating the 
> env but before checking whether it's null. In the case that getJNIEnv() fails 
> to create an env, it returns NULL, and then we crash when calling 
> initCachedClasses() on line 555
> {code}
> 551     state->env = getGlobalJNIEnv();
> 552     mutexUnlock(&jvmMutex);
> 553 
> 554     jthrowable jthr = NULL;
> 555     jthr = initCachedClasses(state->env);
> 556     if (jthr) {
> 557       printExceptionAndFree(state->env, jthr, PRINT_EXC_ALL,
> 558                             "initCachedClasses failed");
> 559       goto fail;
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to