hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-3579) libhdfs: fix exception handling
Date Tue, 31 Jul 2012 20:22:34 GMT

     [ https://issues.apache.org/jira/browse/HDFS-3579?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Colin Patrick McCabe updated HDFS-3579:
---------------------------------------

          Description: 
libhdfs does not consistently handle exceptions.  Sometimes we don't free the memory associated
with them (memory leak).  Sometimes we invoke JNI functions that are not supposed to be invoked
when an exception is active.

Running a libhdfs test program with -Xcheck:jni shows the latter problem clearly:
{code}
WARNING in native method: JNI call made with exception pending
WARNING in native method: JNI call made with exception pending
WARNING in native method: JNI call made with exception pending
WARNING in native method: JNI call made with exception pending
WARNING in native method: JNI call made with exception pending
Exception in thread "main" java.io.IOException: ...
{code}

  was:
Running a libhdfs test program with -Xcheck:jni reveals some problems.

{code}
WARNING in native method: JNI call made with exception pending
WARNING in native method: JNI call made with exception pending
WARNING in native method: JNI call made with exception pending
WARNING in native method: JNI call made with exception pending
WARNING in native method: JNI call made with exception pending
Exception in thread "main" java.io.IOException: ...
{code}

The problem seems to be that in errnoFromException, we are calling classNameOfObject and some
other JNI methods prior to clearing the pending exception.  It should be simple enough to
avoid doing this.

             Priority: Major  (was: Minor)
     Target Version/s: 2.2.0-alpha
    Affects Version/s:     (was: 2.1.0-alpha)
                       2.0.1-alpha
        Fix Version/s:     (was: 2.1.0-alpha)
              Summary: libhdfs: fix exception handling  (was: libhdfs: fix "WARNING in native
method: JNI call made with exception pending" in errnoFromException)
    
> libhdfs: fix exception handling
> -------------------------------
>
>                 Key: HDFS-3579
>                 URL: https://issues.apache.org/jira/browse/HDFS-3579
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.1-alpha
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HDFS-3579.004.patch, HDFS-3579.005.patch
>
>
> libhdfs does not consistently handle exceptions.  Sometimes we don't free the memory
associated with them (memory leak).  Sometimes we invoke JNI functions that are not supposed
to be invoked when an exception is active.
> Running a libhdfs test program with -Xcheck:jni shows the latter problem clearly:
> {code}
> WARNING in native method: JNI call made with exception pending
> WARNING in native method: JNI call made with exception pending
> WARNING in native method: JNI call made with exception pending
> WARNING in native method: JNI call made with exception pending
> WARNING in native method: JNI call made with exception pending
> Exception in thread "main" java.io.IOException: ...
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message