-
Bug
-
Resolution: Fixed
-
P4
-
11, 17, 21, 22
-
b18
CompressedClassPointers.java expect the compressed class space (CCS) to be reserved in a certain range to satisfy the following:
output.shouldContain("Narrow klass base: 0x0000000000000000");
https://github.com/openjdk/jdk/blob/a8871f5d26e5cb42c031c7b736ec30b1b147a2bc/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java#L61-L74
However, this is not always possible due to Address Space Layout Randomization. This can be simulated on Linux/x64 with the following patch, which will cause the test to always fail.
$ git diff
diff --git a/src/hotspot/share/memory/metaspace.cpp b/src/hotspot/share/memory/metaspace.cpp
index db9579e4652..efd711b57b0 100644
--- a/src/hotspot/share/memory/metaspace.cpp
+++ b/src/hotspot/share/memory/metaspace.cpp
@@ -797,6 +797,7 @@ void Metaspace::global_initialize() {
if (base != nullptr) {
if (CompressedKlassPointers::is_valid_base(base)) {
+ if (0)
rs = ReservedSpace(size, Metaspace::reserve_alignment(),
os::vm_page_size(), (char*)base);
}
==============================
Proposed fix:
Add a VM log message to indicate whether it's able to reserve the CCS at the desired memory range. If not, the test cases in CompressedClassPointers.java should be skipped.
output.shouldContain("Narrow klass base: 0x0000000000000000");
https://github.com/openjdk/jdk/blob/a8871f5d26e5cb42c031c7b736ec30b1b147a2bc/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java#L61-L74
However, this is not always possible due to Address Space Layout Randomization. This can be simulated on Linux/x64 with the following patch, which will cause the test to always fail.
$ git diff
diff --git a/src/hotspot/share/memory/metaspace.cpp b/src/hotspot/share/memory/metaspace.cpp
index db9579e4652..efd711b57b0 100644
--- a/src/hotspot/share/memory/metaspace.cpp
+++ b/src/hotspot/share/memory/metaspace.cpp
@@ -797,6 +797,7 @@ void Metaspace::global_initialize() {
if (base != nullptr) {
if (CompressedKlassPointers::is_valid_base(base)) {
+ if (0)
rs = ReservedSpace(size, Metaspace::reserve_alignment(),
os::vm_page_size(), (char*)base);
}
==============================
Proposed fix:
Add a VM log message to indicate whether it's able to reserve the CCS at the desired memory range. If not, the test cases in CompressedClassPointers.java should be skipped.
- relates to
-
JDK-8317610 runtime/CompressedOops/CompressedClassPointers.java fails after JDK-8305765
-
- Closed
-
-
JDK-8322943 runtime/CompressedOops/CompressedClassPointers.java fails on AIX
-
- Resolved
-