Re: LOC header signature bad [BUG in ZipInputStream]

2000-02-07 Thread Hiroshi Oota

Hi, all.

The class ZipInputStream does not read `central direcroty file header'
in zipfile. Some zipfile contains a few extra bytes before `local file
header`. This information was written in `central directory file
header'. These extra bytes would abort jar command.

I enclosed small test file. you can examine that extra bytes, using
`UnZip 5.40 of 28 November 1998, by Info-ZIP'.
try `unzip -Z -v test.zip'.

Sorry, currentry I have no time to fix this bug.

==
Central directory entry #3:
---

  There are an extra 16 bytes preceding this file.
  ^^^  <==

  at/dms/util/Utils.class

  offset of local header from start of archive: 19818 (4D6Ah) bytes
  file system or operating system of origin:MS-DOS, OS/2 or NT FAT
  version of encoding software: 2.0
--

HIROSHI OOTA
[EMAIL PROTECTED]

 test.zip


Re: BUG in ZipInputStream

2000-01-27 Thread Hiroshi Oota


From: Mo DeJong <[EMAIL PROTECTED]>
Subject: Re: BUG in ZipInputStream
Date: Thu, 27 Jan 2000 19:38:01 -0800 (PST)
;; If you created the zip file with Kaffe's jar tool, then ZipOutputStream
;; is to blame. Try creating your zip file with zip and then uncompress it
;; with Kaffe's jar tool. If it is still broken, then it must be a problem
;; other than the one I was talking about.
I tried that, It works fine.

Thank you very much.
--

HIROSHI OOTA
[EMAIL PROTECTED]



Re: BUG in ZipInputStream

2000-01-27 Thread Mo DeJong


If you created the zip file with Kaffe's jar tool, then ZipOutputStream
is to blame. Try creating your zip file with zip and then uncompress it
with Kaffe's jar tool. If it is still broken, then it must be a problem
other than the one I was talking about.

Mo Dejong
Red Hat Inc.

On Fri, 28 Jan 2000, Hiroshi Oota wrote:

> 
> ;; This bug has been around in one form or another for many many months.
> ;; The problem seems to be related to the header written before the actual
> ;; data is placed in the zip file. I have been meaning to get around
> ;; to fixing it but I just have not had the time to write up all the test
> ;; cases needed to fix it once and for all. If you want to jump in and
> ;; take a whack at it, the problem is in the class ZipOutputStream.java!
> Do you mean the zip file incorrect?
> 
> I think the zip file(kjc.jar) is correct, because `unzip kjc.jar' reports no
> errors. ZipInputStream should handle it.
> --
> 
>   HIROSHI OOTA
>   [EMAIL PROTECTED]
> 



Re: BUG in ZipInputStream

2000-01-27 Thread Hiroshi Oota


;; This bug has been around in one form or another for many many months.
;; The problem seems to be related to the header written before the actual
;; data is placed in the zip file. I have been meaning to get around
;; to fixing it but I just have not had the time to write up all the test
;; cases needed to fix it once and for all. If you want to jump in and
;; take a whack at it, the problem is in the class ZipOutputStream.java!
Do you mean the zip file incorrect?

I think the zip file(kjc.jar) is correct, because `unzip kjc.jar' reports no
errors. ZipInputStream should handle it.
--

HIROSHI OOTA
[EMAIL PROTECTED]



Re: BUG in ZipInputStream

2000-01-27 Thread Mo DeJong


This bug has been around in one form or another for many many months.
The problem seems to be related to the header written before the actual
data is placed in the zip file. I have been meaning to get around
to fixing it but I just have not had the time to write up all the test
cases needed to fix it once and for all. If you want to jump in and
take a whack at it, the problem is in the class ZipOutputStream.java!

Mo Dejong
Red Hat Inc.

On Fri, 28 Jan 2000, Hiroshi Oota wrote:

> 
> ;; > I built Kaffe from CVS tree today under FreeBSD-3.4-RELEASE.
> ;; 
> ;; > The ChangeLog says
> ;; 
> ;; >Tue Dec 28 10:14:16 CET 1999  Edouard G. Parmelan  <[EMAIL PROTECTED]>
> ;; 
> ;; Do you mean this is the latest entry in the ChangeLog?  It's more than
> ;; a month old, and there have been dozens of changes after that.
> No, I picked up related entry from ChangeLog.
> I think the ZipInputStream still has a bug.
> try, `jar tvf /usr/local/share/kaffe/kjc.jar'. It will shows
> 
> 1: 0 Mon Dec 13 14:11:46 GMT+9:00 1999 META-INF/MANIFEST.MF
> 2: 0 Mon Dec 13 13:32:24 GMT+9:00 1999 at/dms/util/
> 3: 0 Mon Dec 13 13:32:24 GMT+9:00 1999 at/dms/util/ArrayLocator.class
> 4: 0 Mon Dec 13 13:32:24 GMT+9:00 1999 at/dms/util/Utils.class
> 5:java.io.IOException: LOC header signature bad: 5007
> 6:at java.lang.Throwable.(Throwable.java:38)
> 7:at java.lang.Exception.(Exception.java:24)
> 8:at java.io.IOException.(IOException.java:25)
> 9:at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:55)
> 10:   at kaffe.tools.jar.Jar.listFilesInJar(Jar.java:601)
> 11:   at kaffe.tools.jar.Jar.processJar(Jar.java:402)
> 12:   at kaffe.tools.jar.Jar.start(Jar.java:60)
> 13:   at kaffe.tools.jar.Jar.main(Jar.java:39)
> 
> the lines 1-4 says that the kaffe environment which I use is
> includes the following changes.
> 
> Sun Jan  9 02:50:29 CET 2000  Edouard G. Parmelan  <[EMAIL PROTECTED]>
> 
>   * libraries/javalib/java/util/zip/ZipEntry.java: add new package method
>   setDosTime().
>   * libraries/javalib/java/util/zip/ZipInputStream.java (getNextEntry):
>   Use setDosTime() to set time entry.
> --
> 
>   HIROSHI OOTA
>   [EMAIL PROTECTED]
> 



Re: BUG in ZipInputStream

2000-01-27 Thread Hiroshi Oota


;; > I built Kaffe from CVS tree today under FreeBSD-3.4-RELEASE.
;; 
;; > The ChangeLog says
;; 
;; >Tue Dec 28 10:14:16 CET 1999  Edouard G. Parmelan  <[EMAIL PROTECTED]>
;; 
;; Do you mean this is the latest entry in the ChangeLog?  It's more than
;; a month old, and there have been dozens of changes after that.
No, I picked up related entry from ChangeLog.
I think the ZipInputStream still has a bug.
try, `jar tvf /usr/local/share/kaffe/kjc.jar'. It will shows

1: 0 Mon Dec 13 14:11:46 GMT+9:00 1999 META-INF/MANIFEST.MF
2: 0 Mon Dec 13 13:32:24 GMT+9:00 1999 at/dms/util/
3: 0 Mon Dec 13 13:32:24 GMT+9:00 1999 at/dms/util/ArrayLocator.class
4: 0 Mon Dec 13 13:32:24 GMT+9:00 1999 at/dms/util/Utils.class
5:java.io.IOException: LOC header signature bad: 5007
6:  at java.lang.Throwable.(Throwable.java:38)
7:  at java.lang.Exception.(Exception.java:24)
8:  at java.io.IOException.(IOException.java:25)
9:  at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:55)
10: at kaffe.tools.jar.Jar.listFilesInJar(Jar.java:601)
11: at kaffe.tools.jar.Jar.processJar(Jar.java:402)
12: at kaffe.tools.jar.Jar.start(Jar.java:60)
13: at kaffe.tools.jar.Jar.main(Jar.java:39)

the lines 1-4 says that the kaffe environment which I use is
includes the following changes.

Sun Jan  9 02:50:29 CET 2000  Edouard G. Parmelan  <[EMAIL PROTECTED]>

* libraries/javalib/java/util/zip/ZipEntry.java: add new package method
setDosTime().
* libraries/javalib/java/util/zip/ZipInputStream.java (getNextEntry):
Use setDosTime() to set time entry.
--

HIROSHI OOTA
[EMAIL PROTECTED]



Re: BUG in ZipInputStream

2000-01-27 Thread Alexandre Oliva


On Jan 27, 2000, Hiroshi Oota <[EMAIL PROTECTED]> wrote:

> I built Kaffe from CVS tree today under FreeBSD-3.4-RELEASE.

> The ChangeLog says

>Tue Dec 28 10:14:16 CET 1999  Edouard G. Parmelan  <[EMAIL PROTECTED]>

Do you mean this is the latest entry in the ChangeLog?  It's more than
a month old, and there have been dozens of changes after that.

-- 
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them



BUG in ZipInputStream

2000-01-26 Thread Hiroshi Oota


I built Kaffe from CVS tree today under FreeBSD-3.4-RELEASE.
The ChangeLog says

   Tue Dec 28 10:14:16 CET 1999  Edouard G. Parmelan  <[EMAIL PROTECTED]>

   * libraries/javalib/java/util/zip/ZipInputStream.java: Skip remaining
   compressed data closeEntry(), this close PR#568, PR#589 and PR#590.
   * libraries/clib/zip/Deflater.c libraries/clib/zip/Inflater.c: Fix
   SignalError() message test.  Create kaffe_zalloc() and kaffe_zfree()
   for inflateInit2().  Use Z_SYNC_FLUSH for inflate().
   * libraries/javalib/kjc.jar: update to version 1.4B
   * libraries/javalib/Klasses.jar: regen with kjc-1.4B

But, It still fails on some archive.

% jar tvf  /usr/local/share/kaffe/kjc.jar
 0 Mon Dec 13 14:11:46 GMT+9:00 1999 META-INF/MANIFEST.MF
 0 Mon Dec 13 13:32:24 GMT+9:00 1999 at/dms/util/
 0 Mon Dec 13 13:32:24 GMT+9:00 1999 at/dms/util/ArrayLocator.class
 0 Mon Dec 13 13:32:24 GMT+9:00 1999 at/dms/util/Utils.class
java.io.IOException: LOC header signature bad: 5007
at java.lang.Throwable.(Throwable.java:38)
at java.lang.Exception.(Exception.java:24)
at java.io.IOException.(IOException.java:25)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:55)
at kaffe.tools.jar.Jar.listFilesInJar(Jar.java:601)
at kaffe.tools.jar.Jar.processJar(Jar.java:402)
at kaffe.tools.jar.Jar.start(Jar.java:60)
at kaffe.tools.jar.Jar.main(Jar.java:39)
thanx,
--

HIROSHI OOTA
[EMAIL PROTECTED]