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/16719] systemtap runs hold vmlinux file descriptor open


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

--- Comment #4 from Jonathan Lebon <jlebon at redhat dot com> ---
(In reply to Josh Stone from comment #1)
> 1-4 could be released for pass 5, and I think we do some, just not all.  I
> thought we did release all the dwfl handles, which would include the open
> vmlinux, but I could be wrong (or we could have something like a refcount
> leak).

Good call. That's exactly what's happening here. Those files are kept open by
libdw because their associated Dwfl objects are wrapped in shared_ptrs, and
although build_no_more() reduces the refcount, setupdwfl.cxx also holds its own
reference to it as a caching strategy (see setupdwfl.cxx:75).

Since pass 3 also requires access to those objects, this actually works in our
favour: build_no_more() lowers the refcount, and then we can completely lower
it and free the Dwfl object once pass 3 is completed. The attached patch shows
one straightforward way of doing this, placing it at the end of
translate_pass(). (Is there a better-suited place for this? Maybe in main.cxx's
passes_0_4()?).

-- 
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]