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]

[Bug runtime/21020] reorganize argument passing from java probes


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.

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