Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6709165
Votes 0
Synopsis Tests hang or misbahve with HS 13.0-b01 on solaris-sparcv9
Category hotspot:compiler2
Reported Against b01
Release Fixed hs13(b02)
State 10-Fix Delivered, bug
Priority: 2-High
Related Bugs 6420645
Submit Date 30-MAY-2008
Description
I'm seeing a number tests hanging or misbehaving on solaris-sparcv9 since jdk7-b27 was promoted. jdk7-b27 has HotSpot 13.0-b01. Problems go away if I run with -Xint or exclude specific methods from compilation. I pulled in HotSpot 12.0-b03 from jdk7-b26 and don't observe any problems so this looks like a regression.

Here's an example of a regression test in the JDK repository where compareAndSet seems to be broken:
  test/java/nio/channels/SelectionKey/AtomicAttachTest.java

Works okay when this method is excluded:
exclude java/util/concurrent/atomic/AtomicReferenceFieldUpdater getAndSet

The following is another small test which is hacked from a much larger test that hangs with jdk7-b27. In this case, the test works when java.util.concurrent.locks.AbstractQueuedSynchronizer.enq is excluded from compilation.

import java.util.concurrent.*;

public class Test {
    public static void main(String[] args) throws Exception {
        Executor executor = Executors.newFixedThreadPool(1,
            new ThreadFactory() {
                public Thread newThread(Runnable r) {
                    Thread t = new Thread(r);
                    t.setDaemon(true);
                    return t;
                }
            });

        int i = 0;
        while (i<10000) {
            final CountDownLatch latch =  new CountDownLatch(1);
            executor.execute(new Runnable() {
                public void run() {
                    latch.countDown();
                }
            });
            latch.await();
            i++;
        }
    }
}
Posted Date : 2008-05-30 20:05:08.0
Work Around
N/A
Evaluation
The assembly for CompareAndSwapN is wrong.  CAS always destroys the register containing the new value.  I think when I wrote the code I must have mistakenly simplified it.  The fix is to make the assembly look like the CompareAndSwapI code.  I'm not sure how this slipped through all the testing that was done.
Posted Date : 2008-05-30 22:43:31.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang