Re: RFR: 8284336: CDS SignedJar.java test fails due to archived Reference object

2022-04-08 Thread Ioi Lam
On Fri, 8 Apr 2022 07:08:29 GMT, Alan Bateman  wrote:

>> During `java -Xshare:dump`, `ClassLoaders.bootLoader().resourceCache` is 
>> usually null. However, if a signed class is loaded, `resourceCache` will 
>> point to a `java.lang.ref.SoftReference`. Although rare (we have never seen 
>> this during our testing), it's possible for `resourceCache.discovered` to 
>> directly or indirectly point to another `Reference` which may contain an 
>> object that cannot be archived.
>> 
>> The fix is simple: reset the `resourceCache` field of all three archived 
>> ClassLoader objects (boot/platform/app).
>> 
>> I cannot reproduce the problem and I am unable to write a deterministic test 
>> case. However, the bug reporter has tested my preliminary patch and is no 
>> longer able to reproduce the failure.
>> 
>> Please see the bug report 
>> [JDK-8284336](https://bugs.openjdk.java.net/browse/JDK-8284336) for detailed 
>> analysis and traces.
>
> The updates to resetArchivedStates look okay.

Thanks @AlanBateman and @calvinccheung for the review!

-

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


Re: RFR: 8284336: CDS SignedJar.java test fails due to archived Reference object

2022-04-08 Thread Calvin Cheung
On Thu, 7 Apr 2022 22:44:19 GMT, Ioi Lam  wrote:

> During `java -Xshare:dump`, `ClassLoaders.bootLoader().resourceCache` is 
> usually null. However, if a signed class is loaded, `resourceCache` will 
> point to a `java.lang.ref.SoftReference`. Although rare (we have never seen 
> this during our testing), it's possible for `resourceCache.discovered` to 
> directly or indirectly point to another `Reference` which may contain an 
> object that cannot be archived.
> 
> The fix is simple: reset the `resourceCache` field of all three archived 
> ClassLoader objects (boot/platform/app).
> 
> I cannot reproduce the problem and I am unable to write a deterministic test 
> case. However, the bug reporter has tested my preliminary patch and is no 
> longer able to reproduce the failure.
> 
> Please see the bug report 
> [JDK-8284336](https://bugs.openjdk.java.net/browse/JDK-8284336) for detailed 
> analysis and traces.

LGTM.

-

Marked as reviewed by ccheung (Reviewer).

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


Re: RFR: 8284336: CDS SignedJar.java test fails due to archived Reference object

2022-04-08 Thread Alan Bateman
On Thu, 7 Apr 2022 22:44:19 GMT, Ioi Lam  wrote:

> During `java -Xshare:dump`, `ClassLoaders.bootLoader().resourceCache` is 
> usually null. However, if a signed class is loaded, `resourceCache` will 
> point to a `java.lang.ref.SoftReference`. Although rare (we have never seen 
> this during our testing), it's possible for `resourceCache.discovered` to 
> directly or indirectly point to another `Reference` which may contain an 
> object that cannot be archived.
> 
> The fix is simple: reset the `resourceCache` field of all three archived 
> ClassLoader objects (boot/platform/app).
> 
> I cannot reproduce the problem and I am unable to write a deterministic test 
> case. However, the bug reporter has tested my preliminary patch and is no 
> longer able to reproduce the failure.
> 
> Please see the bug report 
> [JDK-8284336](https://bugs.openjdk.java.net/browse/JDK-8284336) for detailed 
> analysis and traces.

The updates to resetArchivedStates look okay.

-

Marked as reviewed by alanb (Reviewer).

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


RFR: 8284336: CDS SignedJar.java test fails due to archived Reference object

2022-04-07 Thread Ioi Lam
During `java -Xshare:dump`, `ClassLoaders.bootLoader().resourceCache` is 
usually null. However, if a signed class is loaded, `resourceCache` will point 
to a `java.lang.ref.SoftReference`. Although rare (we have never seen this 
during our testing), it's possible for `resourceCache.discovered` to directly 
or indirectly point to another `Reference` which may contain an object that 
cannot be archived.

The fix is simple: reset the `resourceCache` field of all three archived 
ClassLoader objects (boot/platform/app).

I cannot reproduce the problem and I am unable to write a deterministic test 
case. However, the bug reporter has tested my preliminary patch and is no 
longer able to reproduce the failure.

Please see the bug report 
[JDK-8284336](https://bugs.openjdk.java.net/browse/JDK-8284336) for detailed 
analysis and traces.

-

Commit messages:
 - 8284336: CDS SignedJar.java test fails due to archived Reference object

Changes: https://git.openjdk.java.net/jdk/pull/8151/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8151&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8284336
  Stats: 28 lines in 5 files changed: 25 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8151.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8151/head:pull/8151

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