Integrated: 8284771: java/util/zip/CloseInflaterDeflaterTest.java failed with "AssertionError: Expected IOException to be thrown, but nothing was thrown"

2022-04-12 Thread Ravi Reddy
On Tue, 12 Apr 2022 20:09:31 GMT, Ravi Reddy  wrote:

> CloseInflaterDeflaterTest.java is failing intermittently(Observed once in 
> macOS and Linux), testInflaterOutputStream() is added as an extra test as 
> part of https://bugs.openjdk.java.net/browse/JDK-8278794. Disabling this test 
> for now before debugging any timing issues in Inflater.

This pull request has now been integrated.

Changeset: 7891085a
Author:    Ravi Reddy 
Committer: Lance Andersen 
URL:   
https://git.openjdk.java.net/jdk/commit/7891085a877b8a5715d095e0c0dbaaf5bc8f16bb
Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod

8284771: java/util/zip/CloseInflaterDeflaterTest.java failed with 
"AssertionError: Expected IOException to be thrown, but nothing was thrown"

Reviewed-by: lancea

-

PR: https://git.openjdk.java.net/jdk/pull/8213


RFR: 8284771: java/util/zip/CloseInflaterDeflaterTest.java failed with "AssertionError: Expected IOException to be thrown, but nothing was thrown"

2022-04-12 Thread Ravi Reddy
CloseInflaterDeflaterTest.java is failing intermittently(Observed once in macOS 
and Linux), testInflaterOutputStream() is added as an extra test as part of 
https://bugs.openjdk.java.net/browse/JDK-8278794. Disabling this test for now 
before debugging any timing issues in Inflater.

-

Commit messages:
 - 8284771: java/util/zip/CloseInflaterDeflaterTest.java failed with 
AssertionError: Expected IOException to be thrown, but nothing was thrown

Changes: https://git.openjdk.java.net/jdk/pull/8213/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=8213=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8284771
  Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8213.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8213/head:pull/8213

PR: https://git.openjdk.java.net/jdk/pull/8213


Integrated: 8278794: Infinite loop in DeflaterOutputStream.finish()

2022-03-18 Thread Ravi Reddy
On Sun, 13 Mar 2022 14:08:57 GMT, Ravi Reddy  wrote:

> Hi All,
> 
> This review request contains fix for infinite loop issue in 
> DeflaterOutputStream.finish() in an exception scenario.
> 1. The issue is with 'finished' flag not getting set to correct value when 
> there is an IOException in 
> DeflaterOutputStream.finish() which will result in Infinite loops for 
> next write operations on the same deflater.
> 2. Tighten the condition(to close deflater) in ZipOutputStream using an 
> already existing 'finish' flag in Deflater class.
> 3. Added Inflater exception scenarios also to the test case, renaming test 
> case to CloseInflaterDeflaterTest.java from CloseDeflaterTest.java
> 
> Thanks,
> Ravi

This pull request has now been integrated.

Changeset: ff0b0927
Author:Ravi Reddy 
Committer: Lance Andersen 
URL:   
https://git.openjdk.java.net/jdk/commit/ff0b0927a2df8b36f8fd6ed41bd4e20e71a5b653
Stats: 378 lines in 5 files changed: 224 ins; 147 del; 7 mod

8278794: Infinite loop in DeflaterOutputStream.finish()

Reviewed-by: coffeys, lancea

-

PR: https://git.openjdk.java.net/jdk/pull/7804


Re: RFR: 8278794: Infinite loop in DeflaterOutputStream.finish() [v3]

2022-03-17 Thread Ravi Reddy
> Hi All,
> 
> This review request contains fix for infinite loop issue in 
> DeflaterOutputStream.finish() in an exception scenario.
> 1. The issue is with 'finished' flag not getting set to correct value when 
> there is an IOException in 
> DeflaterOutputStream.finish() which will result in Infinite loops for 
> next write operations on the same deflater.
> 2. Tighten the condition(to close deflater) in ZipOutputStream using an 
> already existing 'finish' flag in Deflater class.
> 3. Added Inflater exception scenarios also to the test case, renaming test 
> case to CloseInflaterDeflaterTest.java from CloseDeflaterTest.java
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  Modified the format of comments across the test case and also done clean up 
of test case by using less data providers

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7804/files
  - new: https://git.openjdk.java.net/jdk/pull/7804/files/c50aa1bd..ac867083

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=7804=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=7804=01-02

  Stats: 94 lines in 1 file changed: 32 ins; 20 del; 42 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7804.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7804/head:pull/7804

