Subject: bin/13624: sushi(8) segfaults on rc.conf edit, and blames user
To: None <gnats-bugs@gnats.netbsd.org>
From: None <itojun@itojun.org>
List: netbsd-bugs
Date: 08/03/2001 18:19:44
>Number:         13624
>Category:       bin
>Synopsis:       sushi(8) segfaults on rc.conf edit, and blames user
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 03 02:20:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jun-ichiro itojun Hagino
>Release:        1.5X
>Organization:
	itojun.org
>Environment:
	
System: NetBSD starfruit.itojun.org 1.5X NetBSD 1.5X (STARFRUIT) #546: Thu Aug 2 22:07:14 JST 2001 itojun@starfruit.itojun.org:/usr/home/itojun/NetBSD/src/sys/arch/i386/compile/STARFRUIT i386
Architecture: i386
Machine: i386
>Description:
	sushi(8) dumps core with the following /etc/rc.conf, and then blames
	the user like "your fault".
>How-To-Repeat:
itojun[starfruit:~/NetBSD/src/usr.sbin/sushi] sushi
(go into "System maintenance", then "Edit system configuration)
core dumped. your fault! (signal 10)
Abort
Program received signal SIGBUS, Bus error.
0x480f0391 in strlen ()                             F9=Shell     Script:    OFF
(gdb) trah                             F8=Image     F10=Exit     Log:       OFF
trace command requires an argument
(gdb) bt
#0  0x480f0391 in strlen ()
#1  0xbfbfdff0 in ?? ()
#2  0x80518f7 in form_generate (cqf=0x805cd78, 
    basedir=0x805e2a0 "/usr/share/sushi/system/rcconf", args=0xbfbfd0e4)
    at /home/itojun/NetBSD/src/usr.sbin/sushi/scanform.c:1495
#3  0x8051e1a in handle_form (
    basedir=0x805e2a0 "/usr/share/sushi/system/rcconf", 
    path=0xbfbfd0ec "/usr/share/sushi/system/rcconf/form", args=0xbfbfd0e4)
    at /home/itojun/NetBSD/src/usr.sbin/sushi/scanform.c:1590
#4  0x8055517 in handle_endpoint (
    path=0x805e2a0 "/usr/share/sushi/system/rcconf")
    at /home/itojun/NetBSD/src/usr.sbin/sushi/handlers.c:239
#5  0x804bd70 in navigate_menu (cqm=0x805e220, 
    basedir=0x805e240 "/usr/share/sushi/system", 
    ititle=0xbfbfd5ec "<C></5>System Maintenance\n\n")
    at /home/itojun/NetBSD/src/usr.sbin/sushi/sushi.c:268
#6  0x804bd5d in navigate_menu (cqm=0x805cd70, 
    basedir=0x8058c51 "sushi_topmenu", ititle=0x4816d854 "<C></5>Sushi\n\n")
    at /home/itojun/NetBSD/src/usr.sbin/sushi/sushi.c:265
#7  0x804b581 in main (argc=1, argv=0xbfbfd6b4)
    at /home/itojun/NetBSD/src/usr.sbin/sushi/sushi.c:118
#8  0x804b219 in ___start ()
(gdb) frame 2
#2  0x80518f7 in form_generate (cqf=0x805cd78, 
    basedir=0x805e2a0 "/usr/share/sushi/system/rcconf", args=0xbfbfd0e4)
    at /home/itojun/NetBSD/src/usr.sbin/sushi/scanform.c:1495
Source file is more recent than executable.
1495                            F[i].rcols = F[i].cols = strlen_data(ftp);
(gdb) print ftp
$1 = (FTREE_ENTRY *) 0x80a4640
(gdb) print *ftp
$2 = {cqSubFormHead = {cqh_first = 0x80a4640, cqh_last = 0x80a4640}, 
  cqFormEntries = {cqe_next = 0x80a4680, cqe_prev = 0x80a4600}, 
  desc = 0x805fef0 "Run newsyslog?", type = 5, required = 0, elen = 0, 
  data = 0x8069b00 "script1,newsyslog", 
  origdata = 0x8069b00 "script1,newsyslog", list = 0x80a8650}


#	$NetBSD: rc.conf,v 1.92 2000/08/06 21:34:17 thorpej Exp $
#
# see rc.conf(5) for more information.
#
# Use program=YES to enable program, NO to disable it. program_flags are
# passed to the program on the command line.
#

# Uncomment this if you want to use local paths in rc.
#
#export PATH=$PATH:/usr/pkg/sbin:/usr/pkg/bin:/usr/local/sbin:/usr/local/bin

# If this is not set to YES, the system will drop into single-user mode.
#
rc_configured=YES

# If this is set to NO, shutdown(8) will not run /etc/rc.shutdown.
#
do_rcshutdown=YES

# Basic network configuration
#

# Fully Qualified Internet Domain Name (a.k.a. hostname, e.g. foo.baz.edu).
# If blank, use /etc/myname.
#
hostname="starfruit.itojun.org"

# If there's only one way out of your network, set this to the hostname
# or the IP address of the router that will get your packets off the LAN.
# If blank, use /etc/mygate.
#
defaultroute=""

