Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support running shell built-ins #140

Open
derekbruening opened this issue Nov 28, 2014 · 0 comments
Open

support running shell built-ins #140

derekbruening opened this issue Nov 28, 2014 · 0 comments

Comments

@derekbruening
Copy link
Contributor

From derek.br...@gmail.com on December 10, 2010 17:57:58

PR 459374

drmemory.sh bails if it can't find a file corresponding to the app to be
run: but some shell built-ins will work properly. e.g., "time", or
"setsid". we should let it run, and either handle a blank app in
the scripts or pass the shell name?

when I do:
$exepath = $ENV{'SHELL'} if (! -e $exepath)
then:
./drmemory.pl -dr /dr -ops "-pause_at_uninitialized" ./x.sh
=> works, but complains "objdump: ./x.sh: File format not recognized"

./drmemory.pl -dr /dr -ops "-pause_at_uninitialized" setsid ./x.sh
=> just exits: exec fails on "setsid": need to run as '/bin/ash -c "setsid ./x.sh'

PR 459374: support running shell built-ins and scripts

$exepath = $ENV{'SHELL'} if (! -e $exepath)

FIXME: not so sure we should support that: we'd have to run

with -c "cmdline" for some shells, which might conflict w/ quoting

in the app args: seems reasonable to require user to pass us a

real executable, so must prefix scripts with shell or perl.

yet this results in "Segmentation fault" (note: need extra layer of quotes):
./drmemory.pl -v -dr /dr -- /bin/ash -c '"setsid ./x.sh"'

TODO: analyze seg fault
TODO: document what we support and how to run scripts

Original issue: http://code.google.com/p/drmemory/issues/detail?id=140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant