bug 6869274 Re: Running ant with jdk7
Tim Bell
Tim.Bell at Sun.COM
Thu Aug 6 22:49:39 PDT 2009
Xueming Shen wrote:
> It appears the failure has nothing to do with the zip code, attached
> sample Foo started to fail
> ( the masking operation & BYTE_3_MASK seems failed) from b65 on
> solaris-i586 (but works
> fine on sol-sparc, it failed on linux-amd64 as well, have not tried on
> other platforms yet). Any
> idea where I should send this one to?
Interesting! This could be a word tearing or optimization bug in
the server (C2) compiler.
Your test case will run for many minutes on my Solaris-x64 desktop
if I use "-Xint" or "-client"
If I run with "-server" I get a failure pretty quickly. Here is
a slightly modified version of your test case that tracks the
iteration count:
% cat Foo.java
public class Foo {
private static final long BYTE_3_MASK = 0xFF000000L;
private static final int BYTE_3_SHIFT = 24;
public static void main(String[] args) {
java.util.Random r = new java.util.Random();
byte[] bb = new byte[1];
long nLoops = 0;
while(true) {
nLoops++;
r.nextBytes(bb);
long l = (bb[0] << BYTE_3_SHIFT) & BYTE_3_MASK;
if (bb[0] < 0)
System.out.printf(" [toLong]: %x -> %x%n",
bb[0] & 0xff, l);
if ((l & 0xf00000000L) != 0) {
System.out.printf(nLoops + " Masking failed!%n");
break;
}
}
}
}
If I run with my local copy of JDK7 b67, I get a failure at about 14000
iterations, right after Foo:main is compiled:
% /opt/java/jdk1.7.0-b67/fastdebug/bin/java -server \
-showversion -ea -esa -Xbatch -XX:+PrintCompilation Foo
[... output trimmed...]
[toLong]: d4 -> d4000000
[toLong]: df -> df000000
[toLong]: be -> be000000
1% b Foo::main @ 14 (124 bytes)
[toLong]: a7 -> ffffffffa7000000
1% made not entrant (2) Foo::main @ 14 (124 bytes)
14564 Masking failed!
If I add one more flag: -XX:CompileOnly=Foo::main
/opt/java/jdk1.7.0-b67/fastdebug/bin/java -server \
-showversion -ea -esa -Xbatch -XX:+PrintCompilation \
-XX:CompileOnly=Foo::main Foo
I still get a failure:
[toLong]: e8 -> e8000000
[toLong]: f6 -> f6000000
[toLong]: cc -> cc000000
[toLong]: 9c -> 9c000000
1% b Foo::main @ 14 (124 bytes)
[toLong]: e4 -> ffffffffe4000000
1% made not entrant (2) Foo::main @ 14 (124 bytes)
14564 Masking failed!
I will update Bug-ID 6869274 and assign it to HVM/compiler2
Tim
More information about the jdk7-dev
mailing list