PR: https://git.openjdk.java.net/jdk/pull/7804


Re: RFR: 8278794: Infinite loop in DeflaterOutputStream.finish() [v2]

2022-03-17 Thread Ravi Reddy
On Wed, 16 Mar 2022 16:34:37 GMT, Ravi Reddy  wrote:

>> Hi All,
>> 
>> This review request contains fix for infinite loop issue in 
>> DeflaterOutputStream.finish() in an exception scenario.
>> 1. The issue is with 'finished' flag not getting set to correct value when 
>> there is an IOException in 
>> DeflaterOutputStream.finish() which will result in Infinite loops for 
>> next write operations on the same deflater.
>> 2. Tighten the condition(to close deflater) in ZipOutputStream using an 
>> already existing 'finish' flag in Deflater class.
>> 3. Added Inflater exception scenarios also to the test case, renaming test 
>> case to CloseInflaterDeflaterTest.java from CloseDeflaterTest.java
>> 
>> Thanks,
>> Ravi
>
> Ravi Reddy has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Modified write(byte []b) to write(byte[] b) to maintain same signature 
> across the test case

> 

Thanks Lance for the review , In the latest commit , I have formatted the 
comments in the test case.

-

PR: https://git.openjdk.java.net/jdk/pull/7804


Re: RFR: 8278794: Infinite loop in DeflaterOutputStream.finish() [v2]

2022-03-16 Thread Ravi Reddy
On Wed, 16 Mar 2022 11:59:44 GMT, Sean Coffey  wrote:

>> Ravi Reddy has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Modified write(byte []b) to write(byte[] b) to maintain same signature 
>> across the test case
>
> test/jdk/java/util/zip/CloseInflaterDeflaterTest.java line 58:
> 
>> 56: }
>> 57: @Override
>> 58: public void write(byte b[]) throws IOException {}
> 
> Let's be consistant with style and use "byte[] b" 
> 
> Same with line 70

Thanks , I am now using "byte[] b" in both write() and read() methods.

-

PR: https://git.openjdk.java.net/jdk/pull/7804


Re: RFR: 8278794: Infinite loop in DeflaterOutputStream.finish() [v2]

2022-03-16 Thread Ravi Reddy
> Hi All,
> 
> This review request contains fix for infinite loop issue in 
> DeflaterOutputStream.finish() in an exception scenario.
> 1. The issue is with 'finished' flag not getting set to correct value when 
> there is an IOException in 
> DeflaterOutputStream.finish() which will result in Infinite loops for 
> next write operations on the same deflater.
> 2. Tighten the condition(to close deflater) in ZipOutputStream using an 
> already existing 'finish' flag in Deflater class.
> 3. Added Inflater exception scenarios also to the test case, renaming test 
> case to CloseInflaterDeflaterTest.java from CloseDeflaterTest.java
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  Modified write(byte []b) to write(byte[] b) to maintain same signature across 
the test case

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7804/files
  - new: https://git.openjdk.java.net/jdk/pull/7804/files/5700e194..c50aa1bd

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=7804=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=7804=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7804.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7804/head:pull/7804

PR: https://git.openjdk.java.net/jdk/pull/7804


RFR: 8278794: Infinite loop in DeflaterOutputStream.finish()

2022-03-13 Thread Ravi Reddy
Hi All,

This review request contains fix for infinite loop issue in 
DeflaterOutputStream.finish() in an exception scenario.
1. The issue is with 'finished' flag not getting set to correct value when 
there is an IOException in 
DeflaterOutputStream.finish() which will result in Infinite loops for next 
write operations on the same deflater.
2. Tighten the condition(to close deflater) in ZipOutputStream using an already 
existing 'finish' flag in Deflater class.
3. Added Inflater exception scenarios also to the test case, renaming test case 
to CloseInflaterDeflaterTest.java from CloseDeflaterTest.java

