From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2268 invoked from network); 23 Feb 2000 18:54:38 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 Feb 2000 18:54:38 -0000 Received: (qmail 3043 invoked by alias); 23 Feb 2000 18:54:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9850 Received: (qmail 3036 invoked from network); 23 Feb 2000 18:54:32 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: parser (was: Re: PATCH: Improved _mailboxes) In-reply-to: "Sven Wischnowsky"'s message of "Wed, 23 Feb 2000 14:21:44 +0100." <200002231321.OAA00470@beta.informatik.hu-berlin.de> Date: Wed, 23 Feb 2000 18:58:28 +0000 From: Peter Stephenson Message-Id: This will probably be my last email for a while... Sven Wischnowsky wrote: > Here is the first of the two. As I said, this mainly makes the parser > create wordcode directly, no more extra compilation phase. I'm getting a core dump in zfinit from my .zshrc (after both patches, in fact). It's in text.c. Actually, there seem to be two bugs there. One happens when a function is empty and you run `which' or equivalent: getpermtext() calls gettext2() without realising that the prog.len is zero, so it's only going to find garbage. This must be because the code for end-of-text is not being added, or if it was removed it's not being tested enough. I can't offhand see what's causing the second, but this seems to tickle it on my system (although I only tried this after masking out the previous one by putting an if (prog.len) before the call to gettext2()): chpwd() { if [[ ${+ZFTP_USER} = 1 && -n $ZFTP_USER ]]; then zftp_chpwd else [[ -t 1 && -t 2 ]] && header -P "%m: %~"; fi } which chpwd causes a crash with a backtrace as follows, although it's probably more useful to know that it seems to go wrong at the start of the second `[['. #0 0x808d07f in taddstr (s=0x1e97c27d
) at text.c:60 #1 0x808d154 in taddlist (state=0x7fffe000, num=3721) at text.c:81 #2 0x808d746 in gettext2 (state=0x7fffe000) at text.c:368 #3 0x808d246 in getpermtext (prog=0x80cd968, c=0x1) at text.c:126 #4 0x80667f8 in printshfuncnode (hn=0x80cd8e8, printflags=16) at hashtable.c:882 #5 0x80551aa in bin_whence (nam=0x2aac07d8 "which", argv=0x7ffff080, ops=0x7ffff0d0 "", func=0) at builtin.c:2346 #6 0x8051bbd in execbuiltin (args=0x2aac07b8, bn=0x809d898) at builtin.c:367 #7 0x805df93 in execcmd (state=0x7ffff354, input=0, output=0, how=18, last1=2) at exec.c:2235 #8 0x805b9ef in execpline2 (state=0x7ffff354, pcode=579, how=18, input=0, output=0, last1=0) at exec.c:1172 #9 0x805b235 in execpline (state=0x7ffff354, slcode=4098, how=18, last1=0) at exec.c:965 #10 0x805ad98 in execlist (state=0x7ffff354, dont_change_job=0, exiting=0) at exec.c:812 #11 0x805ab7a in execode (p=0x7fffe000, dont_change_job=0, exiting=135061469) at exec.c:721 #12 0x806a744 in loop (toplevel=1, justonce=0) at init.c:144 #13 0x80512ee in main (argc=2, argv=0x7ffff3f4) at ./main.c:86 -- Peter Stephenson