hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yu-Tang Lin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-14950) har file system throws ArrayIndexOutOfBoundsException
Date Thu, 19 Oct 2017 02:32:00 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-14950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16210487#comment-16210487
] 

Yu-Tang Lin commented on HADOOP-14950:
--------------------------------------

I just found out that in branch 3.0.0, the HarStatus except one index record except at least
5 parameters.

{code:java}
      this.name = decodeFileName(splits[0]);
      this.isDir = "dir".equals(splits[1]);
      // this is equal to "none" if its a directory
      this.partName = splits[2];
      this.startIndex = Long.parseLong(splits[3]);
      this.length = Long.parseLong(splits[4]);
{code}
I'll fix this issue by checking the number of parameters before we use them.

> har file system throws ArrayIndexOutOfBoundsException
> -----------------------------------------------------
>
>                 Key: HADOOP-14950
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14950
>             Project: Hadoop Common
>          Issue Type: Bug
>         Environment: CDH 5.9.2
>            Reporter: Wei-Chiu Chuang
>              Labels: newbie
>
> When listing a har file system file, it throws an AIOOBE like the following:
> {noformat}
> $ hdfs dfs -ls har:///abc.har
> -ls: Fatal internal error
> java.lang.ArrayIndexOutOfBoundsException: 1
> at org.apache.hadoop.fs.HarFileSystem$HarStatus.<init>(HarFileSystem.java:597)
> at org.apache.hadoop.fs.HarFileSystem$HarMetaData.parseMetaData(HarFileSystem.java:1201)
> at org.apache.hadoop.fs.HarFileSystem$HarMetaData.access$000(HarFileSystem.java:1098)
> at org.apache.hadoop.fs.HarFileSystem.initialize(HarFileSystem.java:166)
> at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2711)
> at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:382)
> at org.apache.hadoop.fs.Path.getFileSystem(Path.java:296)
> at org.apache.hadoop.fs.shell.PathData.expandAsGlob(PathData.java:325)
> at org.apache.hadoop.fs.shell.Command.expandArgument(Command.java:235)
> at org.apache.hadoop.fs.shell.Command.expandArguments(Command.java:218)
> at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:102)
> at org.apache.hadoop.fs.shell.Command.run(Command.java:165)
> at org.apache.hadoop.fs.FsShell.run(FsShell.java:315)
> at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
> at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
> at org.apache.hadoop.fs.FsShell.main(FsShell.java:372)
> {noformat}
> Checking the code, it looks like the _index file in the har is mal-formed. It expects
two string separately by a space in each line, and this AIOOBE is possible if the second string
does not exist.
> File this jira to improve the error handling of such case.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message