puniverse / quasar

Fibers, Channels and Actors for the JVM
http://docs.paralleluniverse.co/quasar/
Other
4.56k stars 574 forks source link

Uninstrumented methods for CountDownLatch #220

Closed smallnest closed 8 years ago

smallnest commented 8 years ago

I wrote a simple app for co.paralleluniverse.strands.concurrent.CountDownLatch, The code is:

package com.abc.fiber;

import co.paralleluniverse.fibers.Fiber;
import co.paralleluniverse.fibers.SuspendExecution;
import co.paralleluniverse.strands.SuspendableRunnable;
import co.paralleluniverse.strands.concurrent.CountDownLatch;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

public class Helloworld2 {
    public static void main(String[] args) throws IOException {
        new Fiber<Void>(new SuspendableRunnable() {
            public void run() throws SuspendExecution, InterruptedException {
                CountDownLatch latch = new CountDownLatch(1);
                latch.await(1, TimeUnit.MINUTES);
            }
        }).start();

        System.in.read();
    }
}

compile it and run :

java -Dco.paralleluniverse.fibers.verifyInstrumentation=true  -javaagent:./libs/quasar-core-0.7.5-jdk8.jar -cp libs/*:target/quasar-1.0.jar com.abc.fiber.Helloworld

all dependencies(quasar) are at libs directory.

But logs shows Uninstrumented methods:

objc[38320]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
WARNING: Uninstrumented methods (marked '**') or call-sites (marked '!!') detected on the call stack:
    at co.paralleluniverse.common.util.ExtendedStackTrace.here (ExtendedStackTrace.java:44 bci: 8)
    at co.paralleluniverse.fibers.Fiber.checkInstrumentation (Fiber.java:1626 bci: 0)
    at co.paralleluniverse.fibers.Fiber.verifySuspend (Fiber.java:1599 bci: 6)
    at co.paralleluniverse.fibers.Fiber.verifySuspend (Fiber.java:1594 bci: 3)
    at co.paralleluniverse.fibers.Fiber.park (Fiber.java:585 bci: 0)
    at co.paralleluniverse.fibers.Fiber.park (Fiber.java:593 bci: 4)
    at co.paralleluniverse.strands.Strand.parkNanos(java.lang.Object,long) (Strand.java:627 bci: 124)
    at co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer.doAcquireSharedNanos(int,long) (AbstractQueuedSynchronizer.java:1039 bci: 363)
    at co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer.tryAcquireSharedNanos(int,long) (AbstractQueuedSynchronizer.java:1356 bci: 25) **
    at co.paralleluniverse.strands.concurrent.CountDownLatch.await (CountDownLatch.java:268 bci: 10) **
    at com.colobu.fiber.Helloworld2$1.run (Helloworld2.java:19 bci: 124)
    at co.paralleluniverse.strands.SuspendableUtils$VoidSuspendableCallable.run (SuspendableUtils.java:44 bci: 4)
    at co.paralleluniverse.strands.SuspendableUtils$VoidSuspendableCallable.run (SuspendableUtils.java:32 bci: 1)
    at co.paralleluniverse.fibers.Fiber.run (Fiber.java:1027 bci: 11)
    at co.paralleluniverse.fibers.Fiber.run1 (Fiber.java:1022 bci: 1)
Exception in Fiber "fiber-10000001" java.lang.AssertionError
    at co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1358)
    at co.paralleluniverse.strands.concurrent.CountDownLatch.await(CountDownLatch.java:268)
    at com.colobu.fiber.Helloworld2$1.run(Helloworld2.java:19)
    at co.paralleluniverse.strands.SuspendableUtils$VoidSuspendableCal

AbstractQueuedSynchronize has not been instrumented?

smallnest commented 8 years ago

I upgrade quasar to 0.7.6. This issue disappeared.