NetBSD Problem Report #50019

From dmb@yenn.ulegend.net  Wed Jul  1 22:59:12 2015
Return-Path: <dmb@yenn.ulegend.net>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D988BA567D
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  1 Jul 2015 22:59:11 +0000 (UTC)
Message-Id: <20150701225905.8BEB04F4D2@yenn.ulegend.net>
Date: Wed,  1 Jul 2015 22:59:05 +0000 (UTC)
From: dmb@yenn.ulegend.net
Reply-To: dmb@yenn.ulegend.net
To: gnats-bugs@gnats.NetBSD.org
Subject: net/bmon shows tap(4) interface name with garbage at the end
X-Send-Pr-Version: 3.95

>Number:         50019
>Category:       pkg
>Synopsis:       net/bmon shows tap(4) interface name with garbage at the end
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 01 23:00:01 +0000 2015
>Closed-Date:    Sat Apr 28 07:24:50 +0000 2018
>Last-Modified:  Sat Apr 28 07:24:50 +0000 2018
>Originator:     Dominik Bialy
>Release:        NetBSD 6.1_STABLE
>Organization:
None
>Environment:


System: NetBSD yenn 6.1_STABLE NetBSD 6.1_STABLE (YENN) #0: Mon Feb 9 22:57:44 UTC 2015 builds@yenn:/usr/obj/sys/arch/amd64/compile/YENN amd64
Architecture: x86_64
Machine: amd64
>Description:

	bmon(1) shows tap0 interface on this system as ``tap0�^K��c^C.''

	Probably the kernel driver is missing some '\0'.

	This has been observed in netbsd-5 and netbsd-6.  netbsd-3 didn't
	have this issue.

>How-To-Repeat:

	Run bmon(1) on a system where tap(4) interface is configured, and watch
	garbage on the screen.
>Fix:

	Not known.

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/50019: bmon(1) shows tap(4) interface name with garbage at the end
Date: Thu, 2 Jul 2015 09:51:12 +0200

 What is bmon(1) ?

 Sounds like a bug in that program to me.

 Martin

From: Dominik Bialy <dmb@yenn.ulegend.net>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, dmb@yenn.ulegend.net
Subject: Re: kern/50019: bmon(1) shows tap(4) interface name with garbage at
 the end
Date: Thu, 2 Jul 2015 12:39:49 +0200

 On Thu, Jul 02, 2015 at 07:55:00AM +0000, Martin Husemann wrote:
 > The following reply was made to PR kern/50019; it has been noted by GNATS.
 > 
 > From: Martin Husemann <martin@duskware.de>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: kern/50019: bmon(1) shows tap(4) interface name with garbage at the end
 > Date: Thu, 2 Jul 2015 09:51:12 +0200
 > 
 >  What is bmon(1) ?
 >  
 >  Sounds like a bug in that program to me.
 >  
 >  Martin
 >  
 From net/bmon description:

 ``Bmon is an interface bandwidth monitor.  It is able to generate and
 draw three types of diagrams: The overview diagram which is a list of
 all interfaces and their send/receive rates.  A very MRTG like
 graphical diagram in ASCII showing the rate over a specific time
 period in a bar diagram.  The details diagram which contains all
 counters of an interface such as total bytes sent/received, errors,
 compressed packets and so on.''

 It might be that this is a bug in bmon, although it shows up only
 on tap(4) interfaces in NetBSD.

 If you are sure I made a mistake and it's a bug in that software,
 feel free to close the PR.  For me, it looks like there's something
 not NULL-terminated in NetBSD, but YOU are the NetBSD masters,
 not me ;)

 	Dominik

 -- 
 The Underlegend Networks' Free Shells -- http://www.ulegend.net/

