Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Aug 2011 21:11:53 +0000
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Alexander Best <arundel@freebsd.org>
Cc:        Test Rat <ttsestt@gmail.com>, freebsd-current@freebsd.org, Navdeep Parhar <nparhar@gmail.com>
Subject:   Re: awk(1) segfaults when building kernel modules
Message-ID:  <20110810211153.GA16245@lo0.su>
In-Reply-To: <20110810200232.GA38421@freebsd.org>
References:  <86obzxw2ys.fsf@gmail.com> <CAPFoGT_EVNL5On9UYWwd%2Bvx5z4=8YYg%2BJjto6q2A9t89vrNqfg@mail.gmail.com> <20110810200232.GA38421@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 10, 2011 at 08:02:32PM +0000, Alexander Best wrote:
> On Wed Aug 10 11, Navdeep Parhar wrote:
> > On Wed, Aug 10, 2011 at 11:12 AM, Test Rat <ttsestt@gmail.com> wrote:
> > > `make -s buildkernel' seems to contain lots of segfaults after recent
> > > update of one-true-awk in r224731. It chokes on sys/conf/kmod_syms.awk.
> 
> just out of curiosity: what's the point of doing a vendor import during a
> beta phase? isn't this exactly the kind of stuff you DON'T want to do, because
> it can only turn out badly?

The previous version had a bug in handling the -v option
since the last import.  I sent a patch to bwk@ months ago,
but he only released the new version that included a fix
on August 7.

Unfortunately, while fixing another bug ("fixed day 1 bug
that resurrected deleted elements of ARGV when used as
filenames (in lib.c)."), not all code was fixed, and a NULL
pointer deference bug is triggered by the following code
snippet:

	awk 'BEGIN{delete ARGV[1]}{}' arg

%%%
Index: head/contrib/one-true-awk/lib.c
===================================================================
--- head/contrib/one-true-awk/lib.c	(revision 224760)
+++ head/contrib/one-true-awk/lib.c	(working copy)
@@ -89,8 +89,13 @@
 	char *p;
 
 	for (i = 1; i < *ARGC; i++) {
-		if (!isclvar(p = getargv(i))) {	/* find 1st real filename */
-			setsval(lookup("FILENAME", symtab), getargv(i));
+		p = getargv(i);	/* find 1st real filename */
+		if (p == NULL || *p == '\0') {	/* deleted or zapped */
+			argno++;
+			continue;
+		}
+		if (!isclvar(p)) {
+			setsval(lookup("FILENAME", symtab), p);
 			return;
 		}
 		setclvar(p);	/* a commandline assignment before filename */
%%%

> imho r224731 should completely be reverted. aren't those exactly the kind of
> commits re@ shouldn't approve?


-- 
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110810211153.GA16245>