Thanks,
Ravi

-

Commit messages:
 - 8278794: Infinite loop in DeflaterOutputStream.finish()

Changes: https://git.openjdk.java.net/jdk/pull/7804/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=7804=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8278794
  Stats: 366 lines in 5 files changed: 212 ins; 147 del; 7 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7804.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7804/head:pull/7804

PR: https://git.openjdk.java.net/jdk/pull/7804


Integrated: 8281093: Violating Attribute-Value Normalization in the XML specification 1.0

2022-03-07 Thread Ravi Reddy
On Mon, 7 Mar 2022 17:07:20 GMT, Ravi Reddy  wrote:

> This fix is for violation of XML specification on Attribute-Value 
> normalization for external entities having character "\r". 
> 
> While normalizing entity with '\r', we should be checking if the entity is 
> external before changing the position and offset. "isExternal()" check is 
> missed in the new method :
> normalizeNewlines(short version, XMLString buffer, boolean append,boolean 
> storeWS, NameType nt).
> .

This pull request has now been integrated.

Changeset: 3996782c
Author:Ravi Reddy 
Committer: Joe Wang 
URL:   
https://git.openjdk.java.net/jdk/commit/3996782c5af7b0396d5133fab457c507758d9340
Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod

8281093: Violating Attribute-Value Normalization in the XML specification 1.0

Reviewed-by: joehw

-

PR: https://git.openjdk.java.net/jdk/pull/7731


RFR: 8281093: Violating Attribute-Value Normalization in the XML specification 1.0

2022-03-07 Thread Ravi Reddy
This fix is for violation of XML specification on Attribute-Value normalization 
for external entities having character "\r". 

While normalizing entity with '\r', we should be checking if the entity is 
external before changing the position and offset. "isExternal()" check is 
missed in the new method :
normalizeNewlines(short version, XMLString buffer, boolean append,boolean 
storeWS, NameType nt).
.

-

Commit messages:
 - 8281093: Violating Attribute-Value Normalization in the XML specification 1.0

Changes: https://git.openjdk.java.net/jdk/pull/7731/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=7731=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8281093
  Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7731.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7731/head:pull/7731

PR: https://git.openjdk.java.net/jdk/pull/7731


Withdrawn: 8281093: JDK 11.0.14 violates Attribute-Value Normalization in the XML specification 1.0

2022-02-24 Thread Ravi Reddy
On Fri, 25 Feb 2022 00:50:49 GMT, Ravi Reddy  wrote:

> While normalizing entity with '\r' , we should be checking if the entity is
> external before changing the position and offset.

This pull request has been closed without being integrated.

-

PR: https://git.openjdk.java.net/jdk/pull/7617


Re: RFR: 8281093: JDK 11.0.14 violates Attribute-Value Normalization in the XML specification 1.0 [v2]

2022-02-24 Thread Ravi Reddy
> While normalizing entity with '\r' , we should be checking if the entity is
> external before changing the position and offset.

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  Updated @LastModified to Feb 2022

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7617/files
  - new: https://git.openjdk.java.net/jdk/pull/7617/files/f7de9a23..89440bfb

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=7617=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=7617=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7617.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7617/head:pull/7617

PR: https://git.openjdk.java.net/jdk/pull/7617


Re: RFR: 8281093: JDK 11.0.14 violates Attribute-Value Normalization in the XML specification 1.0

2022-02-24 Thread Ravi Reddy
On Fri, 25 Feb 2022 00:50:49 GMT, Ravi Reddy  wrote:

> While normalizing entity with '\r' , we should be checking if the entity is
> external before changing the position and offset.

> Please also update the @lastmodified to "Feb 2022"

Thanks , I have updated the tag.

-

PR: https://git.openjdk.java.net/jdk/pull/7617


RFR: 8281093: JDK 11.0.14 violates Attribute-Value Normalization in the XML specification 1.0

2022-02-24 Thread Ravi Reddy
While normalizing entity with '\r' , we should be checking if the entity is
external before changing the position and offset.

-

Commit messages:
 - 8281093: JDK 11.0.14 violates Attribute-Value Normalization in the XML 