From: Martin Husemann <martin@duskware.de>
To: Dominik Bialy <dmb@yenn.ulegend.net>
Cc: gnats-bugs@NetBSD.org
Subject: Re: kern/50019: bmon(1) shows tap(4) interface name with garbage at the end
Date: Thu, 2 Jul 2015 13:29:00 +0200

 On Thu, Jul 02, 2015 at 12:39:49PM +0200, Dominik Bialy wrote:
 > It might be that this is a bug in bmon, although it shows up only
 > on tap(4) interfaces in NetBSD.

 Does 

 	ifconfit -a

 show the name properly? What API is bmon using to query the names?

 You are talking about this one?

 	https://github.com/tgraf/bmon/

 > If you are sure I made a mistake and it's a bug in that software,
 > feel free to close the PR.

 No idea yet, but a non-terminated string where the spec requires a null
 terminated one would likely cause a lot more fallout, so I'd be
 slightly suprised.

 (side note: should there be a pkgsrc for it?)

 Martin

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org, dmb@yenn.ulegend.net
Cc: 
Subject: Re: kern/50019: bmon(1) shows tap(4) interface name with garbage at the end
Date: Thu, 2 Jul 2015 13:32:59 +0200

 ifconfig -a

 is what I meant, sorry.

From: Dominik Bialy <dmb@yenn.ulegend.net>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, dmb@yenn.ulegend.net
Subject: Re: kern/50019: bmon(1) shows tap(4) interface name with garbage at
 the end
Date: Thu, 2 Jul 2015 13:58:39 +0200

 On Thu, Jul 02, 2015 at 11:30:01AM +0000, Martin Husemann wrote:
 > The following reply was made to PR kern/50019; it has been noted by GNATS.
 > 
 > From: Martin Husemann <martin@duskware.de>
 > To: Dominik Bialy <dmb@yenn.ulegend.net>
 > Cc: gnats-bugs@NetBSD.org
 > Subject: Re: kern/50019: bmon(1) shows tap(4) interface name with garbage at the end
 > Date: Thu, 2 Jul 2015 13:29:00 +0200
 > 
 >  On Thu, Jul 02, 2015 at 12:39:49PM +0200, Dominik Bialy wrote:
 >  > It might be that this is a bug in bmon, although it shows up only
 >  > on tap(4) interfaces in NetBSD.
 >  
 >  Does 
 >  
 >  	ifconfit -a
 >  
 >  show the name properly? What API is bmon using to query the names?
 >  
 Yes, ifconfig -a shows `tap0' properly.

 It uses sysctl interface.

 In `sysctl -a' `tap0' looks OK, also.  So it seems you were right :)

 >  You are talking about this one?
 >  
 >  	https://github.com/tgraf/bmon/
 >  
 Maybe... (sorry, only w3m at hand, and didn't look deeply into the github
 page.)  Although in pkgsrc bmon is at version 2.0.1.  This looks like
 something newer.

 >  > If you are sure I made a mistake and it's a bug in that software,
 >  > feel free to close the PR.
 >  
 >  No idea yet, but a non-terminated string where the spec requires a null
 >  terminated one would likely cause a lot more fallout, so I'd be
 >  slightly suprised.
 >  
 >  (side note: should there be a pkgsrc for it?)
 >  
 It is in pkgsrc net/bmon, maybe we just need an update.

 	Dominik

 -- 
 The Underlegend Networks' Free Shells -- http://www.ulegend.net/

From: Martin Husemann <martin@duskware.de>
To: Dominik Bialy <dmb@yenn.ulegend.net>
Cc: gnats-bugs@NetBSD.org
Subject: Re: kern/50019: bmon(1) shows tap(4) interface name with garbage at the end
Date: Thu, 2 Jul 2015 14:59:58 +0200

 On Thu, Jul 02, 2015 at 01:58:39PM +0200, Dominik Bialy wrote:
 > It is in pkgsrc net/bmon, maybe we just need an update.

 Ah, thanks!

 But it works for me:

   #   Interface                RX Rate         RX #     TX Rate         TX #
 --------------------------------------------------------------------------------
 whoever-brings-the-night.aprisoft.de (source: local)                            
   0   bge0                     206.00B            1     223.00B            1
   1   lo0                      101.00B            1     101.00B            1
   2   tap0                       0.00B            0       0.00B            0

 But on the status line I get garbage for all interfaces:

 ÿÿÿÿ`0v interface, v next interface, <- prev node, -> next node, ? help     

 Might have to do with tons of -Wformat warnings I got during compilation.

 Martin

From: Dominik Bialy <dmb@yenn.ulegend.net>
To: Martin Husemann <martin@duskware.de>
Cc: Dominik Bialy <dmb@yenn.ulegend.net>, gnats-bugs@NetBSD.org
Subject: Re: kern/50019: bmon(1) shows tap(4) interface name with garbage at
 the end
Date: Thu, 2 Jul 2015 16:13:26 +0200

 On Thu, Jul 02, 2015 at 02:59:58PM +0200, Martin Husemann wrote:
 > But on the status line I get garbage for all interfaces:
 > 
 > ÿÿÿÿ`0v interface, v next interface, <- prev node, -> next node, ? help     
 > 
 > Might have to do with tons of -Wformat warnings I got during compilation.
 > 
 So I guess we should close the PR.  Sory for the noise :)

 	Dominik

 -- 
 The Underlegend Networks' Free Shells -- http://www.ulegend.net/

Responsible-Changed-From-To: kern-bug-people->pkg-manager
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Wed, 09 Sep 2015 06:41:06 +0000
Responsible-Changed-Why:
Nah, let's just make it a bug against the net/bmon package.
Stuff should work; one of the reasons we have pkgsrc is so we can patch
things when they don't.


State-Changed-From-To: open->feedback
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Tue, 03 Nov 2015 18:53:12 +0000
State-Changed-Why:
I just committed an update to bmon-3.8, does this fix your problem?


From: Dominik Bialy <dmb@yenn.ulegend.net>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
	bsiegert@NetBSD.org, dmb@yenn.ulegend.net
Subject: Re: pkg/50019 (net/bmon shows tap(4) interface name with garbage at
 the end)
Date: Wed, 4 Nov 2015 06:35:16 +0100

 On Tue, Nov 03, 2015 at 06:53:12PM +0000, bsiegert@NetBSD.org wrote:
 > Synopsis: net/bmon shows tap(4) interface name with garbage at the end
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: bsiegert@NetBSD.org
 > State-Changed-When: Tue, 03 Nov 2015 18:53:12 +0000
 > State-Changed-Why:
 > I just committed an update to bmon-3.8, does this fix your problem?
 > 
 Now it doesn't compile for me.

 I did only cvs up -rHEAD -dPA in net/bmon, since I'm using
 stable pkgsrc branch.

 Here's the log:

 ======================================================================
 [...]
   CC       bmon-in_netlink.o
   CC       bmon-in_null.o
   CC       bmon-in_dummy.o
   CC       bmon-in_proc.o
   CC       bmon-in_sysctl.o
 In file included from /usr/include/machine/lock.h:3:0,
                  from /usr/include/sys/lock.h:74,
                  from /usr/include/uvm/uvm_extern.h:472,
                  from /usr/include/sys/sysctl.h:49,
                  from in_sysctl.c:39:
 /usr/include/x86/lock.h:86:2: error: expected ')' before '__attribute__'
 /usr/include/x86/lock.h:86:2: error: expected ',' or ';' before ')' token
 /usr/include/x86/lock.h:88:2: error: expected ')' before '__attribute__'
 /usr/include/x86/lock.h:88:2: error: expected ',' or ';' before ')' token
 /usr/include/x86/lock.h:90:2: error: expected ')' before '__attribute__'
 /usr/include/x86/lock.h:90:2: error: expected ',' or ';' before ')' token
 /usr/include/x86/lock.h:92:2: error: expected ')' before '__attribute__'
 /usr/include/x86/lock.h:92:2: error: expected ',' or ';' before ')' token
 in_sysctl.c: In function 'sysctl_read':
 in_sysctl.c:229:3: warning: format '%u' expects type 'unsigned int', but argument 4 has type '__uint64_t'
 in_sysctl.c:229:3: warning: format '%u' expects type 'unsigned int', but argument 4 has type '__uint64_t'
 in_sysctl.c:232:3: warning: format '%u' expects type 'unsigned int', but argument 4 has type '__uint64_t'
 in_sysctl.c:232:3: warning: format '%u' expects type 'unsigned int', but argument 4 has type '__uint64_t'
 in_sysctl.c:235:59: error: 'struct if_data' has no member named 'ifi_recvquota'
 in_sysctl.c:238:59: error: 'struct if_data' has no member named 'ifi_xmitquota'
 *** Error code 1

 Stop.
 make: stopped in /pkg_comp/obj/pkgsrc/net/bmon/default/bmon-3.8/src
 *** Error code 1

 Stop.
 make: stopped in /pkg_comp/obj/pkgsrc/net/bmon/default/bmon-3.8
 *** Error code 1

 Stop.
 make: stopped in /usr/pkgsrc/net/bmon
 *** Error code 1

 Stop.
 make: stopped in /usr/pkgsrc/net/bmon
 *** Error code 1

 Stop.
 make: stopped in /usr/pkgsrc/net/bmon
 ======================================================================

 Do you have any idea?  Maybe it's something wrong with my
 configuration.

 Also... One of the old patches you removed was, I think, to allow
 compilation with NetBSD sysctl headers.

 Thank you for your work!
 	Dominik


 -- 
 -   The Underlegend Networks' Free Shell!  (a kewl place on teh interwebs!)
 -   http://yenn.ulegend.net/
 -   gopher://yenn.ulegend.net/
 -   telnet/ssh yenn.ulegend.net - anonymous/anonymous

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	dmb@yenn.ulegend.net
Subject: Re: pkg/50019 (net/bmon shows tap(4) interface name with garbage at
 the end)
