From owner-freebsd-stable@FreeBSD.ORG Wed Sep 10 03:56:29 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCCED1065670 for ; Wed, 10 Sep 2008 03:56:29 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA04.westchester.pa.mail.comcast.net (qmta04.westchester.pa.mail.comcast.net [76.96.62.40]) by mx1.freebsd.org (Postfix) with ESMTP id 790C08FC08 for ; Wed, 10 Sep 2008 03:56:29 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA06.westchester.pa.mail.comcast.net ([76.96.62.51]) by QMTA04.westchester.pa.mail.comcast.net with comcast id CoAU1a00416LCl054rwULa; Wed, 10 Sep 2008 03:56:28 +0000 Received: from koitsu.dyndns.org ([67.180.253.227]) by OMTA06.westchester.pa.mail.comcast.net with comcast id CrwT1a0054v8bD73SrwTQm; Wed, 10 Sep 2008 03:56:28 +0000 X-Authority-Analysis: v=1.0 c=1 a=F57054OXJVUA:10 a=1nJSF2KShEoA:10 a=6I5d2MoRAAAA:8 a=QycZ5dHgAAAA:8 a=GmBWPKeE6vAahemVGRIA:9 a=eYh4KNuR5No3t-BiaTwA:7 a=4VIpmlAhbmH0EcjJgzUctXmJIgUA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id 336A717B84E; Tue, 9 Sep 2008 20:56:27 -0700 (PDT) Date: Tue, 9 Sep 2008 20:56:27 -0700 From: Jeremy Chadwick To: Mike Tancsa Message-ID: <20080910035627.GA14487@icarus.home.lan> References: <200809011505.m81F5UwC062968@repoman.freebsd.org> <200809100231.m8A2VliB098720@lava.sentex.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200809100231.m8A2VliB098720@lava.sentex.ca> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-stable@freebsd.org, "David E. O'Brien" Subject: Re: cvs commit: src/usr.bin/netstat Makefile bpf.c inet.c pfkey.c route.c sctp.c X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Sep 2008 03:56:29 -0000 On Tue, Sep 09, 2008 at 10:31:46PM -0400, Mike Tancsa wrote: > > Hi, > The change below seems to make netstat -B on RELENG_7 coredump > netstat -B > > specifically, > > - printf("%5d %6s %7s %9lu %9lu %9lu %5d %5d %s\n", > + printf("%5d %6s %7s %9ju %9ju %9ju %5d %5d %s\n", > > ... > > Not sure if its a netstat issue or a libc issue as it works fine in HEAD The commit: http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/netstat/bpf.c.diff?r1=1.9.2.1;r2=1.9.2.2;f=h Explanation: The variables being printed (bd_rcount, bd_dcount and bd_fcount) are all u_long on RELENG_7 i386 and amd64. See include/net/bpfdesc.h. %lu = unsigned long (i386 returns 4, amd64 returns 8) %ju = unsigned intmax_t (i386 returns 8, amd64 returns 8) The segfault reason should be obvious here; u_long != unsigned intmax_t on i386. This is specific to i386 (which I see you're using from the gdb output); it works fine on amd64. The commit should be backed out or re-worked to work on i386, or more bpf-related pieces from HEAD need to be MFC'd. The reason it might work in HEAD (did you test HEAD i386 or HEAD amd64?) is that HEAD might have the variables in bpfdesc.h declared as something like unsigned intmax_t, which might be a better solution, but MFC'ing that could break things. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |