bugfastjar - Bugs: bug #18264, fastjar creates corrupted jars

 
 

bug #18264: fastjar creates corrupted jars

Submitted by:  Daniel Bonniot <bonniot>
Submitted on:  Sun 12 Nov 2006 10:53:06 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 28 Jul 2008 11:35:49 PM UTC, comment #5:

closing the report

Matthias Klose <doko>
Project Member
Wed 08 Aug 2007 08:37:33 AM UTC, comment #4:

It's fixed with 0.95 (blame Gentoo for still having an old version).

Andrew John Hughes <gnu_andrew>
Mon 06 Aug 2007 12:00:06 PM UTC, comment #3:

Andrew, do you get the same problem with fastjar 0.95?

Dalibor Topic <robilad>
Project Administrator
Mon 06 Aug 2007 11:55:12 AM UTC, comment #2:

Archive: tools/tools.zip
testing: META-INF/ OK
testing: META-INF/MANIFEST.MF OK
testing: ./ OK
com/: mismatching "local" filename (org/),
continuing with "central" filename version
testing: com/ OK
com/sun/: mismatching "local" filename (org/objectweb/),
continuing with "central" filename version
testing: com/sun/ OK
file #6: bad zipfile offset (local header sig): 234
file #7: bad zipfile offset (local header sig): 278
file #8: bad zipfile offset (local header sig): 328
file #9: bad zipfile offset (local header sig): 2197
file #10: bad zipfile offset (local header sig): 3255

and so on...
I'm guessing it's related to updating the zip as the org stuff is added afterwards.

Andrew John Hughes <gnu_andrew>
Mon 06 Aug 2007 11:53:58 AM UTC, comment #1:

I'm seeing this with Classpath's tools.zip when building on ppc64.

/usr/bin/fastjar -V
0.92

Andrew John Hughes <gnu_andrew>
Sun 12 Nov 2006 10:53:06 AM UTC, original submission:

While building nice (http://nice.sf.net) with free tools, I noticed that fastjar cannot be used as it creates a corrupted jar, which then behaves badly in kaffe.

Unfortunately, I could not create a simple testcase to demonstrate this. Below are instructions to build nice using fastjar, that lead to a corrupted jar. If you cannot reproduce it, let me know and I'll try to find a simpler testcase.

On a debian system: apt-get source nice (or get the nice sources for nice 0.9.12). Edit debian/rules to replace the string debian/jar with fastjar. Then 'debuild'. This should take some time, and fail with:

An exception has occured in the compiler
Please fill-in a bug report at the following webpage:
http://sourceforge.net/tracker/?func=add&group_id=12788&atid=112788

Stack trace:
Exception in thread "main" java.lang.NullPointerException
at mlsub.typing.lowlevel.BitMatrix.setSize(BitMatrix.java:74)
...

You can see the jar file is actually corrupted:

unzip -t share/java/nice.jar | grep -v OK Archive: share/java/nice.jar
testing: nice/doc/fun$printMan.class
error: invalid compressed data to inflate

error: invalid compressed data to inflate
META-INF/: mismatching "local" filename (META-INF/MANIFEST.MF),
continuing with "central" filename version
META-INF/: mismatching "local" filename (META-INF/MANIFEST.MF),
continuing with "central" filename version
nice/: mismatching "local" filename (nice/tools/compiler/console/ConsoleOutput.class),
continuing with "central" filename version
nice/: mismatching "local" filename (nice/tools/compiler/console/ConsoleOutput.class),
continuing with "central" filename version
file #693: bad zipfile offset (local header sig): 214998
file #693: bad zipfile offset (local header sig): 214998
file #694: bad zipfile offset (local header sig): 230394
file #694: bad zipfile offset (local header sig): 230394
file #695: bad zipfile offset (local header sig): 240775
file #695: bad zipfile offset (local header sig): 240775
file #701: bad zipfile offset (local header sig): 142832
file #701: bad zipfile offset (local header sig): 142832
file #702: bad zipfile offset (local header sig): 149661
file #702: bad zipfile offset (local header sig): 149661
file #703: bad zipfile offset (local header sig): 256741
file #703: bad zipfile offset (local header sig): 256741
At least one error was detected in share/java/nice.jar.

When using debian/jar (a wrapper around zip) or Sun's jar command instead of fastjar, the build succeeds.

Appologies for this complex testcase. I actually have simpler instructions to reproduce just the 'mismatching "local" filename' part, let me know if you are intested (but I guess this is not the fatal problem).

PS: I could previously build nice with free tools, but I think at the time kaffe shipped a jar tool that worked for that purpose. Currently I work around this using a shell script wrapper around the zip command.

Daniel Bonniot <bonniot>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by doko (Posted a comment)
  • -unavailable- added by robilad (Posted a comment)
  • -unavailable- added by gnu_andrew (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 28 Jul 2008 11:35:49 PM UTCdokoOpen/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1