specification 1.0

Changes: https://git.openjdk.java.net/jdk/pull/7617/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=7617=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8281093
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7617.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7617/head:pull/7617

PR: https://git.openjdk.java.net/jdk/pull/7617


Integrated: 8193682: Infinite loop in ZipOutputStream.close()

2021-12-01 Thread Ravi Reddy
On Wed, 15 Sep 2021 07:40:35 GMT, Ravi Reddy  wrote:

> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

This pull request has now been integrated.

Changeset: 1e9ed54d
Author:Ravi Reddy 
Committer: Sean Coffey 
URL:   
https://git.openjdk.java.net/jdk/commit/1e9ed54d362b8c57be5fbbac2de5afbd0f05435f
Stats: 258 lines in 4 files changed: 191 ins; 29 del; 38 mod

8193682: Infinite loop in ZipOutputStream.close()

Reviewed-by: lancea, coffeys

-

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v14]

2021-11-30 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  Change in test case name from GZipLoopTest.java to CloseDeflaterTest , moved 
testcase to util/zip/

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/47697f96..6541de46

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=13
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=12-13

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v13]

2021-11-18 Thread Ravi Reddy
On Thu, 18 Nov 2021 19:09:18 GMT, Ravi Reddy  wrote:

>> Hi all,
>> 
>> Please review this fix for Infinite loop in ZipOutputStream.close().
>> The main issue here is when ever there is an exception during close 
>> operations on GZip we are not setting the deflator to a finished state which 
>> is leading to an infinite loop when we try writing on the same GZip 
>> instance( since we use while(!def.finished()) inside the write operation).
>> 
>> Thanks,
>> Ravi
>
> Ravi Reddy has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Added ZipException case to handle failure CopyZipFile.java - Only close the 
> deflater incase of IOException not in ZipException case scenario

Hi All, 

In the latest commit, I have resolved an issue in the case of ZipException in 
ZipOutputStream.closeEntry().
Now close the deflater in ZipOutputStream.closeEntry() only in case of an 
IOException and not with ZipException.

Mach5 is green : 
https://mach5.us.oracle.com/mdash/jobs?search=id:rreddy-jdk-2028-1708-26358737

Thanks,
Ravi

-

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v13]

2021-11-18 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  Added ZipException case to handle failure CopyZipFile.java - Only close the 
deflater incase of IOException not in ZipException case scenario

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/d9112977..47697f96

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=12
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=11-12

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v12]

2021-11-17 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  Change in description of test case

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/12a8371f..d9112977

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=11
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=10-11

  Stats: 4 lines in 2 files changed: 0 ins; 0 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v11]

2021-11-17 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  Added better try/catch/finally block at GZIPOutputStream.finish() , 
ZipOutputStream.closeEntry() and DeflaterOutputStream.close()

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/c66535fc..12a8371f

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=10
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=09-10

  Stats: 31 lines in 3 files changed: 9 ins; 12 del; 10 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v10]

2021-11-15 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request with a new target base due to a merge 
or a rebase. The incremental webrev excludes the unrelated changes brought in 
by the merge/rebase. The pull request contains 10 additional commits since the 
last revision:

 - Merge branch 'openjdk:master' into JDK-8193682
 - 8193682: Infinite loop in ZipOutputStream.close()
 - 8193682 : Infinite loop in ZipOutputStream.close()
 - 8193682 : Infinite loop in ZipOutputStream.close()
 - 8193682 : Infinite loop in ZipOutputStream.close()
 - 8193682 : Infinite loop in ZipOutputStream.close()
 - 8193682 : Infinite loop in ZipOutputStream.close()
 - 8193682 : Infinite loop in ZipOutputStream.close()
 - 8193682 : Infinite loop in ZipOutputStream.close()
 - 8193682: Infinite loop in ZipOutputStream.close()

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/c315ab21..c66535fc

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=09
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=08-09

  Stats: 937207 lines in 2953 files changed: 489188 ins; 435324 del; 12695 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v9]

2021-11-15 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  8193682: Infinite loop in ZipOutputStream.close()

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/b3d7fb74..c315ab21

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=08
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=07-08

  Stats: 30 lines in 2 files changed: 16 ins; 0 del; 14 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v8]

