Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jun 2003 00:36:13 +0800 (KRAST)
From:      Eugene Grosbein <eugen@grosbein.pp.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/52943: reproducable system stuck just brefore multiuser mode
Message-ID:  <200306041636.h54GaCqm000271@grosbein.pp.ru>
Resent-Message-ID: <200306041710.h54HAEhY016567@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         52943
>Category:       kern
>Synopsis:       reproducable system stuck just brefore multiuser mode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 04 10:10:12 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Eugene Grosbein
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD hp.grosbein.pp.ru 4.8-STABLE FreeBSD 4.8-STABLE #0: Sun Apr 13 14:05:36 KRAST 2003 eu@grosbein.pp.ru:/usr/local/smallobj/usr/local/src/sys/HP i386
	console=vidconsole

>Description:
	One of my machines hangs if I press ScrollLock when
	it runs /etc/rc and if I do not press ScrollLock again before
	/etc/rc.local finishes. If I press ScrollLock second time
	after /etc/rc.local has finished, syscons does not flush
	its buffer, system is stuck in a single user mode waiting
	for /bin/sh to exit. It won't: if I rlogin into the system,
	I see:

# ps -p 7 -wwl
  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
    0     7     1 141   4  0     0    0 ttywai IEs+ con    0:01,14 sh /etc/rc autoboot

	Note, that kernel is alive, I can press Ctrl-T, I can
        break to DDB and see:

load: 0.07 not a controlling terminal
Debugger("manual escape to debugger")
Stopped at      Debugger+0x35:  movb    $0,in_Debugger.429
db> ps
  pid   proc     addr    uid  ppid  pgrp  flag stat wmesg   wchan   cmd
  143 c27825a0 c2f1b000    0     1   143 000084  3  select c02f90e0 moused
  134 c2781be0 c2f48000    0     1   134 000084  3  select c02f90e0 apmd
  120 c2781f20 c2f37000   25     1   120 2000184  3   pause c2f37260 sendmail
  117 c2782260 c2f25000    0     1   117 000084  3  nanslp c02db310 cron
  115 c2782400 c2f20000    0     1   115 000084  3  select c02f90e0 inetd
  109 c27828e0 c2f13000    0     1   109 000084  3  select c02f90e0 rpc.statd
  107 c2782740 c2f17000    0     1   105 000084  3    nfsd c08d3800 nfsd
  106 c27832a0 c2ee6000    0     1   105 000084  3    nfsd c08d3600 nfsd
  103 c2782a80 c2f0e000    0     1   103 000084  3  select c02f90e0 mountd
  101 c2782c20 c2f03000    1     1   101 000184  3  select c02f90e0 portmap
   96 c2782dc0 c2ef7000    0     1    96 000084  3  select c02f90e0 syslogd
   57 c2782f60 c2ef3000    0     1    57 000084  3  select c02f90e0 pccardd
   18 c2783100 c2eee000    0     1    18 2000084  3   pause c2eee260 adjkerntz
    7 c2783440 c2ede000    0     1     7 006086  3  ttywai c07bb54c sh
    6 c27835e0 c2e96000    0     0     0 000204  3  syncer c02f9008 syncer
    5 c2783780 c2e93000    0     0     0 000204  3  vlruwt c2783780 vnlru
    4 c2783920 c2e90000    0     0     0 000204  3  psleep c02db4dc bufdaemon
    3 c2783ac0 c2e8d000    0     0     0 000204  3  psleep c02e8fe0 vmdaemon
    2 c2783c60 c2e8a000    0     0     0 000204  3  psleep c02b0b38 pagedaemon
    1 c2783e00 c2788000    0     0     1 004284  3    wait c2783e00 init
    0 c02f8400 c0383000    0     0     0 000204  3   sched c02f8400 swapper
db> trace 7
mi_switch(c07bb54c,0,c07bb500,c2783510,c2ee0e70) at mi_switch+0x162
tsleep(c07bb54c,11a,c026c41f,0,c07bb500) at tsleep+0x1bd
ttysleep(c07bb500,c07bb54c,11a,c026c41f,0) at ttysleep+0x24
ttywait(c07bb500,c2783440,1,c02a0608,c2783560) at ttywait+0x50
exit1(c2783440,0,c2ee0fa0,c02452ca,c2783440) at exit1+0x2a9
sys_exit(c2783440,c2ee0f80,1,8068045,0) at sys_exit+0x15
syscall2(2f,2f,2f,0,8068045) at syscall2+0x1ea
Xint0x80_syscall() at Xint0x80_syscall+0x25
db> 

	It seems a kernel is stuck somewhere within ttywait()
	called from exit1(), file src/sys/kern/kern_exit.c

