zsh-workers
 help / color / mirror / code / Atom feed
From: Travis Spencer <tspencer+zsh@cs.pdx.edu>
To: zsh-workers@sunsite.dk
Subject: Zsh killed when autoloaded function calls mislinked program
Date: Mon, 20 Dec 2004 12:20:59 -0800	[thread overview]
Message-ID: <20041220202059.GE11940@alan.cs.pdx.edu> (raw)

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


             reply	other threads:[~2004-12-20 21:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-20 20:20 Travis Spencer [this message]
2004-12-21 11:30 ` Peter Stephenson
2005-01-03 15:57   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041220202059.GE11940@alan.cs.pdx.edu \
    --to=tspencer+zsh@cs.pdx.edu \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).