FreeBSD 9: fdisk -It crashes kernel

Jilles Tjoelker jilles at stack.nl
Thu Apr 25 18:40:37 UTC 2013


On Thu, Apr 25, 2013 at 11:58:42AM -0500, Guy Helmer wrote:
> On Apr 25, 2013, at 10:58 AM, Jeremy Chadwick <jdc at koitsu.org> wrote:
> > On Thu, Apr 25, 2013 at 09:06:49AM -0500, Guy Helmer wrote:
> >> Encountered a surprise when my disk resizing rc.d script caused
> >> FreeBSD 9.1-STABLE to crash. I used "fdisk -It ada0" to determine
> >> what the available size of the disk (which happened to be the root
> >> disk), and on FreeBSD 9.1 the kernel comes crashing down:

The shell output can be explained.

> >> + fdisk -It ada0
> >> + /rescue/sed -En 's,.*start ([0-9]+).*size ([0-9]+).*,\1 + \2,p'
> >> vnode_pager_getpages: I/O read error
> >> vm_fault: pager read error, pid 65 (fdisk)
> >> pid 65 (fdisk), uid 0: exited on signal 11
> >> eval: arithmetic expression: expecting primary: ""

The subshell for the growfs_vm script exits here because of the error.
The eval is the eval in /etc/rc.subr _run_rc_doit.

> >> Entropy harvesting: point_to_pointeval: date: Device not configured
> >> eval: df: Device not configured
> >> eval: dmesg: Device not configured
> >> cat: /bin/ls: Device not configured
> >> kickstart.

After growfs_vm has run (unsuccessfully), rc continues with initrandom.

> >> eval: cannot open /etc/fstab: Device not configured
> >> eval: cannot open /etc/fstab: Device not configured
> >> eval: swapon: Device not configured
> >> Warning! No /etc/fstab: skipping disk checks
> >> fstab: /etc/fstab:0: Device not configured

> >> Fatal trap 12: page fault while in kernel mode
> >> cpuid = 1; apic id = 01
> >> fault virtual address   = 0x0
> >> fault code                     = supervisor read, page not present
> >> instruction pointer      = 0x20:0xc0825fc4
> >> stack pointer               = 0x28:0xc5a088c8
> >> frame pointer              = 0x28:0xc5a08914
> >> code segment            = base 0x0, limit 0xfffff, type 0x1b
> >>                                     = DLP 0, pres 1, def32 1, gran 1
> >> processor eflags       = interrupt enabled, resume, IOPL = 0
> >> current process         = 91 (mount)
> >> [ thread pid 91 tid 100056 ]
> >> Stopped at  g_access+0x24: mlvl 0(%ebx),%eax
> >> db> where
> >> Tracing pid 91 tid 100056 td 0xc84c42f0
> >> g_access(c8481d34,0,1,1,0,…) at g_access+0x24/frame 0xc5a08914
> >> ffs_mount(c8481d34,c0d78380,2,c5a08c00,c829ae6c,…) af ffs_mount+0xf74/frame 0xc5a08a34
> >> vfs_donmount(c84c42f0,10000,0,c84cf200,c84cf200,…) at vfs_donmount+0x1423/frame 0xc5a08c24
> >> sys_nmount(c84c42f0,c5a08ccc,c5a08cc4,1010006,c5a08d08,…) at sys_nmount+0x7f/frame 0xc5a08c48
> >> syscall(c5a08d08) at syscall+0x443/frame 0xc508cfc
> >> Xint0x80_syscall() at Xint0x80_syscall+0x21/frame 0xc5a08cfc
> >> --- syscall (378, FreeBSD ELF32, sys_nmount), eip = 0x480d5feb, esp = 0xbfbfce1c, ebp = 0xbfbfd378 ---

Apparently a subsequent mount command kills it.

> >> I'll fix my script to not do this, but it seems odd that fdisk -It
> >> can make the disk "go away".

Yes, that seems wrong.

-- 
Jilles Tjoelker


More information about the freebsd-stable mailing list