>How-To-Repeat:
	Note that I can reliably reproduce this but only on one
	of my machines. So I suspect that depends of local settings.
	
	So here is my /etc/rc.conf:

# This file now contains just the overrides from /etc/defaults/rc.conf
# please make all changes to this file.

dumpdev="/dev/ad0s2b"
network_interfaces="auto"
ifconfig_ep0="inet 10.58.1.2 netmask 255.255.255.252 media 10baseT/UTP"
defaultrouter="10.58.1.1"
hostname="hp.grosbein.pp.ru"
blanktime="300"
scrnmap="koi8-r2cp866"
keyrate="fast"
moused_enable="YES"
moused_flags="-r high"		# Any additional flags to moused.
tcp_extensions="YES"
apm_enable="YES"
sendmail_enable="NO"	# Run the sendmail daemon (or NO).
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="YES"
#sendmail_msp_queue_enable="NO"
font8x8="cp866-8x8"
font8x14="cp866-8x14"
font8x16="cp866-8x16"
router_enable="NO"
firewall_enable="YES"
firewall_type="open"
keymap=ru.koi8-r.pdwn
allscreens_flags="-m on"	# Set this vidcontrol mode for all virtual screens
moused_port="/dev/psm0"
syslogd_flags="-vvss"
clear_tmp_enable="YES"	# Clear /tmp at startup.
inetd_enable="YES"
#inetd_flags="-wWl -a localhost"
apmd_enable="YES"
sshd_enable="NO"
#portmap_enable=YES
#nfs_server_enable=YES
#nfs_client_enable=YES
pccard_enable="YES"
pccard_ifconfig="$ifconfig_ep0"
ntpdate_enable="YES"
ntpdate_flags="-b dadv"
nfs_server_enable="YES"
nfs_server_flags="-u -n 2"	# Flags to nfsd (if enabled).
pccardd_flags="-z"

gif_interfaces="gif0"
gifconfig_gif0="10.58.1.2 10.58.1.1"
ifconfig_gif0="10.58.4.1 10.58.3.1 netmask 255.255.255.0"

	Then, here is my kernel config. I must note that I use
	this system for general testings and its world
	and kernel are built with "-O2 -march-pentium"
	just to find bugs. 

# HP kernel config
# 13 Apr 2003

#for strings -n 3 /kernel | grep ^___ | sed -e 's/^___//' > MYKERNEL
options		INCLUDE_CONFIG_FILE

machine		i386
cpu		I586_CPU
ident		HP
maxusers	0

#makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols
#options		PNPBIOS
options		CLK_CALIBRATION_LOOP
options		"CLK_USE_I8254_CALIBRATION"
options		CLK_USE_TSC_CALIBRATION

options 	INET			#InterNETworking
options 	FFS			#Berkeley Fast Filesystem
options 	FFS_ROOT		#FFS usable as root device [keep this!]
options 	COMPAT_43		#Compatible with BSD 4.3 [KEEP THIS!]
options 	SCSI_DELAY=15000	#Delay (in ms) before probing SCSI
options 	IDE_DELAY=8000	# Be optimistic about Joe IDE device
options 	UCONSOLE		#Allow users to grab the console
options 	USERCONFIG		#boot -c editor
options 	VISUAL_USERCONFIG	#visual boot -c editor
options 	KTRACE			#ktrace(1) support
options		CPU_SUSP_HLT
#options		"NO_F00F_HACK"
options		USER_LDT
#options		PPP_BSDCOMP
#options		PPP_DEFLATE
#options		PPP_FILTER

options 	SYSVSHM			#SYSV-style shared memory
options 	SYSVMSG			#SYSV-style message queues
options 	SYSVSEM			#SYSV-style semaphores

options 	P1003_1B		#Posix P1003_1B real-time extensions
options 	_KPOSIX_PRIORITY_SCHEDULING
options		_KPOSIX_VERSION=199309L
options		ICMP_BANDLIM		#Rate limit bad replies

options		NSWAPDEV=3

device		isa
device		pci
#options		AUTO_EOI_1
#options		AUTO_EOI_2

# Floppy drives
device		fdc0	at isa? port IO_FD1 irq 6 drq 2
device		fd0	at fdc0 drive 0

