Issue 47 in fabricate: Adding "shell=true" to run invocation does not work nicely with strace runner

20 views
Skip to first unread message

fabr...@googlecode.com

unread,
Jul 9, 2013, 7:58:12 AM7/9/13
to fabrica...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 47 by nuutti.k...@gmail.com: Adding "shell=true" to run
invocation does not work nicely with strace runner
http://code.google.com/p/fabricate/issues/detail?id=47

The idea of the "shell=true" argument is that the entire command line is
invoked via the shell. However, when StraceRunner is used, the independent
command-line arguments are merely appended to the strace line, converted to
a command-line. This means that a command like "touch foo.txt; touch
bar.txt" will result in strace invocation "strace -fo /tmp/tmp6VNsRF -e
trace=open,stat,stat64,lstat,lstat64,execve,exit_group,chdir,mkdir,rename,clone,vfork,fork,symlink,creat
touch foo.txt ; touch other.txt", which will mean that "bar.txt" does not
get marked as an output of the command: "touch foo.txt ; touch bar.txt":
{ "foo.txt": "output-d41d8cd98f00b204e9800998ecf8427e" }

The real fix is to instead translate such a line to "strace -fo
/tmp/tmp6VNsRF -e
trace=open,stat,stat64,lstat,lstat64,execve,exit_group,chdir,mkdir,rename,clone,vfork,fork,symlink,creat
/bin/sh -c 'touch foo.txt ; touch other.txt'", and not pass the shell=True
to the underlying subprocess.Popen.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

fabr...@googlecode.com

unread,
Aug 7, 2014, 3:06:30 AM8/7/14
to fabrica...@googlegroups.com

Comment #1 on issue 47 by Aoki.Takaaki: Adding "shell=true" to run
invocation does not work nicely with strace runner
http://code.google.com/p/fabricate/issues/detail?id=47

Sorry for very slow response,

I met same issue, and wrote a patch. It modifies structure of argument and
shell flag before calling strace.

I would be happy if this is still useful.

Takaaki Aoki

Attachments:
strace_shell.patch 960 bytes
FAB.py 230 bytes
dot.deps 339 bytes
Reply all
Reply to author
Forward
0 new messages