This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: NULL pointer dereference when probing Java methods


Hey Tutsuo,

Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> writes:
> Problem description:
[...]
>   Is this a limitation (i.e. Java methods which have arguments of Java objects
>   other than java.lang.String cannot be probed using java().class().method() syntax)
>   rather than a bug?

First off, thank you for the awesome level of detail in your reproducer!

Previously systemtap would check for basic primitive java data types,
and fall back on the string case if none of those were found.  As you
found, this was a bit of an oversight on my behalf, as a null string
(say, from an object being passed), would cause the crash.

I've commit b82a3aa8376d92bb43ff67be6ee7fe1c5e69f1e4 upstream which
should add basic support for objects being passed (it'll convert the
class argument to a string and report that).

Using your Test1.java reproducer and a similar script, I now get
the following output.

cat test1.stp 
probe java("Test1").class("Test1").method("method1(int)")
{
        printf("%s %d\n", pn(), $arg1)
}
probe java("Test1").class("Test1").method("method2(String)")
{
        printf("%s %s\n", pn(), user_string($arg1))
}
probe java("Test1").class("Test1").method("method3(Test1)")
{
        printf("%s %s\n", pn(), user_string($arg1))
}

------

stap test1.stp -c 'java Test1' 
100
Hello
Test1@4e25154f
Setting org.jboss.byteman.transform.all=true
100
Hello
Test1@4e25154f
java("Test1").class("Test1").method("method1(int)") 100
java("Test1").class("Test1").method("method2(String)") class java.lang.String
java("Test1").class("Test1").method("method3(Test1)") class Test1

We're going to have to tweak this a bit more for the proper string
argument (instead of 'class java.lang.String').  But thanks for bringing
the crash to our attention!

Cheers,

Lukas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]