2021-11-10 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  8193682 : Infinite loop in ZipOutputStream.close()

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/bd0ccd7c..b3d7fb74

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=07
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=06-07

  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v7]

2021-11-02 Thread Ravi Reddy
On Tue, 2 Nov 2021 09:54:38 GMT, Ravi Reddy  wrote:

>> Hi all,
>> 
>> Please review this fix for Infinite loop in ZipOutputStream.close().
>> The main issue here is when ever there is an exception during close 
>> operations on GZip we are not setting the deflator to a finished state which 
>> is leading to an infinite loop when we try writing on the same GZip 
>> instance( since we use while(!def.finished()) inside the write operation).
>> 
>> Thanks,
>> Ravi
>
> Ravi Reddy has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8193682 : Infinite loop in ZipOutputStream.close()

Hello All .

Thanks for reviewing these changes. 
While testing ZipOutputStream:closeEntry(), I have found the same infinite loop 
issue is reproducible. Since closeEntry() does internally close the deflater , 
even though the documentation does not specify it, I think it should be fine to 
give the similar fix in closeEntry() of ZipOutputStream as well.  So there are 
total of three places where we should close deflater before throwing an 
exception.
1.GZipOutputStream:finish()
2.DeflaterOutputStream:close()
3.ZipOutputStream:closeEntry()

I have created a CSR explaining the changes: 
https://bugs.openjdk.java.net/browse/JDK-8276305

-

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v7]

2021-11-02 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  8193682 : Infinite loop in ZipOutputStream.close()

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/3154b516..bd0ccd7c

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=06
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=05-06

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v6]

2021-11-02 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  8193682 : Infinite loop in ZipOutputStream.close()

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/01d84462..3154b516

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=05
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=04-05

  Stats: 116 lines in 2 files changed: 59 ins; 20 del; 37 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v5]

2021-10-28 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  8193682 : Infinite loop in ZipOutputStream.close()

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/5f1922bf..01d84462

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=03-04

  Stats: 118 lines in 3 files changed: 11 ins; 58 del; 49 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v4]

2021-10-26 Thread Ravi Reddy
On Tue, 26 Oct 2021 06:30:39 GMT, Ravi Reddy  wrote:

>> Hi all,
>> 
>> Please review this fix for Infinite loop in ZipOutputStream.close().
>> The main issue here is when ever there is an exception during close 
>> operations on GZip we are not setting the deflator to a finished state which 
>> is leading to an infinite loop when we try writing on the same GZip 
>> instance( since we use while(!def.finished()) inside the write operation).
>> 
>> Thanks,
>> Ravi
>
> Ravi Reddy has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8193682 : Infinite loop in ZipOutputStream.close()

Hi ,

I have made the changes in fix , I think changing existing behavior in 
deflate() will need a spec change. 
With this fix , I'm closing deflater on exception scenarios in finish method of 
GZipOutputStream and close method of DeflaterOutputStream. Even though the 
document for finsih/close methods does not clearly specifies if the deflater 
will be closed or not , the current behaviour of these methods does close the 
deflater whenever finish/close are called.  \

Thanks,
Ravi

-

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v4]

2021-10-26 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  8193682 : Infinite loop in ZipOutputStream.close()

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/d18eb3c1..5f1922bf

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=02-03

  Stats: 26 lines in 2 files changed: 12 ins; 7 del; 7 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v3]

2021-10-12 Thread Ravi Reddy
On Tue, 12 Oct 2021 14:35:17 GMT, Sean Coffey  wrote:

>> src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java line 252:
>> 
>>> 250: int len = def.deflate(buf, 0, buf.length);
>>> 251: if (len > 0) {
>>> 252: try {
>> 
>> Shouldn't this use try with resources:
>> try (out) { ...
>
> the output stream is only closed if an exception is raised though ?

Yes , we are closing the stream only when exception occurs during write 
operation

-

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v3]

2021-10-12 Thread Ravi Reddy
On Tue, 12 Oct 2021 15:00:11 GMT, Ravi Reddy  wrote:

>> the output stream is only closed if an exception is raised though ?
>
> Yes , we are closing the stream only when exception occurs during write 
> operation

Yes, we are closing the stream only when an exception occurs during a write 
operation

-

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v3]

2021-10-12 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  8193682 : Infinite loop in ZipOutputStream.close()

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/f6a678ed..d18eb3c1

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=01-02

  Stats: 46 lines in 1 file changed: 44 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v2]

