Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Zsh killed when autoloaded function calls mislinked program



I've found that invoking an autoloaded function that calls a program
that isn't linked correctly kills zsh.

Here is the function that does this:


#!/usr/bin/zsh

local grep

if [[ -x /stash/travissu/bin/grep ]] &&
    /stash/travissu/bin/grep test /dev/null 2>/dev/null ; then

    grep=(/stash/travissu/bin/grep)

else

    grep=(grep)
fi

command $grep $*


Here is what happens when i run /stash/travissu/bin/grep from the
shell:


zsh> /stash/travissu/bin/grep
ld.so.1: /stash/travissu/bin/grep: fatal: libgcc_s.so.1: open failed:
No such file or directory
zsh: killed     /stash/travissu/bin/grep
zsh>


Now, if I chmod the script so it has execute permission, I get this:


zsh> echo $path | ./fn test
zsh> 


However, if I autoload it like this:


zsh> autoload -U fn
zsh> fn
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
zsh>


When I execute the autoloaded function, I get this:


zsh> echo $path | fn
Killed
tcsh>


Where tcsh is the shell I started zsh from.  

I am using zsh 4.2.1 on Solaris 9.

-- 

Regards,

Travis Spencer



Messages sorted by: Reverse Date, Date, Thread, Author