United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7177923 SIGBUS on sparc in compiled code for java.util.Calendar.clear()
JDK-7177923 : SIGBUS on sparc in compiled code for java.util.Calendar.clear()

Details
Type:
Bug
Submit Date:
2012-06-18
Status:
Closed
Updated Date:
2013-07-31
Project Name:
JDK
Resolved Date:
2012-07-03
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
sparc
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs24
Fixed Versions:
hs24 (b15)

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
Several Nightly tests java/util and regression/jit which called java.util.Calendar.clear() crashed with SIGBUS on sparc:

java/util/Calendar/WeekDateTest.java
java/util/Locale/InternationalBAT.java
java/util/Locale/ThaiGov.java
regression/jit/4139729/Calendar/CalendarLimitTest
regression/jit/4139729/Calendar/CalendarTest
regression/jit/4139729/Calendar/Limit
regression/jit/4139731/Date/DateTest

They crashed on vector instruction which zeros byte array in compiled code for java.util.Calendar.clear():

;; ffffffff77afa2bc 06 47 ff ed             bl,pn   %icc, 0xffffffff77afa270
;; ---------------
;; ffffffff77afa2c0 c0 74 20 10             clrx  [ %l0 + 0x10 ]

     BPlt   B14      ! Loop end  P=0.900000 C=-1.000000
     STX    #0,[R_L0 + #16]  ! store zero vector (8 bytes)

                                    

Comments
EVALUATION

There are 2 arrays which are zeroed in loop in  java.util.Calendar.clear():

    protected int           fields[];
    protected boolean       isSet[];
    transient private int   stamp[];

   public final void clear()
    {
        for (int i = 0; i < fields.length; ) {
            stamp[i] = fields[i] = 0; // UNSET == 0
            isSet[i++] = false;
        }
        areAllFieldsSet = areFieldsSet = false;
        isTimeSet = false;
    }

all of 0 stores are vectorized after changes for 7119644. The problem is that pre-loop does only 2 iterations which is enough to align vector stores for in arrays but it is not enough for byte array. As result vector store into iiSet[] is not aligned in main loop.
                                     
2012-06-18
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/6f8f439e247d
                                     
2012-06-20
EVALUATION

http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/6f8f439e247d
                                     
2012-06-29
There is no promoted 7u40 or 8fcs build with the issue present, so it can't be reproduced. Closed as not verified (setup not available).
                                     
2013-07-31



Hardware and Software, Engineered to Work Together