- 
    Bug 
- 
    Resolution: Fixed
- 
     P2 P2
- 
    8u40, 9
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build | 
|---|---|---|---|---|---|---|
| JDK-8083453 | emb-9 | Vladimir Ivanov | P2 | Resolved | Fixed | master | 
| JDK-8067524 | 8u45 | Vladimir Ivanov | P2 | Resolved | Fixed | b01 | 
| JDK-8066027 | 8u40 | Vladimir Ivanov | P2 | Closed | Fixed | b17 | 
| JDK-8070912 | emb-8u47 | Vladimir Ivanov | P2 | Resolved | Fixed | team | 
                    Originally reported at http://stackoverflow.com/questions/25942010/how-is-arrayoutofboundsexception-possible-in-string-valueofint
The following test case crashes JVM when it should normally runs forever.
public class EliminateAutoBoxCrash {
private static final int[] values = new int[256];
public static void main(String[] args) {
byte[] bytes = new byte[] {-1};
while (true) {
for (Byte b : bytes) {
values[b & 0xff]++;
}
}
}
}
Note autoboxing: Byte b.
Workaround: -XX:-EliminateAutoBox
Initial investigation shows that the bug has been introduced with the fix forJDK-8042786.
            
The following test case crashes JVM when it should normally runs forever.
public class EliminateAutoBoxCrash {
private static final int[] values = new int[256];
public static void main(String[] args) {
byte[] bytes = new byte[] {-1};
while (true) {
for (Byte b : bytes) {
values[b & 0xff]++;
}
}
}
}
Note autoboxing: Byte b.
Workaround: -XX:-EliminateAutoBox
Initial investigation shows that the bug has been introduced with the fix for
- backported by
- 
                    JDK-8067524 C2: EliminateAutoBox regression after 8042786 -           
- Resolved
 
-         
- 
                    JDK-8070912 C2: EliminateAutoBox regression after 8042786 -           
- Resolved
 
-         
- 
                    JDK-8083453 C2: EliminateAutoBox regression after 8042786 -           
- Resolved
 
-         
- 
                    JDK-8066027 C2: EliminateAutoBox regression after 8042786 -           
- Closed
 
-         
- duplicates
- 
                    JDK-8071865 Byte.valueOf() cause bitwise operators got wrong result -           
- Closed
 
-         
- relates to
- 
                    JDK-8062742 compiler/EliminateAutoBox/UnsignedLoads.java fails with client vm -           
- Closed
 
-         
- 
                    JDK-8042786 Proper fix for 8032566 -           
- Resolved
 
-         
             (2 relates to)
        
    