-
Bug
-
Resolution: Fixed
-
P4
-
11, 12, 13, 14, 15
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8256626 | 11.0.11-oracle | Dukebot | P4 | Resolved | Fixed | b01 |
JDK-8255306 | 11.0.10 | Pengfei Li | P4 | Resolved | Fixed | b01 |
AArch64 String.compareTo() may return incorrect result in some corner
cases. This issue can be reproduced in below program by constructing two
strings from the same byte array but with different encoding options.
import java.lang.reflect.Constructor;
public class Test {
public static void main(String[] args) throws Exception {
Constructor<String> c = String.class.getDeclaredConstructor(byte[].class, byte.class);
c.setAccessible(true);
byte[] bytes = new byte[] {
'Y', 'm', '_', 'l', 'V', 'n', 'W', 'S', 'w', 'm', 'W', 'S'
};
String s1 = c.newInstance(bytes, (byte) 0);
String s2 = c.newInstance(bytes, (byte) 1);
System.out.println(s1.compareTo(s2));
}
}
// $ java -Xint Test
// -27904
// $ java -Xcomp -XX:-TieredCompilation Test
// 6
cases. This issue can be reproduced in below program by constructing two
strings from the same byte array but with different encoding options.
import java.lang.reflect.Constructor;
public class Test {
public static void main(String[] args) throws Exception {
Constructor<String> c = String.class.getDeclaredConstructor(byte[].class, byte.class);
c.setAccessible(true);
byte[] bytes = new byte[] {
'Y', 'm', '_', 'l', 'V', 'n', 'W', 'S', 'w', 'm', 'W', 'S'
};
String s1 = c.newInstance(bytes, (byte) 0);
String s2 = c.newInstance(bytes, (byte) 1);
System.out.println(s1.compareTo(s2));
}
}
// $ java -Xint Test
// -27904
// $ java -Xcomp -XX:-TieredCompilation Test
// 6
- backported by
-
JDK-8255306 AArch64: String.compareTo() may return incorrect result
-
- Resolved
-
-
JDK-8256626 AArch64: String.compareTo() may return incorrect result
-
- Resolved
-
- relates to
-
JDK-8202326 AARCH64: optimize string compare intrinsic
-
- Resolved
-
-
JDK-8244282 test/hotspot/jtreg/compiler/intrinsics/Test8237524.java fails with --illegal-access=deny
-
- Resolved
-
-
JDK-8254016 Test8237524 fails with -XX:-CompactStrings option
-
- Resolved
-