JDK-6636352 : Unit tests for supplementary character support fail with -XX:+AggressiveOpts
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 6u4p,6u10
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_nevada,solaris_10
  • CPU: sparc
  • Submitted: 2007-12-01
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
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 6 Other
6u14Fixed hs12Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
Java Release            : 6u4p
Java Builds             : b01
VM flavors              : server
VM Modes                : -Xmixed
Java flags              : -XX:+AggressiveOpts
Platform(s)             : solaris-sparc, solaris-sparcv9
Hostnames with OS info  : vm-t2000-01, nanonano (Solaris 10)

So, the failure is reproduced only on solaris-sparc/v9, with 
-server -Xmixed -XX:+AggressiveOpts or
-d64 -server -Xmixed -XX:+AggressiveOpts

The failure is not reproduced with 
- -Xint, -Xcomp
- without -XX:+AggressiveOpts
- on linux, sol-x86/amd, windows
- latest jdk7 (b23)
- latest jdk6u4 (b09)
- with rt.jar from latest 6u4 (b09) 

Running the tests with latest jdk6u4b09 but with jvm copied from 6u4p01 results in tests failure. So, the problem is 6u4p specific and is in HotSpot

Test cases: 
 java/lang/Character/Supplementary.java
 java/lang/String/Supplementary.java
 java/lang/StringBuffer/Supplementary.java
 java/lang/StringBuilder/Supplementary.java

Error Log : 
1. java/lang/String/Supplementary.java fails with
java.lang.RuntimeException: Error: offsetByCodePoints(input[0], 10, -14) returned an unexpected value. got 0x9, expecte
d 0xa
        at Supplementary.check(Supplementary.java:589)
        at Supplementary.test9(Supplementary.java:412)
        at Supplementary.main(Supplementary.java:19)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:78)
        at java.lang.Thread.run(Thread.java:619)

2. java/lang/Character/Supplementary.java fails with
   java.lang.RuntimeException: isValidCodePoint failed with 0xffef2a3e
        at Supplementary.test00(Supplementary.java:95)
        at Supplementary.main(Supplementary.java:25)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:78)
        at java.lang.Thread.run(Thread.java:619)

3. java/lang/StringBuffer/Supplementary.java fails with
java.lang.RuntimeException: Error: offsetByCodePoints(input[4], 5, -11) returned an unexpected value. got 0x4, expected
 0x5
        at Supplementary.check(Supplementary.java:357)
        at Supplementary.test6(Supplementary.java:252)
        at Supplementary.main(Supplementary.java:16)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:78)
        at java.lang.Thread.run(Thread.java:619)

4. java/lang/StringBuilder/Supplementary.java fails with
java.lang.RuntimeException: Error: offsetByCodePoints(input[4], 5, -11) returned an unexpected value. got 0x4, expected
 0x5
        at Supplementary.check(Supplementary.java:357)
        at Supplementary.test6(Supplementary.java:252)
        at Supplementary.main(Supplementary.java:16)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:78)
        at java.lang.Thread.run(Thread.java:619)

Comments
SUGGESTED FIX *** /tmp/geta26640 Mon Dec 3 17:43:49 2007 --- sparc.ad Mon Dec 3 16:37:18 2007 *************** *** 6025,6031 **** ins_pipe(ialu_imm); %} ! instruct cmovII_U_reg(cmpOp cmp, flagsRegU icc, iRegI dst, iRegI src) %{ match(Set dst (CMoveI (Binary cmp icc) (Binary dst src))); ins_cost(150); size(4); --- 6025,6031 ---- ins_pipe(ialu_imm); %} ! instruct cmovII_U_reg(cmpOpU cmp, flagsRegU icc, iRegI dst, iRegI src) %{ match(Set dst (CMoveI (Binary cmp icc) (Binary dst src))); ins_cost(150); size(4); *************** *** 6034,6040 **** ins_pipe(ialu_reg); %} ! instruct cmovII_U_imm(cmpOp cmp, flagsRegU icc, iRegI dst, immI11 src) %{ match(Set dst (CMoveI (Binary cmp icc) (Binary dst src))); ins_cost(140); size(4); --- 6034,6040 ---- ins_pipe(ialu_reg); %} ! instruct cmovII_U_imm(cmpOpU cmp, flagsRegU icc, iRegI dst, immI11 src) %{ match(Set dst (CMoveI (Binary cmp icc) (Binary dst src))); ins_cost(140); size(4);
04-12-2007

EVALUATION This a latent bug in the encoding for cmove with unsigned compares in sparc.ad. Code for folding compares as part of autobox elimination created opportunites to use these instructions. It appears they hadn't been used before.
04-12-2007