JDK-4681727 : java.util.ResourceBundle: Intermittent GC-related failures
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.4.1
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2002-05-08
  • Updated: 2002-05-17
  • Resolved: 2002-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.1 betaFixed
Related Reports
Relates :  
Description
The nightly TL regression runs have been failing intermittently, and at
different points, over the last week or so.  When the failure occurs the
JavaTest harness starts throwing the following exception (more or less) for
every test that it tries to run:

    java.util.MissingResourceException: Can't find bundle for base name sun.text.resources.LocaleElements, locale en_US
	    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:825)
	    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:794)
	    at java.util.ResourceBundle.getBundle(ResourceBundle.java:565)
	    at sun.text.resources.LocaleData$1.run(LocaleData.java:114)
	    at java.security.AccessController.doPrivileged(Native Method)
	    at sun.text.resources.LocaleData.getBundle(LocaleData.java:112)
	    at sun.text.resources.LocaleData.getLocaleElements(LocaleData.java:100)
	    at java.text.DateFormatSymbols.cacheLookup(DateFormatSymbols.java:425)
	    at java.text.DateFormatSymbols.initializeData(DateFormatSymbols.java:468)
	    at java.text.DateFormatSymbols.<init>(DateFormatSymbols.java:103)
	    at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:442)
	    at java.util.Date.toString(Date.java:981)
	    at javasoft.sqe.javatest.TestResult.writeResults(TestResult.java:1404)
	    at javasoft.sqe.javatest.Script.run(Script.java:244)
	    at javasoft.sqe.javatest.TestRunner$Worker.runTest(TestRunner.java:240)
	    at javasoft.sqe.javatest.TestRunner$Worker.run(TestRunner.java:221)

The first exception is thrown immediately after the first full GC.

-- ###@###.### 2002/5/8

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: hopper-beta FIXED IN: hopper-beta INTEGRATED IN: hopper-beta
14-06-2004

EVALUATION This is a regression bug due to the 4405807 fix. ###@###.### 2002-05-09 The 4405807 fix changed the cache control of ResourceBundle so that a class loader is contained in a WeakReference and cleared correctly. The bug is in the new code in handling a Reference as described in Suggested Fix. This bug sometimes crashes jtreg as in Description at around 10% probability on Linux. Never reproduced on Solaris mechines (Ultra60/450MHz and 2-cpu Ultra80/450MHz). ###@###.### 2002-05-10 We decided to back out the 4405807 fix. ###@###.### 2002-05-14
10-05-2002

SUGGESTED FIX ResourceBundle.java has two GC-related race conditions in its use of soft references. The private findBundle method incorrectly assumes that if a soft reference is present in the bundle cache then the reference has not been cleared by the GC, when in fact the GC can clear a soft reference at any time. *** /tmp/geta31399 Wed May 8 11:11:49 2002 --- ResourceBundle.java Wed May 8 10:44:51 2002 *************** *** 884,891 **** cacheKey.setKeyValues(loader, bundleName, defaultLocale); result = cache.get(cacheKey); if (result != null) { ! cacheKey.clear(); ! return dereferencedValue(result); } // check to see if some other thread is building this bundle. // Note that there is a rare chance that this thread is already --- 884,894 ---- cacheKey.setKeyValues(loader, bundleName, defaultLocale); result = cache.get(cacheKey); if (result != null) { ! Object x = dereferencedValue(result); ! if (x != null) { ! cacheKey.clear(); ! return x; ! } } // check to see if some other thread is building this bundle. // Note that there is a rare chance that this thread is already *************** *** 909,916 **** //if someone constructed the bundle for us, return it result = cache.get(cacheKey); if (result != null) { ! cacheKey.clear(); ! return dereferencedValue(result); } } //The bundle isn't in the cache, so we are now responsible for --- 912,922 ---- //if someone constructed the bundle for us, return it result = cache.get(cacheKey); if (result != null) { ! Object x = dereferencedValue(result); ! if (x != null) { ! cacheKey.clear(); ! return x; ! } } } //The bundle isn't in the cache, so we are now responsible for -- ###@###.### 2002/5/8
05-10-0174