Bug 231257 - Valgrind omits path when executing script from shebang line.
Summary: Valgrind omits path when executing script from shebang line.
Status: RESOLVED WORKSFORME
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-18 23:47 UTC by Jeffrey Yasskin
Modified: 2015-04-01 15:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Yasskin 2010-03-18 23:47:17 UTC
Version:           3.6.0.SVN (using Devel)
OS:                Linux
Installed from:    Compiled sources

When executing a script found using the path, Linux 2.6.4 passes the full script path to the command mentioned on the #! line. Valgrind, at least versions 3.3.0, 3.5.0, and a custom-built 3.6.0-SVN, passes the PATH-less script name instead:


jyasskin@enki:~$ cat /tmp/test.sh
#!/bin/echo
jyasskin@enki:~$ test.sh
bash: test.sh: command not found
jyasskin@enki:~$ PATH=/tmp:$PATH test.sh
/tmp/test.sh
jyasskin@enki:~$ PATH=/tmp:$PATH valgrind -q test.sh
test.sh


This makes a difference when the #! line is /bin/sh on recent Debian and Ubuntu versions, where /bin/sh is dash instead of bash. Dash doesn't search for its argument in the path, expecting the kernel to have already resolved the script name.
Comment 1 Florian Krohm 2015-04-01 15:05:37 UTC
This appears to work in 3.10.1 and SVN turnk.
So I'm closing this.