zsh-workers
 help / color / mirror / code / Atom feed
* Zsh killed when autoloaded function calls mislinked program
@ 2004-12-20 20:20 Travis Spencer
  2004-12-21 11:30 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Travis Spencer @ 2004-12-20 20:20 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-01-03 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-20 20:20 Zsh killed when autoloaded function calls mislinked program Travis Spencer
2004-12-21 11:30 ` Peter Stephenson
2005-01-03 15:57   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).