bin/102515: fsck_ufs crashes if no console at all (in libc)

Nick Hibma nick at
Fri Aug 25 20:10:22 UTC 2006

>Number:         102515
>Category:       bin
>Synopsis:       fsck_ufs crashes if no console at all (in libc)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 25 20:10:20 GMT 2006
>Originator:     Nick Hibma
>Release:        FreeBSD 6.1-STABLE i386
AnyWi Technologies
System: FreeBSD 6.1-STABLE FreeBSD 6.1-STABLE #19: Thu Aug 17 16:31:39 CEST 2006 toor at i386

Headless Soekris (no graphics hardware), without serial console:


and all getty ttys (ttyd0 and ttyv?) switched off.


fsck_ffs (fsck_ufs) crashes in libc in this configuration on boot. This
failure stops the boot process, and wants to drop you into a shell. But because
there is no console the /etc/rc script immediately resumes the boot process, but
this time as fastboot instead of autoboot, skipping the disk checks; and the
crash, but the disk doesn't get checked that way (is mounted read-only, so that
is not that big an issue).

This leads to a duplicated execution of memory disk creation in rc.initdiskless
which is my real problem: It wastes 14mb of my 64Mb of memory!

#0  0x08054841 in ?? ()
#1  0x28150c98 in __gdtoa_locks () from /lib/
#2  0xbfbfedc0 in ?? ()
#3  0xbfbfe358 in ?? ()
#4  0x280b1ea3 in freopen () from /lib/
#5  0x08055108 in ?? ()
#215 0x00000000 in ?? ()
#216 0x2805f405 in dlsym () from /libexec/
#217 0x0804eada in ?? ()
#223 0x09a6322b in ?? ()
#224 0x2809d7ba in ?? () from /lib/
#225 0x2807d598 in ?? ()
#226 0x28099b28 in ?? () from /lib/
#227 0x00000000 in ?? ()
#228 0xbfbfea38 in ?? ()
#229 0x2805f5e3 in dlinfo () from /libexec/
#230 0x08049252 in ?? ()
#233 0xbfbfecdc in ?? ()
---Type <return> to continue, or q <return> to quit---
#234 0x00000010 in ?? ()
#235 0x080561d0 in __divdi3 ()
#236 0x00000003 in ?? ()


# fsck -f / < /dev/console
** /dev/ad0s1a
fsck: /dev/ad0s1a: Floating point exception: 8
# fsck -f /
** /dev/ad0s1a
<<produces normal result which I did not capture>>

on a machine without a console (see above for how to reproduce). Image to test
this with can be generated if needed, or access to machine can be given.
(Read-only image mounted in multi-user mode, don't know whether ).

Several options:

	Change statements calling fsck in /etc/rc.d/fsck from
		fsck -F -p
		fsck -F -p </dev/null

	(perhaps in bgfsck too? I've disabled background fsck)

	Have rc.initdiskless create the mdmfs only during autoboot, not during

	Fix libc to be able to cope with undefined file descriptors (or whatever
	it is that is crashing libc).

IMHO B and C should be done. A) is just mentioned to help people work around the

More information about the freebsd-bugs mailing list