Re: [current tinderbox] failure on amd64/amd64

From: Maxime Henrion <mux_at_freebsd.org>
Date: Thu, 17 Jun 2004 15:21:11 +0200
Liam J. Foy wrote:
> On Thu, 17 Jun 2004 05:47:25 -0400 (EDT)
> FreeBSD Tinderbox <tinderbox_at_freebsd.org> wrote:
> 
> > TB --- 2004-06-17 08:56:11 - tinderbox 2.3 running on freebsd-current.sentex.ca
> > TB --- 2004-06-17 08:56:11 - starting CURRENT tinderbox run for amd64/amd64
> > TB --- 2004-06-17 08:56:11 - checking out the source tree
> > TB --- 2004-06-17 08:56:11 - cd /home/tinderbox/sandbox/CURRENT/amd64/amd64
> > TB --- 2004-06-17 08:56:11 - /usr/bin/cvs -f -R -q -d/home/ncvs update -Pd -A src
> > TB --- 2004-06-17 09:01:06 - building world (CFLAGS=-O2 -pipe)
> > TB --- 2004-06-17 09:01:06 - cd /home/tinderbox/sandbox/CURRENT/amd64/amd64/src
> > TB --- 2004-06-17 09:01:06 - /usr/bin/make -B buildworld
> > >>> Rebuilding the temporary build tree
> > >>> stage 1.1: legacy release compatibility shims
> > >>> stage 1.2: bootstrap tools
> > >>> stage 2.1: cleaning up the object tree
> > >>> stage 2.2: rebuilding the object tree
> > >>> stage 2.3: build tools
> > >>> stage 3: cross tools
> > >>> stage 4.1: building includes
> > >>> stage 4.2: building libraries
> > >>> stage 4.3: make dependencies
> > >>> stage 4.4: building everything
> > [...]
> > cc -O2 -pipe    -o nos-tun nos-tun.o 
> > gzip -cn /tinderbox/CURRENT/amd64/amd64/src/sbin/nos-tun/nos-tun.8 > nos-tun.8.gz
> > ===> sbin/pfctl
> > cc -O2 -pipe  -Wall -Wmissing-prototypes -Wno-uninitialized -Wstrict-prototypes -I/tinderbox/CURRENT/amd64/amd64/src/sbin/pfctl/../../contrib/pf/pfctl -I/tinderbox/CURRENT/amd64/amd64/src/sbin/pfctl/../../sys/contrib/pf -DENABLE_ALTQ -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -c /tinderbox/CURRENT/amd64/amd64/src/contrib/pf/pfctl/pfctl.c
> > cc -O2 -pipe  -Wall -Wmissing-prototypes -Wno-uninitialized -Wstrict-prototypes -I/tinderbox/CURRENT/amd64/amd64/src/sbin/pfctl/../../contrib/pf/pfctl -I/tinderbox/CURRENT/amd64/amd64/src/sbin/pfctl/../../sys/contrib/pf -DENABLE_ALTQ -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -c parse.c
> > cc -O2 -pipe  -Wall -Wmissing-prototypes -Wno-uninitialized -Wstrict-prototypes -I/tinderbox/CURRENT/amd64/amd64/src/sbin/pfctl/../../contrib/pf/pfctl -I/tinderbox/CURRENT/amd64/amd64/src/sbin/pfctl/../../sys/contrib/pf -DENABLE_ALTQ -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -c /tinderbox/CURRENT/amd64/amd64/src/contrib/pf/pfctl/pfctl_parser.c
> > /tinderbox/CURRENT/amd64/amd64/src/contrib/pf/pfctl/pfctl_parser.c: In function `print_status':
> > /tinderbox/CURRENT/amd64/amd64/src/contrib/pf/pfctl/pfctl_parser.c:559: warning: long long int format, long unsigned int arg (arg 3)
> > *** Error code 1
> > 
> > Stop in /tinderbox/CURRENT/amd64/amd64/src/sbin/pfctl.
> > *** Error code 1
> > 
> > Stop in /tinderbox/CURRENT/amd64/amd64/src/sbin.
> > *** Error code 1
> > 
> > Stop in /tinderbox/CURRENT/amd64/amd64/src.
> > *** Error code 1
> > 
> > Stop in /tinderbox/CURRENT/amd64/amd64/src.
> > *** Error code 1
> > 
> > Stop in /tinderbox/CURRENT/amd64/amd64/src.
> > TB --- 2004-06-17 09:47:25 - WARNING: /usr/bin/make returned exit code  1 
> > TB --- 2004-06-17 09:47:25 - ERROR: failed to build world
> > TB --- 2004-06-17 09:47:25 - tinderbox aborted
> > 
> > _______________________________________________
> > freebsd-current_at_freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-current
> > To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
> 
> 
> The following patch should solve this problem I believe:
> 
> --- /usr/src/contrib/pf/pfctl/pfctl_parser.c	Thu Jun 17 13:20:07 2004
> +++ /home/liamfoy/pfctl_parser.c	Thu Jun 17 13:26:16 2004
> _at__at_ -555,7 +555,7 _at__at_
>  		printf("  %-25s %14u %14s\n", "current entries",
>  		    s->src_nodes, "");
>  		for (i = 0; i < SCNT_MAX; i++) {
> -			printf("  %-25s %14lld ", pf_scounters[i],
> +			printf("  %-25s %14lu ", pf_scounters[i],
>  				    s->scounters[i]);
>  			if (runtime > 0)
>  				printf("%14.1f/s\n",
> 
> 
> 
> Correct me if I am wrong :), would someone care to commit it if its fine?

It's actually not correct.  The scounters[i] here is of type u_int64_t,
so long is not the correct format here (longs are 32bit on many 32bit
architectures such as FreeBSD/i386).  The correct format to use here is
%llu (long long's are at least 64bit), with a cast to (unsigned long long),
but most of the time we prefer to use %ju and a cast to uintmax_t.  C99
also provides macros for fixed-size type formats, and we could thus use
the PRIu64 macro here, but we don't use them because they're too ugly.

I won't commit a fix because this code is in contrib/ and is maintained
by Max Laier (see /usr/src/MAINTAINERS).  I'm CC'ing him this mail though.

Cheers,
Maxime
Received on Thu Jun 17 2004 - 11:21:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:57 UTC