Subject: Apparent FFS problems.
To: None <port-i386@netbsd.org>
From: Aidan Kehoe <kehoea@parhasard.net>
List: port-i386
Date: 10/04/2002 21:26:51
Hi, 

I'm running a system with a 1.5ZC userland and a 1.6_RC2 kernel
(upgraded in the hope that the problem would go away--it didn't.) I've
two major partitions on wd0;

/dev/wd0f on /usr type ffs (soft dependencies, local)
/dev/wd0e on /usr/local type ffs (soft dependencies, local)
mfs:85 on /tmp type mfs (local)

and /tmp/ is 100mb MFS filesystem (related to the FFS code, I
believe). Now, at unreproducable intervals, but normally with the
partition three-quarters full and some cort of compiling going on, the
system reboots. Occasionally--but very rarely--a message makes it to
/var/log/messages; the latest was

Oct  4 20:56:18 rincewind /netbsd: handle_workitem_freeblocks: block count

and it's normally something along the same lines--a negative number
where there shouldn't be, or something. On restart, the filesystem is
corrupt, with sundry partially allocated inodes. Initially--despite
the disk, and one of the filesystems, having worked fine under
OpenBSD--I ruled it down to a hardware fault; but occasionally, when
compiling something in /tmp/ to avoid this hardware fault, the same
thing will happen. That seems to rule out a problem with the disk. 

Savecore doesn't seem to find a core dump on reboot; perhaps that's a
problem with my kernel config, perhaps not. My kernel is compiled with
this in /sys/arch/i386/conf/Makefile.i386 ; 

DEFCOPTS?=  -O3 -march=k6-2 -mmmx -m3dnow -fomit-frame-pointer -ffast-math
CC?=	    gcc-3.1

and the config file is attached to the bottom of this mail. That said,
as far as I remember--it was a while ago now--there were the same
problems with the system compiler. 

Any ideas? Time to acquire some kernel-hacking skills?

Thanks, 

	- Aidan Kehoe
-- 
"Iraq: incredible weapons - incredible weapons." How do you know that? 
"Uh, well... We looked at the receipt." -- Bill Hicks, 1992

#	-*- winmgr -*-
# For each device driver in this file see the section 4 man page for
# the device.

include 	"arch/i386/conf/std.i386"
maxusers 	8		# estimated number of users

options 	I586_CPU
options 	DUMMY_NOPS
options 	MTRR		# memory-type range register syscall support
options 	CPURESET_DELAY=0

# Standard system options

options 	UCONSOLE	# users can use TIOCCONS (for xconsole)
# options 	INSECURE	# disable kernel security levels for X
options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT

options 	KTRACE		# system call tracing via ktrace(1)

options 	SYSVMSG		# System V-like message queues
options 	SYSVSEM		# System V-like semaphores
options 	SYSVSHM		# System V-like memory sharing

options		LKM		# loadable kernel modules

# Compatibility options
options 	COMPAT_15	# NetBSD 1.5,

# File systems
file-system 	FFS		# UFS
file-system 	MFS		# memory file system
file-system 	CD9660		# ISO 9660 + Rock Ridge file system
file-system 	MSDOSFS		# MS-DOS file system
file-system 	FDESC		# /dev/fd
file-system	PROCFS		# /proc

# File system options
options 	QUOTA		# UFS quotas
options 	SOFTDEP		# FFS soft updates support.

# Networking options
options 	INET		# IP + ICMP + TCP + UDP

#
# wscons options
#
# builtin terminal emulations
options 	WSEMUL_VT100		# VT100 / VT220 emulation
# different kernel output - see dev/wscons/wsdisplayvar.h
options 	WS_KERNEL_FG=WSCOL_WHITE
options 	WS_KERNEL_BG=WSCOL_RED
# compatibility to other console drivers
options 	WSDISPLAY_COMPAT_PCVT		# emulate some ioctls
options		WSDISPLAY_COMPAT_SYSCONS
options		WSDISPLAY_COMPAT_USL
options		WSDISPLAY_COMPAT_RAWKBD
# see dev/pckbc/wskbdmap_mfii.c for implemented layouts
options 	PCKBD_LAYOUT="(KB_UK)"
# allocate a number of virtual screens at autoconfiguration time
options 	WSDISPLAY_DEFAULTSCREENS=4

# Kernel root file system and dump configuration.
config		netbsd	root on wd0a type ffs 

#
# Device configuration
#
mainbus0 at root

apm0	at mainbus0			# Advanced power management

# Basic Bus Support

# PCI bus support
pci*	at mainbus? bus ?
pci*	at ppb? bus ?

# PCI bridges
pcib*	at pci? dev ? function ?	# PCI-ISA bridges
ppb*	at pci? dev ? function ?	# PCI-PCI bridges
pchb*	at pci? dev ? function ? 

pciide* at pci? dev ? function ? flags 0x0000

agp* 	at pchb?

# ISA bus support
isa0	at pcib?

# ISA Plug-and-Play bus support
isapnp0	at isa?

# Math Coprocessor support
npx0	at isa? port 0xf0 irq 13	# x86 math coprocessor

# wscons
pckbc0		at isa?			# pc keyboard controller
pckbd*		at pckbc?		# PC keyboard

vga*		at pci? dev ? function ?
wsdisplay*	at vga? console ?
wskbd* 		at pckbd? console ?

pcppi0		at isa?
sysbeep0	at pcppi?

# Serial Devices

# ISA serial interfaces
com0	at isa? port 0x3f8 irq 4	# Standard PC serial ports
com1	at isa? port 0x2f8 irq 3

# ISA parallel printer interfaces
lpt0	at isa? port 0x378 irq 7	# standard PC parallel ports
lpt1	at isa? port 0x278
lpt2	at isa? port 0x3bc

# I2O devices
iop*	at pci? dev ? function ?	# I/O processor
iopsp*	at iop? tid ?			# SCSI/FC-AL ports
ld*	at iop? tid ?			# block devices
dpti*	at iop? tid 0			# DPT/Adaptec control interface

adv0    at isa? port ? irq ? drq ?      # AdvanSys APB-514[02] SCSI
scsibus* at adv?

# ISA Plug-and-Play IDE controllers
wdc*	at isapnp?

wdc0	at isa? port 0x1f0 irq 14 flags 0x00
wdc1	at isa? port 0x170 irq 15 flags 0x00

# IDE drives
wd*	at wdc? channel ? drive ? flags 0x0000
wd*	at pciide? channel ? drive ? flags 0x0000

# ATAPI bus support
atapibus* at wdc? channel ?
atapibus* at pciide? channel ?

# ATAPI devices
cd*	at atapibus? drive ? flags 0x0000	# ATAPI CD-ROM drives
sd*	at atapibus? drive ? flags 0x0000	# ATAPI disk drives

# Miscellaneous mass storage devices

# ISA floppy
fdc0	at isa? port 0x3f0 irq 6 drq 2	# standard PC floppy controllers
fd*     at fdc? drive ?

# ISA network interfaces
ne0	at isa? port 0x280 irq 9		# NE[12]000 ethernet cards

# ISA Plug-and-Play audio devices
sb*	at isapnp?			# SoundBlaster-compatible audio

# OPL[23] FM synthesizers
opl*	at sb?

# Audio support
audio*	at sb?

# MPU 401 UARTs
mpu*	at sb?

# MIDI support
midi*	at sb?			# SB1 MIDI port
midi*	at opl?			# OPL FM synth

# The spkr driver provides a simple tone interface to the built in speaker.
spkr0	at pcppi?		# PC speaker

# Pull in optional local configuration
include	"arch/i386/conf/GENERIC.local"

# Pseudo-Devices
pseudo-device	md		1	# memory disk device (ramdisk)
pseudo-device	vnd		4	# disk-like interface to files

# network pseudo-devices
pseudo-device	bpfilter	8	# Berkeley packet filter
pseudo-device	ipfilter		# IP filter (firewall) and NAT
pseudo-device	loop			# network loopback
pseudo-device	ppp		2	# Point-to-Point Protocol
pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
pseudo-device	sl		2	# Serial Line IP
pseudo-device	strip		2	# Starmode Radio IP (Metricom)
pseudo-device	irframetty		# IrDA frame line discipline
pseudo-device	tun		2	# network tunneling over tty
pseudo-device	gre		2	# generic L3 over IP tunnel
pseudo-device	gif		4	# IPv[46] over IPv[46] tunnel (RFC1933)
pseudo-device	vlan			# IEEE 802.1q encapsulation
pseudo-device	bridge			# simple inter-network bridging

# miscellaneous pseudo-devices
pseudo-device	pty			# pseudo-terminals
pseudo-device	tb		1	# tablet line discipline
pseudo-device	sequencer	1	# MIDI sequencer
# rnd works; RND_COM does not on port i386 yet.
pseudo-device	rnd			# /dev/random and in-kernel generator
#options 	RND_COM			# use "com" randomness as well (BROKEN)

# wscons pseudo-devices
pseudo-device	wsmux			# mouse & keyboard multiplexor
pseudo-device	wsfont