From owner-freebsd-current@FreeBSD.ORG Wed Aug 10 21:07:39 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from lo0.su (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by hub.freebsd.org (Postfix) with ESMTP id 8E18B106566C; Wed, 10 Aug 2011 21:07:38 +0000 (UTC) (envelope-from ru@FreeBSD.org) Date: Wed, 10 Aug 2011 21:11:53 +0000 From: Ruslan Ermilov To: Alexander Best Message-ID: <20110810211153.GA16245@lo0.su> References: <86obzxw2ys.fsf@gmail.com> <20110810200232.GA38421@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110810200232.GA38421@freebsd.org> Cc: Test Rat , freebsd-current@freebsd.org, Navdeep Parhar Subject: Re: awk(1) segfaults when building kernel modules X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 21:07:39 -0000 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 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