From owner-freebsd-bugs Fri Mar 12 10:50:16 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 9303B15613 for ; Fri, 12 Mar 1999 10:50:14 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id KAA71270; Fri, 12 Mar 1999 10:50:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Date: Fri, 12 Mar 1999 10:50:01 -0800 (PST) Message-Id: <199903121850.KAA71270@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Dave Bodenstab Subject: Re: gnu/10555: [PATCH] awk dumps core Reply-To: Dave Bodenstab Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR gnu/10555; it has been noted by GNATS. From: Dave Bodenstab To: ru@ucb.crimea.ua Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: gnu/10555: [PATCH] awk dumps core Date: Fri, 12 Mar 1999 12:45:20 -0600 Ruslan Ermilov wrote: > > >Number: 10555 > >Category: gnu > >Synopsis: [PATCH] awk dumps core > >Confidential: no > >Severity: non-critical > >Priority: low > >Responsible: freebsd-bugs > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: change-request > >Submitter-Id: current-users > >Arrival-Date: Fri Mar 12 02:30:01 PST 1999 > >Closed-Date: > >Last-Modified: > >Originator: Ruslan Ermilov > >Release: FreeBSD 3.1-STABLE i386 > >Organization: > United Commercial Bank > >Environment: > > 3.1-STABLE > GNU Awk 3.0.3 > > >Description: > > awk dumps core (signal 11) > > >How-To-Repeat: > > # awk '{ print $1,,$2 }' > awk: cmd. line:1: { print $1,,$2 } > awk: cmd. line:1: ^ parse error > awk: cmd. line:1: fatal error: internal error > Abort trap - core dumped > > GDB is free software and you are welcome to distribute copies of it > under certain conditions; type "show copying" to see the conditions. > There is absolutely no warranty for GDB; type "show warranty" for details. > GDB 4.16 (i386-unknown-freebsd), > Copyright 1996 Free Software Foundation, Inc... > Core was generated by `awk'. > Program terminated with signal 6, Abort trap. > Reading symbols from /usr/lib/libgnuregex.so.2...done. > Reading symbols from /usr/lib/libm.so.2...done. > Reading symbols from /usr/lib/libc.so.3...done. > Reading symbols from /usr/libexec/ld-elf.so.1...done. > #0 0x280d1c44 in _kill () > (gdb) bt > #0 0x280d1c44 in _kill () > #1 0x28105cf4 in abort () > #2 0x8058432 in catchsig (sig=11, code=12) > at /usr/src/gnu/usr.bin/awk/../../../contrib/awk/main.c:708 > #3 > #4 0x804d934 in append_right (list=0x0, new=0x806c990) at awktab.y:2114 > #5 0x804ae98 in yyparse () at awktab.y:630 > #6 0x8057cad in main (argc=2, argv=0xefbfdbe4) > at /usr/src/gnu/usr.bin/awk/../../../contrib/awk/main.c:373 > #7 0x8049635 in _start () > > >Fix: > > The following patch is for src/contrib/awk/awk.y: > > Index: awk.y > =================================================================== > RCS file: /usr/FreeBSD-CVS/src/contrib/awk/awk.y,v > retrieving revision 1.1.1.1 > diff -u -r1.1.1.1 awk.y > --- awk.y 1997/10/14 18:16:58 1.1.1.1 > +++ awk.y 1999/03/12 10:06:47 > @@ -2111,7 +2111,9 @@ > > oldlist = list; > if (savefront == oldlist) { > - savetail = savetail->rnode = new; > + savetail = new; > + if (savetail) > + savetail->rnode = new; > return oldlist; > } else > savefront = oldlist; > > >Release-Note: > >Audit-Trail: > >Unformatted: > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-bugs" in the body of the message This problem was fixed with the following patch from Arnold Robbins (the GNU awk maintainer.) I say this based on my having replaced FreeBSD's awk with GNU awk 3.0.3 with the following patch. Running the above example results in the "parse error" message and awk simply exits. Here is the patch: --- awk.y 1997/07/31 14:40:58 30.3.1.1 +++ awk.y 1997/09/26 16:39:37 30.3.1.2 @@ -2111,6 +2111,8 @@ register NODE *oldlist; static NODE *savefront = NULL, *savetail = NULL; + if (list == NULL || new == NULL) + return; oldlist = list; if (savefront == oldlist) { savetail = savetail->rnode = new; Seems to me that FreeBSD should track the original maintainer's version rather than fork off a FreeBSD-specific "fix". BTW, there have been other patches against 3.0.3 released by Arnold Robbins on the gnu.utils.bug news group. Regards, Dave Bodenstab imdave@mcs.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message