hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wei-Chiu Chuang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-12677) DecompressorStream throws IndexOutOfBoundsException when calling skip(long)
Date Mon, 28 Dec 2015 15:57:49 GMT

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

Wei-Chiu Chuang updated HADOOP-12677:
    Attachment: HADOOP-12677.002.patch

Thank you for the comments and reviews!

I have posted patch #2 to address comment#2.

Regarding comment#1, even though DecompressorStream inherits InputStream, its skip() implementation
does not call InputStream.skip(). Instead, its internal implementation uses InputStream.read(),
which returns -1 if end of stream. If InputStream.end() returns -1, an EOFException is thrown.

> DecompressorStream throws IndexOutOfBoundsException when calling skip(long)
> ---------------------------------------------------------------------------
>                 Key: HADOOP-12677
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12677
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: io
>    Affects Versions: 2.4.0, 2.6.0, 3.0.0
>            Reporter: Laurent Goujon
>            Assignee: Wei-Chiu Chuang
>         Attachments: HADOOP-12677.001.patch, HADOOP-12677.002.patch
> DecompressorStream.skip(long) throws an IndexOutOfBoundException when using a long bigger
than Integer.MAX_VALUE
> This is because of this cast from long to int: https://github.com/apache/hadoop-common/blob/HADOOP-3628/src/core/org/apache/hadoop/io/compress/DecompressorStream.java#L125
> The fix is probably to do the cast after applying Math.min: in that case, it should not
be an issue since it should not be bigger than the buffer size (512)

This message was sent by Atlassian JIRA

View raw message