This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug runtime/19764] New: stap --tmpdir leaves useless tempdirs behind
- From: "mcermak at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Fri, 04 Mar 2016 13:56:02 +0000
- Subject: [Bug runtime/19764] New: stap --tmpdir leaves useless tempdirs behind
- Auto-submitted: auto-generated
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.