Return-Path: Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: (qmail 19021 invoked from network); 7 Aug 2009 04:23:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Aug 2009 04:23:30 -0000 Received: (qmail 95384 invoked by uid 500); 7 Aug 2009 04:23:36 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 95356 invoked by uid 500); 7 Aug 2009 04:23:36 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 95317 invoked by uid 99); 7 Aug 2009 04:23:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2009 04:23:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2009 04:23:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C40C1234C044 for ; Thu, 6 Aug 2009 21:23:14 -0700 (PDT) Message-ID: <542448327.1249618994788.JavaMail.jira@brutus> Date: Thu, 6 Aug 2009 21:23:14 -0700 (PDT) From: "Hong Tang (JIRA)" To: common-issues@hadoop.apache.org Subject: [jira] Commented: (HADOOP-6177) FSInputChecker.getPos() would return position greater than the file size In-Reply-To: <1554871263.1249618274995.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-6177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740395#action_12740395 ] Hong Tang commented on HADOOP-6177: ----------------------------------- The root cause is because readChecksumChunk returns -1 when the fs input stream reaches the end of the file. And in fill(), this leads to count == -1 (FSInputChecker.java:176). The fix is rather simple, adding the following line at the end of fill(): {noformat} count = readChecksumChunk(buf, 0, buf.length); + if (count < 0) count = 0; {noformat} > FSInputChecker.getPos() would return position greater than the file size > ------------------------------------------------------------------------ > > Key: HADOOP-6177 > URL: https://issues.apache.org/jira/browse/HADOOP-6177 > Project: Hadoop Common > Issue Type: Bug > Reporter: Hong Tang > Assignee: Hong Tang > Attachments: hadoop-6177-testcase.patch > > > When using a small buffer (< 512 bytes) to read through the whole file, the final file position is 1+ the file size. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.