From owner-freebsd-bugs@FreeBSD.ORG Thu Sep 14 21:40:29 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E4E4616A403 for ; Thu, 14 Sep 2006 21:40:29 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2DED243D5D for ; Thu, 14 Sep 2006 21:40:25 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k8ELePGs078299 for ; Thu, 14 Sep 2006 21:40:25 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k8ELeOIC078298; Thu, 14 Sep 2006 21:40:24 GMT (envelope-from gnats) Date: Thu, 14 Sep 2006 21:40:24 GMT Message-Id: <200609142140.k8ELeOIC078298@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: "Devon H. O'Dell" Cc: Subject: Re: bin/100443 : awk(1) dies with SIGBUS when processing INDEX-6 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Devon H. O'Dell" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 21:40:30 -0000 The following reply was made to PR bin/100443; it has been noted by GNATS. From: "Devon H. O'Dell" To: Dmitry Marakasov , bug-followup@FreeBSD.org Cc: Subject: Re: bin/100443 : awk(1) dies with SIGBUS when processing INDEX-6 Date: Thu, 14 Sep 2006 17:31:27 -0400 This is a multi-part message in MIME format. --------------050206020800080501080703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Got it. It was an off-by-one in fldbld(). Using the attached patch, I now get: > ./run.sh p5-Task-Catalyst-1.90 p5-Template-GD-2.66 The patch is attached, seems to not modify other awk behavior (or crash when the buffer becomes 8193 bytes, which it didn't anyway), and is also available at http://databits.net/~dho/awk.patch Do we need to send this upstream? --Devon --------------050206020800080501080703 Content-Type: text/plain; name="awk.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="awk.patch" Index: contrib/one-true-awk/lib.c =================================================================== RCS file: /home/ncvs/src/contrib/one-true-awk/lib.c,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 lib.c --- contrib/one-true-awk/lib.c 16 May 2005 19:11:33 -0000 1.1.1.4 +++ contrib/one-true-awk/lib.c 14 Sep 2006 21:27:10 -0000 @@ -266,7 +266,7 @@ getsval(fldtab[0]); r = fldtab[0]->sval; n = strlen(r); - if (n > fieldssize) { + if (n >= fieldssize) { xfree(fields); if ((fields = (char *) malloc(n+1)) == NULL) FATAL("out of space for fields in fldbld %d", n); --------------050206020800080501080703--