# The NIS domain name (formerly known as Yellow Pages); not in any way
# related to Internet domain names.
# If blank, use /etc/defaultdomain.
#
domainname=""

# Filesystems to mount early in boot-up.
# Note that `/var' is needed in $critical_filesystems_beforenet (or
# implied as part of `/') as certain services that need /var (such as
# dhclient) may be needed to get the network operational enough to mount
# the $critical_filesystems.
#
critical_filesystems_beforenet="/usr /var"
critical_filesystems=""

# Set this to YES if you have purposefully setup no swap partitions and
# don't want to be warned about it.
#
no_swap=NO

# One-time actions and programs on boot-up.
#
lkm=NO						# run /etc/rc.lkm
savecore=YES		savecore_flags="-z"
clear_tmp=YES					# clear /tmp after reboot
update_motd=YES					# updates /etc/motd
dmesg=YES		dmesg_flags=""		# write /var/run/dmesg.boot
accounting=NO					# needs /var/account/acct

# NOTE: default coredump name now set in /etc/sysctl.conf

# Security setting.  If $securelevel is non-empty, the system securelevel
# is set to this value early in the boot sequence.  Otherwise the default
# action is taken (see init(8)).
#
securelevel=""					# securelevel to set to

# To set the IP address of an interface either use
#  ifconfig_xxN="IP-NO"
# where xxN is the interface.  If this variable is not set then
# contents of the file /etc/ifconfig.xxN is used.

# Networking startup.
#
ipfilter=NO					# uses /etc/ipf.conf
ipnat=NO					# uses /etc/ipnat.conf
ipsec=NO					# uses /etc/ipsec.conf
ipmon=NO		ipmon_flags="-sn"	# syslog ipfilter messages
auto_ifconfig=YES				# config all avail. interfaces
net_interfaces=""				# used only if above is NO
flushroutes=YES					# flush routes in netstart
dhclient=NO					# behave as a DHCP client
dhclient_flags="wi0"				# blank: config all interfaces
ntpdate=NO		ntpdate_hosts=""	# blank: hosts in /etc/ntp.conf
ppp_peers=""					# /etc/ppp/peers to call
ip6mode="autohost"				# host, autohost or router
ip6sitelocal=NO
rtsol="NO"		rtsol_flags="wi0"	# for ip6mode=autohost only

# Daemons required by servers.  These are not needed for strictly client use.
#

# inetd is used to start the IP-based services enabled in /etc/inetd.conf
#
inetd=YES		inetd_flags="-l"	# -l logs libwrap

# rpcbind is used to look up RPC-based services.
#
rpcbind=NO		rpcbind_flags="-l"	# -l logs libwrap

# Commonly used daemons.
#
syslogd=YES		syslogd_flags="-s"	# -s "secure" unix domain only
cron=YES
named=YES		named_flags=""
timed=NO		timed_flags=""
ntpd=NO			ntpd_flags=""
sendmail=NO		sendmail_flags="-bd -q30m"
postfix=YES
lpd=NO			lpd_flags="-s"		# -s "secure" unix domain only
sshd=YES		sshd_flags=""

# Routing daemons.
#
routed=NO		routed_flags="-q"
gated=NO		gated_flags=""
mrouted=NO		mrouted_flags=""
route6d=NO		route6d_flags=""
rtsold=NO		rtsold_flags="-m wi0"	# not really routing daemon...

# Daemons used to boot other hosts over a network.
#
rarpd=NO		rarpd_flags="-a"
bootparamd=NO		bootparamd_flags=""
dhcpd=NO		dhcpd_flags="-q"
dhcrelay=NO		dhcrelay_flags=""
rbootd=NO		rbootd_flags=""
mopd=NO			mopd_flags="-a"
rtadvd=NO		rtadvd_flags=""

# X11 daemons.
#
xfs=NO			xfs_flags=""		# X11 font server
xdm=NO			xdm_flags=""		# X11 display manager; needs
						# wscons=YES for local displays.

# YP (NIS) daemons.
#
ypbind=NO		ypbind_flags=""
ypserv=NO		ypserv_flags="-d"
yppasswdd=NO		yppasswdd_flags=""

# NFS daemons and parameters.
#
nfs_client=YES					# enable client daemons
nfs_server=NO					# enable server daemons
			mountd_flags=""
			nfsd_flags="-6tun 4"
lockd=NO		lockd_flags=""
statd=NO		statd_flags=""
amd=NO			amd_flags="-l syslog -x error,noinfo,nostats"
			amd_dir=/amd			# mount dir
			amd_master=/etc/amd/master	# master map

# Heimdal Kerberos 5 KDC (with Kerberos IV compatibility)
kdc=YES			kdc_flags=""

# Other daemons.
#
rwhod=NO

# Hardware daemons.
#
apmd=YES		apmd_flags=""		# APM power management daemon.
screenblank=NO		screenblank_flags=""	# wscons and FBIO screenblanker

# Configuration of "wscons" console driver virtual screens.
#
wscons=YES		wscons_flags=""		# run /etc/rc.wscons

# Read in local configuration.
#
if [ -f /etc/rc.local.conf ]; then
	. /etc/rc.local.conf
fi
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: