awk(1) segfaults when building kernel modules
Ruslan Ermilov
ru at FreeBSD.org
Wed Aug 10 21:07:39 UTC 2011
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 at 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 at FreeBSD.org
FreeBSD committer
More information about the freebsd-current
mailing list