public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/14446] GZIPInputStream: corrupted gzip file - crc mismatch
       [not found] <20040305092750.14446.gcj@stuellenberg.de>
@ 2004-09-22 16:02 ` sorabain at hotmail dot com
  2004-09-22 19:27 ` tromey at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: sorabain at hotmail dot com @ 2004-09-22 16:02 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From sorabain at hotmail dot com  2004-09-22 16:02 -------
We had the same problem, and i found the cause: 
java.util.zip.GZIPInputStream.java in libjava has a method called read4() that 
reads in 4 bytes and returns them as an int (java integers are signed). this 
is compared to CRC32.getValue(), which returns a long. The int is promoted to 
a long for the comparison, but if the most significant (sign) bit is set this 
will be a negative number, whereas the long with the same original low 32-bits 
is positive. The comparison fails.

To fix it i just changed the return type of read4() to be a long in-line with 
the type of CRC32.getValue()

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14446


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug java/14446] GZIPInputStream: corrupted gzip file - crc mismatch
       [not found] <20040305092750.14446.gcj@stuellenberg.de>
  2004-09-22 16:02 ` [Bug java/14446] GZIPInputStream: corrupted gzip file - crc mismatch sorabain at hotmail dot com
@ 2004-09-22 19:27 ` tromey at gcc dot gnu dot org
  2004-09-22 19:42 ` tromey at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2004-09-22 19:27 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2004-09-22 19:27 -------
I don't see an exception here, but I do see that
I don't get the right results if I compress and
then compress the test file.

I do see an exception with gcj 3.3.3.

Comparing output with the JDK it appears that
our GZIPOutputStream is ok.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14446


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug java/14446] GZIPInputStream: corrupted gzip file - crc mismatch
       [not found] <20040305092750.14446.gcj@stuellenberg.de>
  2004-09-22 16:02 ` [Bug java/14446] GZIPInputStream: corrupted gzip file - crc mismatch sorabain at hotmail dot com
  2004-09-22 19:27 ` tromey at gcc dot gnu dot org
@ 2004-09-22 19:42 ` tromey at gcc dot gnu dot org
  2004-09-22 20:16 ` cvs-commit at gcc dot gnu dot org
  2004-09-22 20:17 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2004-09-22 19:42 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2004-09-22 19:42 -------
I'm testing a fix for this.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14446


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug java/14446] GZIPInputStream: corrupted gzip file - crc mismatch
       [not found] <20040305092750.14446.gcj@stuellenberg.de>
                   ` (2 preceding siblings ...)
  2004-09-22 19:42 ` tromey at gcc dot gnu dot org
@ 2004-09-22 20:16 ` cvs-commit at gcc dot gnu dot org
  2004-09-22 20:17 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-09-22 20:16 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-09-22 20:16 -------
Subject: Bug 14446

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tromey@gcc.gnu.org	2004-09-22 20:16:17

Modified files:
	libjava        : ChangeLog 
	libjava/java/util/zip: GZIPInputStream.java 
	                       InflaterInputStream.java 

Log message:
	PR libgcj/14446:
	* java/util/zip/GZIPInputStream.java (read): Avoid sign extension
	when comparing CRCs.
	* java/util/zip/InflaterInputStream.java (onebytebuffer): New
	field.
	(read()): New overload.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3063&r2=1.3064
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/util/zip/GZIPInputStream.java.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/util/zip/InflaterInputStream.java.diff?cvsroot=gcc&r1=1.21&r2=1.22



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14446


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug java/14446] GZIPInputStream: corrupted gzip file - crc mismatch
       [not found] <20040305092750.14446.gcj@stuellenberg.de>
                   ` (3 preceding siblings ...)
  2004-09-22 20:16 ` cvs-commit at gcc dot gnu dot org
@ 2004-09-22 20:17 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2004-09-22 20:17 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2004-09-22 20:17 -------
I was able to reproduce the exception after all, after
fixing a problem with InflaterInputStream.

I've checked in a fix for both problems.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14446


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-09-22 20:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20040305092750.14446.gcj@stuellenberg.de>
2004-09-22 16:02 ` [Bug java/14446] GZIPInputStream: corrupted gzip file - crc mismatch sorabain at hotmail dot com
2004-09-22 19:27 ` tromey at gcc dot gnu dot org
2004-09-22 19:42 ` tromey at gcc dot gnu dot org
2004-09-22 20:16 ` cvs-commit at gcc dot gnu dot org
2004-09-22 20:17 ` tromey at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).