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/19764] New: stap --tmpdir leaves useless tempdirs behind


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

            Bug ID: 19764
           Summary: stap --tmpdir leaves useless tempdirs behind
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: mcermak at redhat dot com
  Target Milestone: ---

Created attachment 9064
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9064&action=edit
proposed patch

I noticed that stap --use-server leaves empty directories in /tmp after its
operation:

=====
# pwd; ls
/tmp
# stap --use-server -e 'probe syscall.open { exit() }'
# ls
stapKEPhUo
#
=====

In this case stap calls stap-server and that calls stap ... --tmpdir ... again.
It turns out that systemtap_session::create_tmp_dir() gets called within the
systemtap_session ctor before the cmdline gets parsed, always creating the
tmpdir (regardless of the --tmpdir setting). Note that
systemtap_session::remove_tmp_dir() only removes the tmpdir if --tmpdir has not
been set on the cmdline. So in the above use-case, the tmpdir gets left on the
filesystem.

Attached patch removes create_tmp_dir() from the systemtap_session ctor and
calls it slightly later, after the cmdline parsing is finished. Then
create_tmp_dir() only creates the tmpdir if --tmpdir has not been set on the
cmdline.

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