All methods on stack are instrumented but NPE at (Strand.java:493) is still thrown

376 views
Skip to first unread message

Sergey Stupin

unread,
Aug 2, 2015, 9:50:43 AM8/2/15
to quasar-pulsar-user
Every time when I run my app - I get he following error

Exception in Fiber "SessionRegistry" If this exception looks strange, perhaps you've forgotten to instrument a blocking method. Run your program with -Dco.paralleluniverse.fibers.verifyInstrumentation to catch the culprit!
    java.lang.NullPointerException
    at co.paralleluniverse.strands.Strand.park(Strand.java:493)
    at co.paralleluniverse.strands.ConditionSynchronizer.await(ConditionSynchronizer.java:54)
    at co.paralleluniverse.actors.Mailbox.await(Mailbox.java:90)
    at co.paralleluniverse.actors.SelectiveReceiveHelper.receive(SelectiveReceiveHelper.java:141)
    at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call(RequestReplyHelper.java:174)
    at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call(RequestReplyHelper.java:112)
    at service.actor.GalaxyTranceiver.writeBuffers(GalaxyTranceiver.java:68)
    at service.actor.GalaxyTranceiver.transceive(GalaxyTranceiver.java:57)
    at org.apache.avro.ipc.Transceiver.transceive(Transceiver.java:72)
    at org.apache.avro.ipc.Requestor.request(Requestor.java:147)
    at org.apache.avro.ipc.Requestor.request(Requestor.java:101)
    at org.apache.avro.ipc.specific.SpecificRequestor.invoke(SpecificRequestor.java:88)
    at com.sun.proxy.$Proxy17.spawnSession(Unknown Source)
    at lobby.actors.SessionRegistry.start(SessionRegistry.java:137)
    at tests.LobbyTest$2.apply(LobbyTest.java:125)
    at tests.LobbyTest$2.apply(LobbyTest.java:1)
    at lobby.actors.SessionRegistry$Action.process(SessionRegistry.java:125)
    at lobby.actors.SessionRegistry.doRun(SessionRegistry.java:63)
    at lobby.actors.SessionRegistry.doRun(SessionRegistry.java:1)
    at co.paralleluniverse.actors.Actor.run0(Actor.java:692)
    at co.paralleluniverse.actors.ActorRunner.run(ActorRunner.java:51)
    at co.paralleluniverse.fibers.Fiber.run(Fiber.java:1019)


While trying to verify instrumentation I can't find ANY uninstrumented methods:

WARNING: Uninstrumented methods (marked '**') or call-sites (marked '!!') detected on the call stack: 
    at co.paralleluniverse.strands.Strand.park (Strand.java:493 bci: 57)
    at co.paralleluniverse.strands.ConditionSynchronizer.await (ConditionSynchronizer.java:54 bci: 255)
    at co.paralleluniverse.actors.Mailbox.await (Mailbox.java:90 bci: 99)
    at co.paralleluniverse.actors.SelectiveReceiveHelper.receive (SelectiveReceiveHelper.java:141 bci: 904)
    at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call (RequestReplyHelper.java:174 bci: 663)
    at co.paralleluniverse.actors.behaviors.RequestReplyHelper.call (RequestReplyHelper.java:112 bci: 335)
    at service.actor.GalaxyTranceiver.writeBuffers (GalaxyTranceiver.java:68 bci: 114)
    at service.actor.GalaxyTranceiver.transceive (GalaxyTranceiver.java:57 bci: 122)
    at org.apache.avro.ipc.Transceiver.transceive (Transceiver.java:72 bci: 2) (optimized)
    at org.apache.avro.ipc.Requestor.request (Requestor.java:147 bci: 253)
    at org.apache.avro.ipc.Requestor.request (Requestor.java:101 bci: 229)
    at org.apache.avro.ipc.specific.SpecificRequestor.invoke (SpecificRequestor.java:88 bci: 473)
    at com.sun.proxy.$Proxy17.spawnSession (Unknown Source bci: 16)
    at lobby.actors.SessionRegistry.start (SessionRegistry.java:137 bci: 421) !! (instrumented suspendable calls at: [])
    at tests.LobbyTest$2.apply (LobbyTest.java:125 bci: 118)
    at tests.LobbyTest$2.apply (LobbyTest.java:1 bci: 5) (optimized)
    at lobby.actors.SessionRegistry$Action.process (SessionRegistry.java:125 bci: 120)
    at lobby.actors.SessionRegistry.doRun (SessionRegistry.java:63 bci: 125)
    at lobby.actors.SessionRegistry.doRun (SessionRegistry.java:1 bci: 1) (optimized)
    at co.paralleluniverse.actors.Actor.run0 (Actor.java:692 bci: 222)
    at co.paralleluniverse.actors.ActorRunner.run (ActorRunner.java:51 bci: 148)
    at co.paralleluniverse.fibers.Fiber.run (Fiber.java:1019 bci: 11)
    at co.paralleluniverse.fibers.Fiber.run1 (Fiber.java:1014 bci: 1)


What's wrong with it? Do I misunderstood something?

fa...@paralleluniverse.co

unread,
Aug 2, 2015, 10:59:10 AM8/2/15
to quasar-pulsar-user
Hi Sergey,

