public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/21020] New: reorganize argument passing from java probes
@ 2017-01-03 14:38 fche at redhat dot com
  2017-01-04  0:10 ` [Bug runtime/21020] " penguin-kernel@i-love.sakura.ne.jp
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: fche at redhat dot com @ 2017-01-03 14:38 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=21020

            Bug ID: 21020
           Summary: reorganize argument passing from java probes
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: fche at redhat dot com
  Target Milestone: ---

We need to 

- handle more java object types (not just integers; toString() any type)
- standardize the systemtap-side api (e.g., $argX being all strings)
- ensure no memory leaks (from strdup'd strings passed to the STAP_PROBE*)

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/21020] reorganize argument passing from java probes
  2017-01-03 14:38 [Bug runtime/21020] New: reorganize argument passing from java probes fche at redhat dot com
@ 2017-01-04  0:10 ` penguin-kernel@i-love.sakura.ne.jp
  2017-01-06 22:44 ` fche at redhat dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: penguin-kernel@i-love.sakura.ne.jp @ 2017-01-04  0:10 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=21020

Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |penguin-kernel@i-love.sakur
                   |                            |a.ne.jp

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/21020] reorganize argument passing from java probes
  2017-01-03 14:38 [Bug runtime/21020] New: reorganize argument passing from java probes fche at redhat dot com
  2017-01-04  0:10 ` [Bug runtime/21020] " penguin-kernel@i-love.sakura.ne.jp
@ 2017-01-06 22:44 ` fche at redhat dot com
  2017-01-10  2:36 ` penguin-kernel@i-love.sakura.ne.jp
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2017-01-06 22:44 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=21020

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
commit f8bc2a5eb3e9

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/21020] reorganize argument passing from java probes
  2017-01-03 14:38 [Bug runtime/21020] New: reorganize argument passing from java probes fche at redhat dot com
  2017-01-04  0:10 ` [Bug runtime/21020] " penguin-kernel@i-love.sakura.ne.jp
  2017-01-06 22:44 ` fche at redhat dot com
@ 2017-01-10  2:36 ` penguin-kernel@i-love.sakura.ne.jp
  2017-01-10  2:49 ` fche at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: penguin-kernel@i-love.sakura.ne.jp @ 2017-01-10  2:36 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=21020

--- Comment #2 from Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> ---
Thank you for the patch. Let me confirm again.

As of systemtap-3.0-7.el7 , it is possible to access java.lang.String argument
because $arg1 in method2 points to a valid address.