# ATA and ATAPI devices
device		ata
device		atadisk			# ATA disk drives
device		atapicd			# ATAPI CDROM drives
device		ata0	at isa? port IO_WD1 irq 14
device		ata1	at isa? port IO_WD2 irq 15 disable
options 	ATA_STATIC_ID		#Static device numbering

# atkbdc0 controls both the keyboard and the PS/2 mouse
device		atkbdc0	at isa? port IO_KBD
device		atkbd0	at atkbdc? irq 1
options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev

# Options for atkbd:
options 	ATKBD_DFLT_KEYMAP	# specify the built-in keymap
makeoptions	ATKBD_DFLT_KEYMAP="ru.koi8-r.pdwn"

device		psm0	at atkbdc? irq 12

device		vga0	at isa?
options		VESA
#options		VGA_WIDTH90

# splash screen/screen saver
pseudo-device	splash

# syscons is the default console driver, resembling an SCO console
device		sc0	at isa?
options 	SC_DFLT_FONT		# compile font in
makeoptions	SC_DFLT_FONT=cp866

options		MAXCONS=16
options		SC_HISTORY_SIZE=1000
options		SC_MOUSE_CHAR=0x03
options		SC_TWOBUTTON_MOUSE
#options		SC_PIXEL_MODE

# Floating point support - do not disable.
device		npx0	at nexus? port IO_NPX irq 13

# Power management support (see LINT for more options)
#device		apm0    at nexus? flags 0x31 # Advanced Power Management
device		apm0    at nexus? # Advanced Power Management

# Serial (COM) ports
device		sio0	at isa? port IO_COM1 flags 0x90 irq 4
device		sio1	at isa? port IO_COM2 irq 3 disable
options 	BREAK_TO_DEBUGGER	#a BREAK on a comconsole goes to
					#DDB, if available.
options 	CONSPEED=115200		# speed for serial console

device		card
device		pcic
device		ep

# Parallel port
device		ppc0	at isa? irq 7
device		ppbus		# Parallel port bus (required)
device		lpt		# Printer
#device		plip		# TCP/IP over parallel
device		ppi		# Parallel port interface device

device		joy
#device		joy0	at isa? port 0x100

# Pseudo devices - the number indicates how many units to allocated.
pseudo-device	loop		# Network loopback
pseudo-device	ether		# Ethernet support
pseudo-device	sl	1	# Kernel SLIP
pseudo-device	ppp	1	# Kernel PPP
#pseudo-device	tun		# Packet tunnel.
pseudo-device	pty	64	# Pseudo-ttys (telnet etc)
#pseudo-device	md		# Memory "disks"
#pseudo-device	gif	4	# IPv6 and IPv4 tunneling
#pseudo-device	faith	1	# IPv6-to-IPv4 relaying (translation)
#pseudo-device	snp
#pseudo-device	vn
#pseudo-device	gzip		# Exec gzipped a.out's
pseudo-device	speaker

# The `bpf' pseudo-device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
pseudo-device	bpf		#Berkeley packet filter
#options		MSGBUF_SIZE=40960

device		pcm

#device		snd
#device		css0	at isa? port 0x534 irq 5 drq 1 flags 0x08
#device		opl0	at isa? port 0x388
#device 		sbmidi0	at isa? port 0x330
#device		sb0	at isa? port 0x220 irq 5 drq 1
#device		mpu0	at isa? port 0x330 irq 9 drq 0

#device		pca
device		pca0 at isa? port IO_TIMER1

#options		QUOTA
options		IPFIREWALL
options		IPFIREWALL_VERBOSE
#options 	"IPFIREWALL_VERBOSE_LIMIT=100"
#options		IPDIVERT
#options		IPSTEALTH

#options		DUMMYNET
options		SOFTUPDATES

options		DDB
#options		DDB_UNATTENDED
options 	GDB_REMOTE_CHAT

options		RANDOM_IP_ID

options		UFS_DIRHASH
#options		PQ_CACHESIZE=128	# color for 128k/16k cache
options		SHOW_BUSYBUFS

#options		SHUTDOWN_BEEP
options		PCIC_RESUME_RESET
options		IPSEC
options		IPSEC_ESP

pseudo-device   gif     1       # IPv6 and IPv4 tunneling
#device		wi

	
>Fix:

	Unknown for me

Eugene Grosbein


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306041636.h54GaCqm000271>