changeset 9414:6f024d171932

8257999: Parallel GC crash in gc/parallel/TestDynShrinkHeap.java: new region is not in covered_region Reviewed-by: sjohanss, tschatzl
author kbarrett
date Thu, 17 Dec 2020 14:18:00 +0000
parents 08e60f55c416
children bc32046eef89
files src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp	Tue May 22 09:04:15 2018 +0200
+++ b/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp	Thu Dec 17 14:18:00 2020 +0000
@@ -32,6 +32,7 @@
 #include "memory/gcLocker.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/java.hpp"
+#include "runtime/orderAccess.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
@@ -401,7 +402,9 @@
   start_array()->set_covered_region(new_memregion);
   Universe::heap()->barrier_set()->resize_covered_region(new_memregion);
 
-  // ALWAYS do this last!!
+  // Ensure the space bounds are updated and made visible to other
+  // threads after the other data structures have been resized.
+  OrderAccess::storestore();
   object_space()->initialize(new_memregion,
                              SpaceDecorator::DontClear,
                              SpaceDecorator::DontMangle);