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.
|