starting with Quasar 0.7.2, instrumentation verification is able to detect not only uninstrumented methods but also uninstrumented call sites, marking them in the stack trace with "!!". An uninstrumented call can exist even if all methods that need to be instrumented are indeed instrumented, for example when it refers to an interface method that wasn't marked suspendable (so Quasar didn't know it could have suspendable implementations and didn't instrument calls to it).

In your (Quasar-enhanced) stack trace with verification enabled I can see:


     at lobby.actors.SessionRegistry.start (SessionRegistry.java:137 bci: 421) !! (instrumented suspendable calls at: [])

So, according to Quasar, SessionRegistry.java at line 137 (instrumented bytecode index 421) is performing a suspendable call but the corresponding call site source line number hasn't been found in the list of instrumented calls (which is empty).

Is indeed some interface method without "throws SuspendExecution" and without "@Suspendable" involved here?

-- Fabio

Sergey Stupin

unread,
Aug 2, 2015, 11:07:04 AM8/2/15
to fa...@paralleluniverse.co, quasar-pulsar-user

Hi, Fabio. Thanks for the quick response! I will look later at my code.

--
You received this message because you are subscribed to a topic in the Google Groups "quasar-pulsar-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/quasar-pulsar-user/0IE7kb-UISA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to quasar-pulsar-u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sergey Stupin

unread,
Aug 3, 2015, 3:43:59 AM8/3/15
to fa...@paralleluniverse.co, quasar-pulsar-user
Hey, looking closely at those lines 

        at org.apache.avro.ipc.specific.SpecificRequestor.invoke (SpecificRequestor.java:88 bci: 473)
    at com.sun.proxy.$Proxy17.spawnSession (Unknown Source bci: 16)
    at lobby.actors.SessionRegistry.start (SessionRegistry.java:137 bci: 421) !! (instrumented suspendable calls at: [])

you can notice that at line SessionRegistry.java:137 there is a call to Proxy method. I have an interface with method spawnSession. This proxy is automatically generated by Apache Avro from that interface and I can't influence to that process. So I mark all my implementations of interface with @Suspendable annotation but unfortunately it didn't help. 

 It seems to me that the problem is that quasar can't instrument ProxyMethod calls, isn't it?
--
Best regards,
Stupin Sergey.

pron

unread,
Aug 3, 2015, 3:49:12 AM8/3/15
to quasar-pulsar-user, fa...@paralleluniverse.co
Quasar actually handles proxies well. The spawnSession method on the interface must be annotated/throws, though (or listed in the META-INF/suspendable-supers file if you can't/don't want to change the interface's code.


On Monday, August 3, 2015 at 10:43:59 AM UTC+3, Sergey Stupin wrote:
Hey, looking closely at those lines 

        at org.apache.avro.ipc.specific.SpecificRequestor.invoke (SpecificRequestor.java:88 bci: 473)
    at com.sun.proxy.$Proxy17.spawnSession (Unknown Source bci: 16)
    at lobby.actors.SessionRegistry.start (SessionRegistry.java:137 bci: 421) !! (instrumented suspendable calls at: [])

you can notice that at line SessionRegistry.java:137 there is a call to Proxy method. I have an interface with method spawnSession. This proxy is automatically generated by Apache Avro from that interface and I can't influence to that process. So I mark all my implementations of interface with @Suspendable annotation but unfortunately it didn't help. 

 It seems to me that the problem is that quasar can't instrument ProxyMethod calls, isn't it?
2015-08-02 18:07 GMT+03:00 Sergey Stupin

Hi, Fabio. Thanks for the quick response! I will look later at my code.

To unsubscribe from this group and all its topics, send an email to quasar-pulsar-user+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sergey Stupin

unread,
Aug 3, 2015, 4:00:12 AM8/3/15
to pron, quasar-pulsar-user, fa...@paralleluniverse.co
Hi, pron. Omg it does help!! Thanks you a lot. Now it works, im so happy

To unsubscribe from this group and all its topics, send an email to quasar-pulsar-u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Best regards,
Stupin Sergey.

--
You received this message because you are subscribed to a topic in the Google Groups "quasar-pulsar-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/quasar-pulsar-user/0IE7kb-UISA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to quasar-pulsar-u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

pron

unread,
Aug 3, 2015, 4:04:35 AM8/3/15
to quasar-pulsar-user, r...@paralleluniverse.co, fa...@paralleluniverse.co
Excellent! 
The idea is that Quasar needs to know about both the implementation as well as the call-site. If the call is done with an interface, the interface must be annotated as well (of course, if you use `throws SuspendExecution` the Java compiler will take care of all that, but we can't always use that approach). The new verification mechanism marks an uninstrumented method with **, and an uninstrumented callsite with !!


On Monday, August 3, 2015 at 11:00:12 AM UTC+3, Sergey Stupin wrote:
Hi, pron. Omg it does help!! Thanks you a lot. Now it works, im so happy
To unsubscribe from this group and all its topics, send an email to quasar-pulsar-user+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Best regards,
Stupin Sergey.

--
You received this message because you are subscribed to a topic in the Google Groups "quasar-pulsar-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/quasar-pulsar-user/0IE7kb-UISA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to quasar-pulsar-user+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages