From spf@laurand.ath.cx  Mon Jun  3 09:14:39 2002
Return-Path: <spf@laurand.ath.cx>
Received: from laurand.ath.cx (ATours-101-1-5-225.abo.wanadoo.fr [80.14.80.225])
	by hub.freebsd.org (Postfix) with ESMTP id 7E4D937B403
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  3 Jun 2002 09:14:37 -0700 (PDT)
Received: from astra.laurand.net (localhost [IPv6:::1])
	by laurand.ath.cx (8.12.3/8.12.3) with ESMTP id g53GEMj7072878;
	Mon, 3 Jun 2002 18:14:22 +0200 (CEST)
	(envelope-from spf@astra.laurand.net)
Received: (from spf@localhost)
	by astra.laurand.net (8.12.3/8.12.3/Submit) id g53GEMkM072877;
	Mon, 3 Jun 2002 18:14:22 +0200 (CEST)
Message-Id: <200206031614.g53GEMkM072877@astra.laurand.net>
Date: Mon, 3 Jun 2002 18:14:22 +0200 (CEST)
From: Pierre-Francois LAURAND <pushf@free.fr>
Reply-To: Pierre-Francois LAURAND <pushf@free.fr>
To: FreeBSD-gnats-submit@freebsd.org
Cc: pushf@free.fr
Subject: -CURRENT: buildkernel stop in vnode_if.h due to gawk error in /sys/tools/vnode_if.awk
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         38864
>Category:       kern
>Synopsis:       -CURRENT: buildkernel stop in vnode_if.h due to gawk error in /sys/tools/vnode_if.awk
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 03 09:20:01 PDT 2002
>Closed-Date:    Tue Aug 13 09:51:35 PDT 2002
>Last-Modified:  Tue Aug 13 09:51:35 PDT 2002
>Originator:     Pierre-Francois LAURAND
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD curly 5.0-CURRENT FreeBSD 5.0-CURRENT #10: Fri May 17 12:58:55 CEST 2002 root@curly:/usr/obj/usr/src/sys/CURLY i386


>Description:

When trying to build a new -CURRENT kernel with "make KERNCONF=CURLY buildkernel" in /usr/src, the build stops at:

...snip...
cc -c -x assembler-with-cpp -DLOCORE -O2 -march=pentiumpro -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wno-format -ansi  -nostdinc -I-  -I. -I/usr/src/sys -I/usr/src/sys/dev -I/usr/src/sys/contrib/dev/acpica -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/../include  -D_KERNEL -ffreestanding -include opt_global.h -fno-common   -mpreferred-stack-boundary=2 -ffreestanding  /usr/src/sys/i386/i386/locore.s
cc -c -O2 -march=pentiumpro -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wno-format -ansi  -nostdinc -I-  -I. -I/usr/src/sys -I/usr/src/sys/dev -I/usr/src/sys/contrib/dev/acpica -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/../include  -D_KERNEL -ffreestanding -include opt_global.h -fno-common   -mpreferred-stack-boundary=2 -ffreestanding   vnode_if.c
In file included from /usr/src/sys/sys/vnode.h:549,
                 from vnode_if.c:10:
vnode_if.h:17: syntax error before ')' token
vnode_if.h:18: warning: function declaration isn't a prototype
vnode_if.h: In function `VOP_ISLOCKED':
vnode_if.h:22: `vp' undeclared (first use in this function)
vnode_if.h:22: (Each undeclared identifier is reported only once
vnode_if.h:22: for each function it appears in.)
vnode_if.h:23: `td' undeclared (first use in this function)
...snip...

vnode_if.h is automatically produced by /sys/tools/vnode_if.awk in a command line like :
awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src -h

The output of my -CURRENT awk --version is : GNU Awk 3.1.0.
In the awk script vnode_if.awk, at line 222 in the "print out function" for loop, when i should be 1, it reaches 0.12477970123291015625 (!).
In the others cases, i takes its right value, eg:
i should be 0: i == 0
i should be 1: i == 0.12477970123291015625
i should be 2: i == 2

The output of the script, vnode_if.h, which is rejected by cc, look like:

...snip...
extern struct vnodeop_desc vop_default_desc;
struct vop_islocked_args {
  struct vnodeop_desc *a_desc;
  struct vnode *a_vp;
  struct thread *a_td;
};
extern struct vnodeop_desc vop_islocked_desc;
static __inline int VOP_ISLOCKED(
  struct vnode *vp,
^^^^^^^^^^^^^^^^^^^^^^
  )
{
  struct vop_islocked_args a;
  int rc;
  a.a_desc = VDESC(vop_islocked);
  a.a_vp = vp;
  a.a_td = td;
  rc = VCALL(vp, VOFFSET(vop_islocked), &a);
  return (rc);
}
...snip...

For more detail, you should find my full vnode_if.h and build logs at:
http://laurand.ath.cx/freebsd/

I have tested vnode_if.awk on a 4.5-STABLE with gawk 3.0.6 and it seems to work well.
So, I think that it could be a -CURRENT gawk 3.1.0  bug (?).


>How-To-Repeat:

make buildkernel on -CURRENT with a fresh src three, and gawk 3.1.0

>Fix:

coming back to gawk 3.0.6 :-((



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: schweikh 
State-Changed-When: Tue Aug 13 09:48:26 PDT 2002 
State-Changed-Why:  
Transient problems like builds failing on -current should be discussed 
on current@FreeBSD.org, to which you are required to subscribe as a 
-current user. These things get sorted out very quickly as any broken 
build will be seen by a lot of people so there is never need to open a 
PR. 

In this case, gawk has been replaced by awk some time ago. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=38864 
>Unformatted:
