Bug 56641 - untar fails with Error detected parsing the headr
Summary: untar fails with Error detected parsing the headr
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.9.4
Hardware: PC All
: P2 normal (vote)
Target Milestone: 1.9.5
Assignee: Ant Notifications List
URL:
Keywords:
: 56656 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-06-18 20:39 UTC by George Stanchev
Modified: 2014-06-23 07:28 UTC (History)
1 user (show)



Attachments
binary artifact to reproduce the issue (183.01 KB, application/gzip)
2014-06-18 20:39 UTC, George Stanchev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description George Stanchev 2014-06-18 20:39:02 UTC
Created attachment 31727 [details]
binary artifact to reproduce the issue

Ran into this issue when trying to compile Tomcat 7.0_54 with Ant 1.9.4. It looks like a regression since 1.9.3 works fine. Look at the attached binary artifact. Place in a directory together and run ant-1.9.4 against it. Exception below [1]

Script:

<?xml version="1.0"?>
<project name="bugtest" default="extract_test" basedir=".">

  <target name="extract_test">
    <gunzip src="commons-logging-1.1.3-src.tar.gz" dest="${basedir}/commons-logging-src.tar"/>
    <untar src="${basedir}/commons-logging-src.tar"          dest="${basedir}/result/" />
  </target>
</project>

[1]
java.io.IOException: Error detected parsing the header
        at org.apache.tools.tar.TarInputStream.getNextEntry(TarInputStream.java:292)
        at org.apache.tools.ant.taskdefs.Untar.expandStream(Untar.java:165)
        at org.apache.tools.ant.taskdefs.Untar.expandFile(Untar.java:114)
        at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:132)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
        at org.apache.tools.ant.Main.runBuild(Main.java:851)
        at org.apache.tools.ant.Main.startAnt(Main.java:235)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.IllegalArgumentException: Invalid byte 32 at offset 7 in '       {NUL}' len=8
        at org.apache.tools.tar.TarUtils.parseOctal(TarUtils.java:134)
        at org.apache.tools.tar.TarUtils.parseOctalOrBinary(TarUtils.java:172)
        at org.apache.tools.tar.TarEntry.parseTarHeader(TarEntry.java:912)
        at org.apache.tools.tar.TarEntry.parseTarHeader(TarEntry.java:899)
        at org.apache.tools.tar.TarEntry.<init>(TarEntry.java:323)
        at org.apache.tools.tar.TarInputStream.getNextEntry(TarInputStream.java:290)
        ... 31 more
Comment 1 George Stanchev 2014-06-18 20:40:04 UTC
The binary gzip file attached needs to be named to "commons-logging-1.1.3-src.tar.gz"
Comment 2 Stefan Bodewig 2014-06-21 05:06:48 UTC
Yes, this is the same issue as https://issues.apache.org/jira/browse/COMPRESS-278 over at Commons Compress.  Merged the change with git commit 34fdc2f
Comment 3 Stefan Bodewig 2014-06-23 07:28:04 UTC
*** Bug 56656 has been marked as a duplicate of this bug. ***