--------------------------------------------------------------------------------
# stap --compatible=3.0 -e 'probe
java("Test1").class("Test1").method("method1(int)") { printf("Hooked method1()
with arg = %d\n", $arg1); }
probe java("Test1").class("Test1").method("method2(String)") { printf("Hooked
method2() with arg = %s\n", user_string($arg1)); }
probe java("Test1").class("Test1").method("method3") { printf("Hooked
method3()\n"); }' -c 'java Test1'
100
Hello
Test1@73549af8
Setting org.jboss.byteman.transform.all=true
100
Hello
Test1@73549af8
Hooked method1() with arg = 100
Hooked method2() with arg = Hello
Hooked method3()
--------------------------------------------------------------------------------

If I built correctly from git source, as of commit f8bc2a5eb3e91ce7
"PR21020: reorganize data passing abi for java method parameters",
it is no longer possible to access java.lang.String argument using
--compatible=3.0 option because $arg1 in method2 points to NULL.
Is this what you meant?

--------------------------------------------------------------------------------
# stap --compatible=3.1 -e 'probe
java("Test1").class("Test1").method("method1(int)") { printf("Hooked method1()
with arg = %s\n", arg1); }
probe java("Test1").class("Test1").method("method2(String)") { printf("Hooked
method2() with arg = %s\n", arg1); }
probe java("Test1").class("Test1").method("method3(Test1)") { printf("Hooked
method3() with arg = %s\n", arg1); }' -c 'java Test1'
100
Hello
Test1@73549af8
Setting org.jboss.byteman.transform.all=true
100
Hello
Test1@73549af8
Hooked method1() with arg = 100
Hooked method2() with arg = Hello
Hooked method3() with arg = Test1@73549af8
--------------------------------------------------------------------------------
# stap --compatible=3.0 -e 'probe
java("Test1").class("Test1").method("method1(int)") { printf("Hooked method1()
with arg = %d\n", $arg1); }
probe java("Test1").class("Test1").method("method2(String)") { printf("Hooked
method2() with arg = %d\n", $arg1); }
probe java("Test1").class("Test1").method("method3(Test1)") { printf("Hooked
method3() with arg = %d\n", $arg1); }' -c 'java Test1'
100
Hello
Test1@73549af8
Setting org.jboss.byteman.transform.all=true
100
Hello
Test1@73549af8
Hooked method1() with arg = 100
Hooked method2() with arg = 0
Hooked method3() with arg = 0
--------------------------------------------------------------------------------

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/21020] reorganize argument passing from java probes
  2017-01-03 14:38 [Bug runtime/21020] New: reorganize argument passing from java probes fche at redhat dot com
                   ` (2 preceding siblings ...)
  2017-01-10  2:36 ` penguin-kernel@i-love.sakura.ne.jp
@ 2017-01-10  2:49 ` fche at redhat dot com
  2017-01-11  2:16 ` penguin-kernel@i-love.sakura.ne.jp
  2017-01-11  2:41 ` fche at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2017-01-10  2:49 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=21020

--- Comment #3 from Frank Ch. Eigler <fche at redhat dot com> ---
> If I built correctly from git source, as of commit f8bc2a5eb3e91ce7
> "PR21020: reorganize data passing abi for java method parameters",
> it is no longer possible to access java.lang.String argument using
> --compatible=3.0 option because $arg1 in method2 points to NULL.
> Is this what you meant?

Yeah, this was a side-effect of code cleanup.  Passing strings under
the previous abi implied a memory leak (a strdup for every call that
was not freed, because every type was cast to an int64_t).  That leak
is fixed under --compatible=3.0 but at the cost of not having strings
be copied at all.  That is a regression, but it didn't seem like a
big one.  Do you think it is important to have it work under
--compatible=3.0?

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/21020] reorganize argument passing from java probes
  2017-01-03 14:38 [Bug runtime/21020] New: reorganize argument passing from java probes fche at redhat dot com
                   ` (3 preceding siblings ...)
  2017-01-10  2:49 ` fche at redhat dot com
@ 2017-01-11  2:16 ` penguin-kernel@i-love.sakura.ne.jp
  2017-01-11  2:41 ` fche at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: penguin-kernel@i-love.sakura.ne.jp @ 2017-01-11  2:16 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=21020

--- Comment #4 from Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> ---
Created attachment 9747
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9747&action=edit
A patch for making user_string($argN) work under --compatible=3.0

(In reply to Frank Ch. Eigler from comment #3)
> > If I built correctly from git source, as of commit f8bc2a5eb3e91ce7
> > "PR21020: reorganize data passing abi for java method parameters",
> > it is no longer possible to access java.lang.String argument using
> > --compatible=3.0 option because $arg1 in method2 points to NULL.
> > Is this what you meant?
> 
> Yeah, this was a side-effect of code cleanup.  Passing strings under
> the previous abi implied a memory leak (a strdup for every call that
> was not freed, because every type was cast to an int64_t).  That leak
> is fixed under --compatible=3.0 but at the cost of not having strings
> be copied at all.  That is a regression, but it didn't seem like a
> big one.  Do you think it is important to have it work under
> --compatible=3.0?

Then, I appreciate if some explanation is added because the memory leak
was occurring as long as methods with java.lang.String argument is probed
regardless of whether user_string($argN) was used by the script side.
For example, something like below.

  Note that previously there was a memory leak when methods with
  java.lang.String argument are probed, and there was a crash when
  methods with Java objects argument other than java.lang.String are
  probed. These problems are fixed now, but it became impossible to
  use user_string($argN) for reading java.lang.String argument under
  --compatible=3.0 .

By the way, I don't think it is difficult to make user_string($argN) work
under --compatible=3.0 because we can pass a flag whether we need to call
free() to determine_java_type() (something like a patch attached).

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/21020] reorganize argument passing from java probes
  2017-01-03 14:38 [Bug runtime/21020] New: reorganize argument passing from java probes fche at redhat dot com
                   ` (4 preceding siblings ...)
  2017-01-11  2:16 ` penguin-kernel@i-love.sakura.ne.jp
@ 2017-01-11  2:41 ` fche at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2017-01-11  2:41 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=21020

--- Comment #5 from Frank Ch. Eigler <fche at redhat dot com> ---
Thanks for continuing to work on this.  I merged your patch, so
we're good for both 3.0 and 3.1+ APIs now.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-01-11  2:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 14:38 [Bug runtime/21020] New: reorganize argument passing from java probes fche at redhat dot com
2017-01-04  0:10 ` [Bug runtime/21020] " penguin-kernel@i-love.sakura.ne.jp
2017-01-06 22:44 ` fche at redhat dot com
2017-01-10  2:36 ` penguin-kernel@i-love.sakura.ne.jp
2017-01-10  2:49 ` fche at redhat dot com
2017-01-11  2:16 ` penguin-kernel@i-love.sakura.ne.jp
2017-01-11  2:41 ` fche at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).