United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7155499 Rebuilt soft referenced signing data in CacheEntry and CachedJarFile could become inconsistent
7155499 : Rebuilt soft referenced signing data in CacheEntry and CachedJarFile could become inconsistent

Details
Type:
Bug
Submit Date:
2012-03-21
Status:
Resolved
Updated Date:
2013-04-12
Project Name:
JDK
Resolved Date:
2012-03-28
Component:
deploy
OS:
generic
Sub-Component:
deployment_toolkit
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
8

Related Reports
Backport:
Backport:
Backport:

Sub Tasks

Description
This is a shadow CR for BugDB entry:
https://bug.oraclecorp.com/pls/bug/webbug_print.show?c_rptno=13588139

- Run with console showing, test program provided by customer hosted locally:
  http://javaweb/~ntnguyen/tests/soft-refs-test/Test.html
- The test will consume memory and cause error to force clearing of soft references.
- The test then try to load Foo.class which will cause security checking of the code source and will cause NPE in the console and the class would not load successfully.

                                    

Comments
EVALUATION

Fixed as described in webrev:
http://sa.us.oracle.com/mail-archive/7155499-deployment
Pushed to 8 with changeset:
http://closedjdk.us.oracle.com/jdk8/deploy/deploy/rev/e4082fd7fd30
                                     
2012-03-26
EVALUATION

The test program use reflection and subclassing to groom the softreferences in both classes CacheEntry and CachedJarFile for garbage collections at 2 references.  Deploy code do have mechanism to recover from situation where soft-reference being cleared.  However, the signing cache data were store in multiple pieces and the client calls might get one piece from old referenced before the recovery, then use that data as key to retrieve another data in the after-recovery map, hence failure to lookup.

The immediate and simple fix is to make sure that before we return the signing data from soft reference, check all other soft reference to see if they are still there.  If any are not, clear all together, so signing data would be rebuild together on first access since in being garbage-collected.
                                     
2012-03-21



Hardware and Software, Engineered to Work Together