Bug 7181756

Adam Hawthorne adamh at basis.com
Tue Oct 16 14:31:36 PDT 2012

Hi all,

Apologies for a -use question on a -dev list, but I couldn't find the -use
list ...

A colleague of mine just ran into this bug:

"Non-zero initial values in a byte array - regression in Java 7"

This seems like a pretty serious issue; a subsequent search found four
instances in our own source code that could potentially trigger the issue.
 Has it seen any attention?  We did some testing and it appears it was
introduced with hs23 in 7u4.

A simple test (based on the sample in the bug) will reproduce:

import java.util.*;

class TestBug2 {
    public static void main(String[] argv) {
        TestBug2 bug = new TestBug2();
        for (int i = 0; i < 10000000; ++i) {

    private void testBug(int iter) {
        byte[] buf8 = new byte[8];
        for (byte b : buf8) {
            if (b != 0)
                throw new Error(iter + ": " + b);
        Arrays.fill(buf8, (byte) 0);

// Output:
// Exception in thread "main" java.lang.Error: 1346815: 50
//         at TestBug2.testBug(TestBug2.java:15)
//                 at TestBug2.main(TestBug2.java:7)

The above output is on Linux x64

java -version:

java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

Yes, I know this isn't a list to receive support, etc., I'm just surprised
at its current priority of low.

Thanks for your attention,


Adam Hawthorne
Software Architect
BASIS International Ltd.
+1.505.938.6169 Phone
+1.505.750.4128 Direct
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20121016/823104b5/attachment.html 

More information about the hotspot-compiler-dev mailing list