Bug 36318 - CRC error in compressed sample.war file
Summary: CRC error in compressed sample.war file
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Webapps:Documentation (show other bugs)
Version: 5.5.13
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL: http://jakarta.apache.org/tomcat/tomc...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-23 11:32 UTC by Sebastian Stein
Modified: 2005-12-06 11:27 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Stein 2005-08-23 11:32:10 UTC
In the documentation on
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/appdev/sample/ a sample war file
is linked with the link:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/appdev/sample/sample.war

The file is not compressed correctly, it is impossible to uncompress it. For
example:

C:\Programme\Tomcat\webapps\sample>jar -xvf sample.war
     erstellt: META-INF/
   extrahiert: META-INF/MANIFEST.MF
java.util.zip.ZipException: invalid entry size (expected 975 but got 470 bytes)
        at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:368)
        at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
        at sun.tools.jar.Main.extractFile(Main.java:714)
        at sun.tools.jar.Main.extract(Main.java:677)
        at sun.tools.jar.Main.run(Main.java:189)
        at sun.tools.jar.Main.main(Main.java:903)
Comment 1 Mark Thomas 2005-09-21 21:32:16 UTC
I have tested the file and I have no problems expanding it. A check of the file
date shows it has not changed since this report so it looks like your download
was corrupted.
Comment 2 Sebastian Stein 2005-09-21 22:44:55 UTC
What is your MD5/SHA1 sum of the file? 
 
sstein@laptop-seb:~/test$ wget 
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/appdev/sample/sample.war 
sstein@laptop-seb:~/test$ md5sum sample.war   
7f34e9dfcd6719f4a4de65a891384179  sample.war  
sstein@laptop-seb:~/test$ sha1sum sample.war   
4091cc5852a79912f0e3dfea6747ab5cae5163b6  sample.war  
sstein@laptop-seb:~/test$ unzip sample.war   
Archive:  sample.war  
   creating: META-INF/  
 extracting: META-INF/MANIFEST.MF      
  inflating: hello.jsp                bad CRC 03f8858c  (should be 23d12d91)  
   creating: images/  
   creating: images/CVS/  
  inflating: images/CVS/Root          bad CRC 8d694f56  (should be 3f694f56)  
  inflating: images/CVS/Repository     
  inflating: images/CVS/Entries       bad CRC f30ae6d7  (should be ca2855dc)  
  inflating: images/tomcat.gif        bad CRC e6ee8c60  (should be 9706fba8)  
  inflating: index.html                
  error:  invalid compressed data to inflate  
   creating: WEB-INF/  
   creating: WEB-INF/src/  
   creating: WEB-INF/src/mypackage/  
  inflating: WEB-INF/src/mypackage/Hello.java   bad CRC 81241ac3  (should be  
739f5d43)  
  inflating: WEB-INF/web.xml           
  error:  invalid compressed data to inflate  
   creating: WEB-INF/classes/  
   creating: WEB-INF/classes/mypackage/  
  inflating: WEB-INF/classes/mypackage/Hello.class    
  error:  invalid compressed data to inflate  
Comment 3 Mark Thomas 2005-09-21 23:09:56 UTC
My bad, I didn't check far enough. The file is broken. I'll upload a fixed one
but it will take a couple of hours to replicate to the main Apache web server.
Comment 4 Mark Thomas 2005-09-21 23:17:56 UTC
For the record, the MD5 of the fixed file is 8c6d76407406763b2b69b5fda3cf8e6d
Comment 5 David Cafaro 2005-12-01 21:41:47 UTC
Just tried several times to download it and the corrupted file seems to be back.  

$ md5sum sample.war
7f34e9dfcd6719f4a4de65a891384179  sample.war
(several download tries, I'm wondering if this is now a different file than your
md5sum, hence compression errors)

Archive:  sample.war
   creating: META-INF/
 extracting: META-INF/MANIFEST.MF
  inflating: hello.jsp                bad CRC 03f8858c  (should be 23d12d91)
   creating: images/
   creating: images/CVS/
  inflating: images/CVS/Root          bad CRC 8d694f56  (should be 3f694f56)
  inflating: images/CVS/Repository
  inflating: images/CVS/Entries       bad CRC f30ae6d7  (should be ca2855dc)
  inflating: images/tomcat.gif        bad CRC e6ee8c60  (should be 9706fba8)
  inflating: index.html
  error:  invalid compressed data to inflate
   creating: WEB-INF/
   creating: WEB-INF/src/
   creating: WEB-INF/src/mypackage/
  inflating: WEB-INF/src/mypackage/Hello.java   bad CRC 81241ac3  (should be
739f5d43)
  inflating: WEB-INF/web.xml
  error:  invalid compressed data to inflate
   creating: WEB-INF/classes/
   creating: WEB-INF/classes/mypackage/
  inflating: WEB-INF/classes/mypackage/Hello.class
  error:  invalid compressed data to inflate

Getting the same older incorrect CRC errors.  Possibly a server replication
error somewhere?
Comment 6 Mark Thomas 2005-12-01 22:22:05 UTC
OK, fixed again. It will take a couple of hours to sync to the main web site.
Comment 7 David Cafaro 2005-12-02 16:18:50 UTC
Confirmed, looks good now, thanks.
Comment 8 Yoav Shapira 2005-12-06 15:13:29 UTC
I'm reopening this until we find a proper fix in the release process.  The file
is about to get corrupted again as I'm releasing 5.5.14.  I've investigated
some, but can't find the guilty task/target in the build process that is
corrupting this file.

Others have suggested that Ant's copy with filtering is to blame, but I cannot
find a copy with filtering task that applies to sample.war.  Same thing for the
fixcrlf tasks suggested to me by someone privately.

Help investigating and resolving this matter would be appreciated.
Comment 9 Yoav Shapira 2005-12-06 15:37:02 UTC
I've also tested that the same happens on minotaur.apache.org, not just my PC,
so it's not a Windows-specific thing.

And I've also tested that the package-tgz-docs task by itself is not the
culprit: if I place the right file in
{tomcat.dist}/webapps/tomcat-docs/appdev/sample/sample.war, the resulting
fulldocs.tar.gz is correct.  So the checksum change/corruption must be happening
during an earlier copy operation.
Comment 10 Keith Wannamaker 2005-12-06 20:27:44 UTC
fixcrlf was being applied.  Fixed in 5.5 head.