Subject: Re: /usr/bin/w dumps core on mips
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Jason R Thorpe <thorpej@zembu.com>
List: port-mips
Date: 07/25/2000 09:17:54
On Tue, Jul 25, 2000 at 11:08:36PM +0900, Izumi Tsutsui wrote:

 > I notice 1.5_ALPHA /usr/bin/w dumps core on both pmax and newsmips:

Dumped core on everything else, too.

It's been fixed, and pulled up to netbsd-1-5 now, I believe.

 > 
 > ---
 > % ./w
 > 10:24PM  up 20 mins, 2 users, load averages: 0.12, 0.16, 0.19
 > USER   TTY FROM              LOGIN@  IDLE WHAT
 > Segmentation fault (core dumped)
 > proudia-% gdb w w.core
 > GNU gdb 4.17
 > Copyright 1998 Free Software Foundation, Inc.
 > GDB is free software, covered by the GNU General Public License, and you are
 > welcome to change it and/or distribute copies of it under certain conditions.
 > Type "show copying" to see the conditions.
 > There is absolutely no warranty for GDB.  Type "show warranty" for details.
 > This GDB was configured as "mipsel--netbsd"...
 > Core was generated by `w'.
 > Program terminated with signal 11, Segmentation fault.
 > Reading symbols from /usr/libexec/ld.elf_so...done.
 > Reading symbols from /usr/lib/libkvm.so.5...done.
 > Reading symbols from /usr/lib/libc.so.12...done.
 > #0  0x200fb734 in strlen () at /usr/src/lib/libc/arch/mips/string/strlen.S:1
 > 1	/*		$NetBSD: strlen.S,v 1.5 1996/09/17 01:32:36 jonathan Exp $	*/
 > (gdb) 
 > ---
 > 
 > Is the following patch correct?
 > 
 > --- w.c.orig	Tue Jul 25 22:50:34 2000
 > +++ w.c	Tue Jul 25 22:50:40 2000
 > @@ -319,8 +319,8 @@
 >  			    (int)(ep->utmp.ut_host + UT_HOSTSIZE - x), x);
 >  			p = buf;
 >  		}
 > -		(void)printf("%-*s %-2.2s %-*.*s ",
 > -		    lognamelen, ep->kp->p_login,
 > +		(void)printf("%-*.*s %-2.2s %-*.*s ",
 > +		    lognamelen, lognamelen, ep->kp->p_login,
 >  		    (strncmp(ep->utmp.ut_line, "tty", 3) &&
 >  		    strncmp(ep->utmp.ut_line, "dty", 3)) ?
 >  		    ep->utmp.ut_line : ep->utmp.ut_line + 3,
 > 
 > ---
 > Izumi Tsutsui
 > tsutsui@ceres.dti.ne.jp
 > 

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>