From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9554 invoked by alias); 23 Nov 2010 12:09:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28435 Received: (qmail 27250 invoked from network); 23 Nov 2010 12:09:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Tue, 23 Nov 2010 13:03:58 +0100 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: zsh froze under Mac OS X Message-ID: <20101123120358.GB1727@prunille.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <20101122144943.GA1727@prunille.vinc17.org> <101122073902.ZM13038@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <101122073902.ZM13038@torch.brasslantern.com> X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.21-6164-vl-r38670 (2010-10-13) --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2010-11-22 07:39:00 -0800, Bart Schaefer wrote: > On Nov 22, 3:49pm, Vincent Lefevre wrote: > } > } Call graph: > } 993 zexit > } 993 sourcehome > } 993 source > } 993 loop > > This indicates that it's reading your .zlogout file. Anything there > that could account for the behavior? I have the following: ---- source ~/.zdomain ---- which just has "domain=local.prunille". ---- if [[ -n $SSH_AUTH_SOCK ]] then if [[ `whence -w _call_sshagent` == '_call_sshagent: function' ]] then _call_sshagent -r elif [[ -n $SSH_AGENT_PID ]] then eval `ssh-agent -k` fi fi ---- Here "_call_sshagent -r" was executed. I've attached the source of this function. ---- [[ $OSTYPE == linux && $TTY == /dev/tty* ]] && clear [[ $OSTYPE == linux && -n $SSH_CLIENT && ${(M)${(f)"$(/dev/null ---- The OS isn't linux, so nothing should be done here. ---- true ---- So, it seems that zsh froze in _call_sshagent. > This ... > > } 2 exalias > } 1 exalias > } 1 gethashnode > } 1 gethashnode > > ... makes me suspect you've got a recursively-expanding alias involved, > but that's much less certain than that it's .zlogout related. Well, problems started to occur before I tried to exit zsh. There could have been a problem in .zlogout due to an earlier memory corruption or something like that. If this is memory corruption, then this could be the same bug I've been noticing for years... -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=_call_sshagent #!/usr/bin/env zsh # Usage: _call_sshagent [ -l | -r ] # -l: try to use an existing ssh-agent and change SSH_AUTH_SOCK # accordingly. This is useful for some non-login shells (no # possible clean-up by the .zlogout). # -r: remove the socket associated with the current process and # kill ssh-agent if there are no sockets any longer. # # Note: You should execute _call_sshagent from your .zlogin and have # the following code (or similar) in your .zlogout so that after you # exit the last login shell, the authentication agent is killed. # # if [[ -n $SSH_AUTH_SOCK ]] then # if [[ `whence -w _call_sshagent` == '_call_sshagent: function' ]] then # _call_sshagent -r # elif [[ -n $SSH_AGENT_PID ]] then # eval `ssh-agent -k` # fi # fi # # Also, if you use the "screen" utility and do SSH connections from # it, the shells started by screen should be login shells (thanks to # a line "shell -zsh" in your .screenrc) to make sure that ssh-agent # will still be running after you exit all the other shells. emulate -LR zsh local link=/tmp/ssh-agent-$USER local i=0 until (ln -s /dev/null $link.lock 2> /dev/null) do [[ $i -eq 0 ]] && echo "$0: waiting for lock" >&2 if [[ $((++i)) -eq 4 ]] then echo "$0: can't lock $link" >&2 return fi sleep 2 done local dir=`readlink $link` if [[ $1 == -r ]] then if [[ -O $link && -d $dir && -O $dir && $SSH_AUTH_SOCK == $link/* ]] then local others rm -f $SSH_AUTH_SOCK unset SSH_AUTH_SOCK others=($dir/agent.*(N=)) if [[ -z $others ]] then local pid=$(<$dir/ssh-agent.pid) rm -f $link $dir/ssh-agent.pid kill -TERM $pid kill_sshmasters fi else # Inconsistent data, try to kill ssh-agent in the standard way eval `ssh-agent -k` fi elif [[ $1 == -l ]] then if [[ -O $link && -d $dir && -O $dir ]] then local old old=($link/agent.*(N=[1])) if [[ -S $old ]] then SSH_AUTH_SOCK=$old ssh-add -l >& /dev/null if [[ $? -ne 2 ]] then export SSH_AUTH_SOCK=$old unset SSH_AGENT_PID fi else echo "$0: $old isn't a socket" >&2 fi fi else if [[ -O $link && -d $dir && -O $dir ]] then local old old=($link/agent.*(N=[1])) if [[ -S $old ]] then SSH_AUTH_SOCK=$old ssh-add -l >& /dev/null if [[ $? -eq 2 ]] then # The agent could not be contacted, assume that it has died rm -f $dir/agent.*(N) $dir/ssh-agent.pid && rmdir $dir rm -f $link rm -f $link.lock $0 return fi local new=$link/agent.$$ if [[ $new == $old ]] || ln -f $old $new; then export SSH_AUTH_SOCK=$new unset SSH_AGENT_PID else echo "$0: can't link $new -> $old" >&2 fi else echo "$0: $old isn't a socket" >&2 fi elif eval `ssh-agent`; then if ln -fs $SSH_AUTH_SOCK:h $link; then local old=$SSH_AUTH_SOCK echo $SSH_AGENT_PID > $link/ssh-agent.pid rm -f $link.lock $0 && rm -f $old return else echo "$0: can't symlink $dir -> $SSH_AUTH_SOCK:h" >&2 fi else echo "$0: can't call ssh-agent" >&2 fi fi rm -f $link.lock # $Id: _call_sshagent 14529 2006-10-22 10:13:13Z lefevre $ --PNTmBPCT7hxwcZjr--