[
https://issues.apache.org/jira/browse/HADOOP-15088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16276846#comment-16276846
]
Steve Loughran commented on HADOOP-15088:
-----------------------------------------
Probably a common bug we've copied and pasted around. Why not add a new IOUtil
operation to do this, as other streams may do the same, especially the object
stores
> BufferedInputStream.skip function can return 0 when the file is corrupted,
> causing an infinite loop
> ---------------------------------------------------------------------------------------------------
>
> Key: HADOOP-15088
> URL: https://issues.apache.org/jira/browse/HADOOP-15088
> Project: Hadoop Common
> Issue Type: Bug
> Components: streaming
> Affects Versions: 2.5.0
> Reporter: John Doe
>
> When a file is corrupted, the skip function can return 0, causing an infinite
> loop.
> Here is the code:
> {code:java}
> private boolean slowReadUntilMatch(Pattern markPattern, boolean includePat,
> DataOutputBuffer outBufOrNull) throws
> IOException {
> ...
> for (long skiplen = endPos; skiplen > 0; ) {
> skiplen -= bin_.skip(skiplen);
> }
> ...
> }
> {code}
> Similar bugs are
> [Hadoop-8614|https://issues.apache.org/jira/browse/HADOOP-8614],
> [Yarn-2905|https://issues.apache.org/jira/browse/YARN-2905],
> [Yarn-163|https://issues.apache.org/jira/browse/YARN-163],
> [MAPREDUCE-6990|https://issues.apache.org/jira/browse/MAPREDUCE-6990]
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]