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

Re: Bug#101523: zsh segmentation fault



On Tue, Jun 19, 2001 at 10:56:33PM +0200, Michal Politowski wrote:

> zsh segfaults when trying to source /usr/share/shoop/shoop.sh from the shoop package.
> Unfortunately this file is rather complicated and I can't provide a smaller
> example.

I can reproduce this with zsh --no-equals -fx shoop.sh

shoop.sh is attached
#!/bin/sh -e
# This script has been preprocessed prior to installation
# It has had comments, blank lines, and leading spaces
# removed, and \-style lines combined.  This was done so
# that it could run quicker under some shells.
_shoop () {
local TRUEOBJ=$1 TRYOBJ=$2 METH=$3 TRUEMETH=$1_$3 TRYMETH=$2_$3 LASTMETH=$METH
shift 3
case "$1" in
=|=q|=p|.=|.=q|.=p|.=qp|:|:p)
local varmeth=$1 append="" quiet="" private=""; shift
if [ "${varmeth%p}" != $varmeth ]; then private=1; varmeth=${varmeth%p}; fi
if [ "$_shoop_introspect" ] &&
eval [ -z \"\$_shooptype_$TRYMETH\$private\" ]; then
eval "_shoopdefines_$TRUEOBJ=\"\$_shoopdefines_$TRUEOBJ $METH\""
fi
if [ -z "$_shoopnocache_" ]; then
eval $_shoopcacheclear_
fi
if [ "${varmeth#.}" != $varmeth ]; then append=1 varmeth=${varmeth#.}; fi
if [ "${varmeth%q}" != $varmeth ]; then quiet=1 varmeth=${varmeth%q}; fi
if [ "$varmeth" = = ]; then
if [ "$append" ];then set -- "$(eval eval "\$_shoop_$TRUEMETH") $@"; fi
if [ ! "$quiet" ]; then echo -n $@; fi
eval "_shoop_$TRUEMETH='echo -n $@'
_shooptype_$TRUEMETH=variable"
else
if [ "$quiet" ]; then echo "Invalid modifier(q) on assignment!($TRUEOBJ.$METH)" >&2; fi
if [ "$append" ];then
eval eval "_shoop_$TRUEMETH=\'\$_shoop_$TRUEMETH;\$@\'
_shooptype_$TRUEMETH=method"
else
eval "_shoop_$TRUEMETH='$@'
_shooptype_$TRUEMETH=method"
fi
fi
return
;;esac
if eval [ \"\$_shooptype_$TRYMETH\" ]; then
local THIS=$TRUEOBJ
eval eval "\$_shoop_$TRYMETH"
return
else
eval local P PARENTS=\"$(eval eval "\$_shoop_${TRYOBJ}_parent")\"			THIS=$TRUEOBJ GETMETH="" NEWPARENTS=""
if [ -z "$_shoopnocache_" ]; then
eval local CACHE=\"\$_shoopcache_link_$TRUEMETH\"
if [ "$CACHE" ]; then
eval eval \$$CACHE
return
fi
fi
for P in $PARENTS; do
eval GETMETH=\"\$_shoop_${P}_$METH\"
if [ "$GETMETH" ]; then
eval "$GETMETH"
return
fi
NEWPARENTS="$NEWPARENTS $(eval eval "\$_shoop_${P}_parent")"
done
local orgargs="$@"
set -- $NEWPARENTS
while [ $# -gt 0 ];do
P=$1
eval GETMETH="\$_shoop_${P}_$METH"
if [ "$GETMETH" ]; then
set -- $orgargs
if [ -z "$_shoopnocache_" ]; then
eval _shoopcache_link_${THIS}_$METH=_shoop_${P}_$METH					     _shoopcache_=\"\$_shoopcache_						  _shoopcache_method_$METH _shoopcache_link_${THIS}_$METH \"					     _shoopcache_method_$METH=\"\$_shoopcache_method_$METH						  _shoopcache_link_${THIS}_$METH\"					     _shoopcache_linkmethod_${P}_$METH=\"\$_shoopcache_linkmethod_${P}_$METH						  _shoopcache_link_${THIS}_$METH\"
fi
eval "$GETMETH"
return
fi
shift
set -- $(eval eval "\$_shoop_${P}_parent") "$@"
done
echo "\"$METH\" is undefined for $TRYOBJ." >&2
return 1
fi
}
IFS=" " _shoopcacheclear_="
if eval [ \\\"\\\$_shoopcache_method_\$METH\\\" ]; then
if eval [ -z \\\"\\\$_shoopcache_linkmethod_\$TRUEMETH\\\" ]; then
eval unset _shoopcache_method_\$METH				 \\\$_shoopcache_method_\$METH				   _shoopcache_linkmethod_\$TRUEMETH				 \\\$_shoopcache_linkmethod_\$TRUEMETH
fi
fi
"
_shoop_introspect=1
IFS=" " _shoop OBJECT OBJECT new :p '
local OBJNAME=$1
eval "$OBJNAME () { shift; _shoop $OBJNAME $OBJNAME \"\$@\"; };"
if [ $THIS != $OBJNAME ]; then
_shoop $OBJNAME $OBJNAME parent = $THIS >/dev/null
fi
eval unset _shoopcache_ \$_shoopcache_ || true
'
_shoop OBJECT OBJECT new OBJECT
OBJECT . parent = ""
OBJECT . super :p '_shoop $THIS $($THIS . parent) "$LASTMETH" "$@"; return'
unset _shoop_introspect


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