Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6871697

LinkedBlockingQueue Iterator/remove/poll race

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 7
    • core-libs

        Rarely, OfferRemoveLoops.java fails as in the jtr file below:

        --------------------------------------------------
        TEST: java/util/concurrent/ConcurrentQueues/OfferRemoveLoops.java
        JDK under test: (/usr/local/google/home/martin/ws/upstream/build/linux-amd64)
        openjdk version "1.7.0-internal"
        OpenJDK Runtime Environment (build 1.7.0-internal-martinrb_2009_07_11_16_08-b00)
        OpenJDK 64-Bit Server VM (build 16.0-b07, mixed mode)

        ACTION: build -- Passed. Build successful
        REASON: Named class compiled on demand
        TIME: 0.94 seconds
        messages:
        command: build OfferRemoveLoops
        reason: Named class compiled on demand
        elapsed time (seconds): 0.94

        ACTION: compile -- Passed. Compilation successful
        REASON: .class file out of date or does not exist
        TIME: 0.937 seconds
        messages:
        command: compile
        /usr/local/google/home/martin/ws/upstream/test/java/util/concurrent/ConcurrentQueues/OfferRemoveLoops.java
        reason: .class file out of date or does not exist
        elapsed time (seconds): 0.937
        STDOUT:
        STDERR:

        ACTION: main -- Failed. Execution failed: `main' threw exception:
        java.lang.AssertionError: Some tests failed
        REASON: User specified action: run main OfferRemoveLoops 300
        TIME: 22.964 seconds
        messages:
        command: main OfferRemoveLoops300
        reason: User specified action: run main OfferRemoveLoops 300
        elapsed time (seconds): 22.964
        STDOUT:
        LinkedBlockingQueue
        LinkedBlockingQueue
        LinkedBlockingDeque
        LinkedBlockingDeque
        ArrayBlockingQueue
        PriorityBlockingQueue
        ConcurrentLinkedQueue
        LinkedTransferQueue

        Passed = 5322725, failed = 4

        STDERR:
        Hung thread: offerer
        sun.misc.Unsafe.park(Native Method)
        java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
        java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
        java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:867)
        java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1197)
        java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:214)
        java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:290)
        java.util.concurrent.LinkedBlockingQueue.offer(LinkedBlockingQueue.java:415)
        OfferRemoveLoops$1.realRun(OfferRemoveLoops.java:99)
        OfferRemoveLoops$1CheckedThread.run(OfferRemoveLoops.java:89)
        java.lang.ThreadDeath
        at java.lang.Thread.stop(Thread.java:813)
        at OfferRemoveLoops.testQueue(OfferRemoveLoops.java:149)
        at OfferRemoveLoops.test(OfferRemoveLoops.java:53)
        at OfferRemoveLoops.instanceMain(OfferRemoveLoops.java:168)
        at OfferRemoveLoops.main(OfferRemoveLoops.java:166)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:623)
        at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:96)
        at java.lang.Thread.run(Thread.java:717)
        Hung thread: scanner
        java.util.concurrent.LinkedBlockingQueue$Itr.nextNode(LinkedBlockingQueue.java:780)
        java.util.concurrent.LinkedBlockingQueue$Itr.next(LinkedBlockingQueue.java:791)
        OfferRemoveLoops.checkNotContainsNull(OfferRemoveLoops.java:47)
        OfferRemoveLoops$3.realRun(OfferRemoveLoops.java:132)
        OfferRemoveLoops$1CheckedThread.run(OfferRemoveLoops.java:89)
        java.lang.ThreadDeath
        at java.lang.Thread.stop(Thread.java:813)
        at OfferRemoveLoops.testQueue(OfferRemoveLoops.java:149)
        at OfferRemoveLoops.test(OfferRemoveLoops.java:53)
        at OfferRemoveLoops.instanceMain(OfferRemoveLoops.java:168)
        at OfferRemoveLoops.main(OfferRemoveLoops.java:166)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:623)
        at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:96)
        at java.lang.Thread.run(Thread.java:717)
        java.lang.AssertionError: Some tests failed
        at OfferRemoveLoops.instanceMain(OfferRemoveLoops.java:170)
        at OfferRemoveLoops.main(OfferRemoveLoops.java:166)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:623)
        at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:96)
        at java.lang.Thread.run(Thread.java:717)

              chegar Chris Hegarty
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: