Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A1B54DCDE for ; Wed, 1 Aug 2012 21:42:04 +0000 (UTC) Received: (qmail 20435 invoked by uid 500); 1 Aug 2012 21:42:04 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 20405 invoked by uid 500); 1 Aug 2012 21:42:04 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 20397 invoked by uid 99); 1 Aug 2012 21:42:04 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2012 21:42:04 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 5FF1F14052C for ; Wed, 1 Aug 2012 21:42:04 +0000 (UTC) Date: Wed, 1 Aug 2012 21:42:04 +0000 (UTC) From: "Colin Patrick McCabe (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <1877297702.2394.1343857324398.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1392207568.69303.1340921384485.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (HDFS-3579) libhdfs: fix exception handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-3579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13426932#comment-13426932 ] Colin Patrick McCabe commented on HDFS-3579: -------------------------------------------- bq. I want us to deal with file == NULL The latest patch has this in hdfsClose: {code} //Sanity check if (!file || file->type == UNINITIALIZED) { errno = EBADF; return -1; } {code} So it should set errno = EBADF and return -1, just as before. > 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, HDFS-3579.006.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