Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior when trying to probe return values from multiple methods #145

Closed
jbachorik opened this issue Aug 14, 2015 · 0 comments
Assignees
Milestone

Comments

@jbachorik
Copy link
Collaborator

Following snippet leads to NPE

@OnMethod(clazz="extra.HelloWorld", method="/.*/", location = @Location(Kind.RETURN))
    public static void trace(@ProbeMethodName(fqn = true) String pmn, @Return String o) {

java.lang.NullPointerException
at java.lang.String.(String.java:198)
at com.sun.btrace.org.objectweb.asm.Type.getInternalName(Unknown Source)
at com.sun.btrace.util.LocalVariableHelperImpl.storeNewLocal(LocalVariableHelperImpl.java:291)
at com.sun.btrace.util.templates.TemplateExpanderVisitor.storeNewLocal(TemplateExpanderVisitor.java:64)
at com.sun.btrace.runtime.MethodInstrumentor.storeNewLocal(MethodInstrumentor.java:298)
at com.sun.btrace.runtime.Instrumentor$15.callAction(Instrumentor.java:1232)
at com.sun.btrace.runtime.Instrumentor$15.onMethodReturn(Instrumentor.java:1275)
at com.sun.btrace.runtime.MethodReturnInstrumentor.visitInsn(MethodReturnInstrumentor.java:62)
at com.sun.btrace.org.objectweb.asm.MethodVisitor.visitInsn(Unknown Source)
at com.sun.btrace.org.objectweb.asm.ClassReader.a(Unknown Source)
at com.sun.btrace.org.objectweb.asm.ClassReader.b(Unknown Source)
at com.sun.btrace.org.objectweb.asm.ClassReader.accept(Unknown Source)
at com.sun.btrace.org.objectweb.asm.ClassReader.accept(Unknown Source)
at com.sun.btrace.runtime.InstrumentUtils.accept(InstrumentUtils.java:119)
at com.sun.btrace.runtime.InstrumentUtils.accept(InstrumentUtils.java:115)
at com.sun.btrace.agent.Client.instrument(Client.java:395)
at com.sun.btrace.agent.Client.doTransform(Client.java:215)
at com.sun.btrace.agent.Client.transform(Client.java:167)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
at com.sun.btrace.agent.Main$4.run(Main.java:484)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

With

@OnMethod(clazz="extra.HelloWorld", location = @Location(Kind.RETURN))
    public static void trace(@ProbeMethodName(fqn = true) String pmn, @Return String o) {

we don't get NPE but the methods are not matched.

@jbachorik jbachorik self-assigned this Aug 14, 2015
@jbachorik jbachorik added this to the 1.3.4 milestone Aug 14, 2015
jbachorik added a commit that referenced this issue Nov 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant