changeset 3143:1da0a61f16a1

S7027300, RH1098399: Unsynchronized HashMap access causes endless loop 2014-05-22 Andrew John Hughes <gnu.andrew@redhat.com> * Makefile.am: (ICEDTEA_PATCHES): Add new patch. * NEWS: Updated. * patches/openjdk/7027300-unsync_hashmap_causes_endless_loop.patch: Backport fix to replace HashMap usage with ConcurrentHashMap, avoiding deadlock.
author Andrew John Hughes <gnu.andrew@redhat.com>
date Fri, 23 May 2014 02:08:32 +0100
parents 29d6e0e0c2d2
children 93a1398d268f
files ChangeLog Makefile.am NEWS patches/openjdk/7027300-unsync_hashmap_causes_endless_loop.patch
diffstat 4 files changed, 45 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 09 13:28:18 2014 +0200
+++ b/ChangeLog	Fri May 23 02:08:32 2014 +0100
@@ -1,3 +1,12 @@
+2014-05-22  Andrew John Hughes  <gnu.andrew@redhat.com>
+
+	* Makefile.am:
+	(ICEDTEA_PATCHES): Add new patch.
+	* NEWS: Updated.
+	* patches/openjdk/7027300-unsync_hashmap_causes_endless_loop.patch:
+	Backport fix to replace HashMap usage with ConcurrentHashMap,
+	avoiding deadlock.
+
 2014-05-09  Jiri Vanek  <jvanek@redhat.com>
 
 	* Makefile.am: (add-nss-debug.stamp): fixed ECJ_BUILD_OUTPUT_DIR
--- a/Makefile.am	Fri May 09 13:28:18 2014 +0200
+++ b/Makefile.am	Fri May 23 02:08:32 2014 +0100
@@ -614,7 +614,8 @@
 	patches/shark-drop_compile_method_arg_following_7083786.patch \
 	patches/openjdk/7151089-numa_should_not_free_shm_large_pages.patch \
 	patches/openjdk/8013057-detect_mmap_commit_failures.patch \
-	patches/openjdk/8026887-make_large_page_allocations_easier_to_debug.patch
+	patches/openjdk/8026887-make_large_page_allocations_easier_to_debug.patch \
+	patches/openjdk/7027300-unsync_hashmap_causes_endless_loop.patch
 
 if WITH_RHINO
 ICEDTEA_PATCHES += \
--- a/NEWS	Fri May 09 13:28:18 2014 +0200
+++ b/NEWS	Fri May 23 02:08:32 2014 +0100
@@ -15,6 +15,7 @@
 New in release 1.14.0 (201X-XX-XX):
 
 * Backports
+  - S7027300, RH1098399: Unsynchronized HashMap access causes endless loop
   - S7151089: PS NUMA: NUMA allocator should not attempt to free pages when using SHM large pages
   - S8013057: Detect mmap() commit failures in Linux and Solaris os::commit_memory() impls and call vm_exit_out_of_memory()
   - S8026887: Make issues due to failed large pages allocations easier to debug
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/7027300-unsync_hashmap_causes_endless_loop.patch	Fri May 23 02:08:32 2014 +0100
@@ -0,0 +1,33 @@
+# HG changeset patch
+# User vkarnauk
+# Date 1340286118 -14400
+#      Thu Jun 21 17:41:58 2012 +0400
+# Node ID f71b6117fd7bbb13ed4c1f68ace873695edd49cb
+# Parent  762ae4a20c8b115e5cb486c5204d8bdee747ee59
+7027300: Unsynchronized HashMap access causes endless loop
+Reviewed-by: bae, prr
+
+diff -r 762ae4a20c8b -r f71b6117fd7b src/share/classes/sun/font/SunLayoutEngine.java
+--- openjdk/jdk/src/share/classes/sun/font/SunLayoutEngine.java	Thu Jun 21 14:19:12 2012 +0400
++++ openjdk/jdk/src/share/classes/sun/font/SunLayoutEngine.java	Thu Jun 21 17:41:58 2012 +0400
+@@ -33,7 +33,7 @@
+ import sun.font.GlyphLayout.*;
+ import java.awt.geom.Point2D;
+ import java.lang.ref.SoftReference;
+-import java.util.HashMap;
++import java.util.concurrent.ConcurrentHashMap;
+ import java.util.Locale;
+ 
+ /*
+@@ -129,9 +129,9 @@
+ 
+   // !!! don't need this unless we have more than one sun layout engine...
+     public LayoutEngine getEngine(LayoutEngineKey key) {
+-        HashMap cache = (HashMap)cacheref.get();
++        ConcurrentHashMap cache = (ConcurrentHashMap)cacheref.get();
+         if (cache == null) {
+-            cache = new HashMap();
++            cache = new ConcurrentHashMap();
+             cacheref = new SoftReference(cache);
+         }
+