JDK-8254016 : Test8237524 fails with -XX:-CompactStrings option
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: arm
  • Submitted: 2020-10-05
  • Updated: 2020-11-24
  • Resolved: 2020-11-16
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.
JDK 11 JDK 16
11.0.10Fixed 16 b25Fixed
Related Reports
Relates :  
Description
The test compares two strings created from same byte[] array: Latin vs UTF16. The expected effect (strings are different) is valid only for COMPACT_STRINGS=true case (otherwise both strings are treated as UTF16). The test fails on ARM32 because COMPACT_STRINGS=false by default.
Comments
Fix Request (11u) This fixes the testbug that affects at least ARM, and keeps codebases in sync (I see 11.0.11-oracle). Patch applies cleanly to 11u, affected test fails with -XX:-CompactStrings without the patch, and passes with it.
23-11-2020

Changeset: f611fdfe Author: Boris Ulasevich <bulasevich@openjdk.org> Date: 2020-11-16 14:58:14 +0000 URL: https://github.com/openjdk/jdk/commit/f611fdfe
16-11-2020

Have a look at this pull request please: https://github.com/openjdk/jdk/pull/1226/commits I have added -XX:+CompactStrings option to be sure the option is ON.
16-11-2020

Boris, are you still handling this? Reassign to me if you are not.
16-11-2020

Seems to be trivially fixable by: diff --git a/test/hotspot/jtreg/compiler/intrinsics/Test8237524.java b/test/hotspot/jtreg/compiler/intrinsics/Test8237524.java index a5a2d298a8b..919160c22cb 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/Test8237524.java +++ b/test/hotspot/jtreg/compiler/intrinsics/Test8237524.java @@ -28,6 +28,7 @@ * @summary String.compareTo() may return incorrect result in this case * * @modules java.base/java.lang:open + * @requires vm.opt.final.CompactStrings * * @run main/othervm compiler.intrinsics.Test8237524 */ diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index 68a6f1e3f88..182efa89700 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -327,6 +327,7 @@ public class VMProps implements Callable<Map<String, String>> { vmOptFinalFlag(map, "UseCompressedOops"); vmOptFinalFlag(map, "EnableJVMCI"); vmOptFinalFlag(map, "EliminateAllocations"); + vmOptFinalFlag(map, "CompactStrings"); } /**
16-11-2020

Fails on Linux x64 when run with -XX:-CompactStrings with message: FAIL. s1 should be less than s2 according to Java API Spec
06-10-2020