This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ZipInputStream brokenness


Okay, I've complained about this before. Libgcj's java.util.zip is
broken. Can we replace it with Jazzlib (pure Java, no native code) at
least until somebody steps up and fixes the native code version? IMHO
correctness is more important than performance.

  - a

import java.util.zip.*;
import java.io.*;
import java.net.*;

public class test {

    public static void main(String[] s) throws Exception {
        ZipInputStream zis = new ZipInputStream(new URL("http://www.xwt.org/chess.xwar";).openStream());
        for(ZipEntry ze = zis.getNextEntry(); ze != null; ze = zis.getNextEntry()) {
            String name = ze.getName();
            System.out.println(name);
        }
    }

}

megacz@curry$CLASSPATH= /usr/local/gcc/bin/gcj --main=test test.java -o test && ./test
main.xwt
Exception in thread "main" java.util.zip.ZipException: bad/missing magic number at end of .zip entry
   at 0x4025ea70: java.lang.Throwable.Throwable(java.lang.String) (/usr/local/gcc/lib/libgcj.so.3)
   at 0x4024d0b6: java.lang.Exception.Exception(java.lang.String) (/usr/local/gcc/lib/libgcj.so.3)
   at 0x40268996: java.io.IOException.IOException(java.lang.String) (/usr/local/gcc/lib/libgcj.so.3)
   at 0x40345e86: java.util.zip.ZipException.ZipException(java.lang.String) (/usr/local/gcc/lib/libgcj.so.3)
   at 0x40347258: java.util.zip.ZipInputStream.closeEntry() (/usr/local/gcc/lib/libgcj.so.3)
   at 0x40346ca8: java.util.zip.ZipInputStream.getNextEntry() (/usr/local/gcc/lib/libgcj.so.3)
   at 0x08048d4d: test::main(JArray<java::lang::String*>*) (??:0)
   at 0x40233338: gnu.gcj.runtime.FirstThread.call_main() (/usr/local/gcc/lib/libgcj.so.3)
   at 0x402bcf68: gnu.gcj.runtime.FirstThread.run() (/usr/local/gcc/lib/libgcj.so.3)
   at 0x4023fefc: _Jv_ThreadRun(java.lang.Thread) (/usr/local/gcc/lib/libgcj.so.3)
   at 0x4022289c: _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/local/gcc/lib/libgcj.so.3)
   at 0x402229bd: JvRunMain (/usr/local/gcc/lib/libgcj.so.3)
   at 0x08048c54: main (??:0)
   at 0x405fc14f: __libc_start_main (/lib/libc.so.6)
   at 0x08048b31: _start (??:0)


-- 
Sick of HTML user interfaces?
www.xwt.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]