2021-10-11 Thread Ravi Reddy
On Mon, 11 Oct 2021 13:42:35 GMT, Ravi Reddy  wrote:

>> Hi all,
>> 
>> Please review this fix for Infinite loop in ZipOutputStream.close().
>> The main issue here is when ever there is an exception during close 
>> operations on GZip we are not setting the deflator to a finished state which 
>> is leading to an infinite loop when we try writing on the same GZip 
>> instance( since we use while(!def.finished()) inside the write operation).
>> 
>> Thanks,
>> Ravi
>
> Ravi Reddy has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8193682 : Infinite loop in ZipOutputStream.close()

I have updated the review with the new fix.

Instead of throwing an exception in close() method , Now when we get an 
exception during write inside deflate() , we will close the stream and throw 
the exception.

Updated the test case in TestNG format.

-

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close() [v2]

2021-10-11 Thread Ravi Reddy
> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Ravi Reddy has updated the pull request incrementally with one additional 
commit since the last revision:

  8193682 : Infinite loop in ZipOutputStream.close()

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5522/files
  - new: https://git.openjdk.java.net/jdk/pull/5522/files/5072b6c1..f6a678ed

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=5522=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5522=00-01

  Stats: 96 lines in 2 files changed: 48 ins; 28 del; 20 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close()

2021-09-29 Thread Ravi Reddy
On Fri, 17 Sep 2021 12:45:29 GMT, Alan Bateman  wrote:

>> Hi all,
>> 
>> Please review this fix for Infinite loop in ZipOutputStream.close().
>> The main issue here is when ever there is an exception during close 
>> operations on GZip we are not setting the deflator to a finished state which 
>> is leading to an infinite loop when we try writing on the same GZip 
>> instance( since we use while(!def.finished()) inside the write operation).
>> 
>> Thanks,
>> Ravi
>
> src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java line 249:
> 
>> 247:  out.close();
>> 248:  closed = true;
>> 249:  throw ioe;
> 
> Have you tried using try-finally instead?

Hi Alan , Sorry for the delayed response , I was out of office for 3 weeks. I 
haven't tried with try-finally , I'm reworking on the fix as , if we directly 
use zip.finish() , we are facing the same issue. I will update here once the 
fix is ready.Thanks.

-

PR: https://git.openjdk.java.net/jdk/pull/5522


Re: RFR: 8193682: Infinite loop in ZipOutputStream.close()

2021-09-15 Thread Ravi Reddy
On Wed, 15 Sep 2021 07:40:35 GMT, Ravi Reddy  wrote:

> Hi all,
> 
> Please review this fix for Infinite loop in ZipOutputStream.close().
> The main issue here is when ever there is an exception during close 
> operations on GZip we are not setting the deflator to a finished state which 
> is leading to an infinite loop when we try writing on the same GZip instance( 
> since we use while(!def.finished()) inside the write operation).
> 
> Thanks,
> Ravi

Reviewers: @LanceAndersen @coffeys

-

PR: https://git.openjdk.java.net/jdk/pull/5522


RFR: 8193682: Infinite loop in ZipOutputStream.close()

2021-09-15 Thread Ravi Reddy
Hi all,

Please review this fix for Infinite loop in ZipOutputStream.close().
The main issue here is when ever there is an exception during close operations 
on GZip we are not setting the deflator to a finished state which is leading to 
an infinite loop when we try writing on the same GZip instance( since we use 
while(!def.finished()) inside the write operation).

Thanks,
Ravi

-

Commit messages:
 - 8193682: Infinite loop in ZipOutputStream.close()

Changes: https://git.openjdk.java.net/jdk/pull/5522/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=5522=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8193682
  Stats: 92 lines in 2 files changed: 87 ins; 0 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5522/head:pull/5522

PR: https://git.openjdk.java.net/jdk/pull/5522