Date: Wed, 4 Nov 2015 06:40:03 +0000

 On Wed, Nov 04, 2015 at 05:40:00AM +0000, Dominik Bialy wrote:
  >  In file included from /usr/include/machine/lock.h:3:0,
  >                   from /usr/include/sys/lock.h:74,
  >                   from /usr/include/uvm/uvm_extern.h:472,
  >                   from /usr/include/sys/sysctl.h:49,
  >                   from in_sysctl.c:39:
  >  /usr/include/x86/lock.h:86:2: error: expected ')' before '__attribute__'
  >  /usr/include/x86/lock.h:86:2: error: expected ',' or ';' before ')' token
  >  /usr/include/x86/lock.h:88:2: error: expected ')' before '__attribute__'
  >  /usr/include/x86/lock.h:88:2: error: expected ',' or ';' before ')' token
  >  /usr/include/x86/lock.h:90:2: error: expected ')' before '__attribute__'
  >  /usr/include/x86/lock.h:90:2: error: expected ',' or ';' before ')' token
  >  /usr/include/x86/lock.h:92:2: error: expected ')' before '__attribute__'
  >  /usr/include/x86/lock.h:92:2: error: expected ',' or ';' before ')' token

 That appears to be choking on __unused, which is odd...

  >  in_sysctl.c: In function 'sysctl_read':
  >  in_sysctl.c:229:3: warning: format '%u' expects type 'unsigned int', but argument 4 has type '__uint64_t'
  >  in_sysctl.c:229:3: warning: format '%u' expects type 'unsigned int', but argument 4 has type '__uint64_t'
  >  in_sysctl.c:232:3: warning: format '%u' expects type 'unsigned int', but argument 4 has type '__uint64_t'
  >  in_sysctl.c:232:3: warning: format '%u' expects type 'unsigned int', but argument 4 has type '__uint64_t'

 (these should probably be patched)

  >  in_sysctl.c:235:59: error: 'struct if_data' has no member named 'ifi_recvquota'
  >  in_sysctl.c:238:59: error: 'struct if_data' has no member named 'ifi_xmitquota'

 dunno about this.

  >  Also... One of the old patches you removed was, I think, to allow
  >  compilation with NetBSD sysctl headers.

 I see a patch-src_in_sysctl.c from 2013, but it looks to be related to
 the original problem in this PR - null termination of interface names.

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 01 May 2016 05:22:06 +0000
State-Changed-Why:
feedback received and it's still broke


From: Dominik Bialy <dmb@yenn.ulegend.net>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
	dholland@NetBSD.org, dmb@yenn.ulegend.net
Subject: Re: pkg/50019 (net/bmon shows tap(4) interface name with garbage at
 the end)
Date: Tue, 18 Jul 2017 22:54:00 +0200

 On Sun, May 01, 2016 at 05:22:06AM +0000, dholland@NetBSD.org wrote:
 > Synopsis: net/bmon shows tap(4) interface name with garbage at the end
 > 
 > State-Changed-From-To: feedback->open
 > State-Changed-By: dholland@NetBSD.org
 > State-Changed-When: Sun, 01 May 2016 05:22:06 +0000
 > State-Changed-Why:
 > feedback received and it's still broke
 > 
 I think it now can be closed, since we don't have a NetBSD 6
 installation anymore, and it works fine on -7 and above.

 Thank you
 	Dominik

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 28 Apr 2018 07:24:50 +0000
State-Changed-Why:
Reported to work on -7 and -6 is near enough to EOL that realistically
nobody will get around to dealing with the problem.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.