From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id IAA01913 for ; Sat, 3 Aug 1996 08:24:27 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id SAA29405; Fri, 2 Aug 1996 18:19:40 -0400 (EDT) Resent-Date: Fri, 2 Aug 1996 18:19:40 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199608022219.AAA07929@bolyai.cs.elte.hu> Subject: Re: more on crashes To: wfp5p@tigger.itc.virginia.edu (Bill Pemberton) Date: Sat, 3 Aug 1996 00:19:02 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu (Zsh workers list) In-Reply-To: <199608021842.OAA75406@tigger.itc.Virginia.EDU> from Bill Pemberton at "Aug 2, 96 02:42:34 pm" Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368 X-Mailer: ELM [version 2.4ME+ PL16 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"TcuQ8.0.NB7.xxd0o"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1906 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > In all cases I'm doing --enable-zsh-mem . > > Compiled on AIX 4.2 it crashes right when I hit the backspace for the 10th > time. Bill mailed me that bindkey -v was necessary for the crash. I tried it and after the 10th backpace zsh printed that someone tried to free more than allocated. Patch below. Zoltan --- Src/zle_utils.c 1996/07/28 19:50:55 2.11 +++ Src/zle_utils.c 1996/08/02 22:08:55 @@ -93,7 +93,7 @@ if ((vibuf[vibufspec].flags & CUTBUFFER_LINE) && !vilinerange) vibufappend = 0; if (!vibufappend || !vibuf[vibufspec].buf) { - zsfree(vibuf[vibufspec].buf); + zfree(vibuf[vibufspec].buf, vibuf[vibufspec].len); vibuf[vibufspec].buf = (char *)zalloc(ct); memcpy(vibuf[vibufspec].buf, (char *) line + i, ct); vibuf[vibufspec].len = ct; @@ -115,7 +115,7 @@ } else { /* Save in "1, shifting "1-"8 along to "2-"9 */ int n; - zsfree(vibuf[34].buf); + zfree(vibuf[34].buf, vibuf[34].len); for(n=34; n>26; n--) vibuf[n] = vibuf[n-1]; vibuf[26].buf = (char *)zalloc(ct);