From owner-freebsd-stable@FreeBSD.ORG Thu Apr 25 18:40:37 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D80DF917 for ; Thu, 25 Apr 2013 18:40:37 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id A2F931372 for ; Thu, 25 Apr 2013 18:40:37 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id B627B12020A; Thu, 25 Apr 2013 20:40:19 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 9228A28493; Thu, 25 Apr 2013 20:40:19 +0200 (CEST) Date: Thu, 25 Apr 2013 20:40:19 +0200 From: Jilles Tjoelker To: Guy Helmer Subject: Re: FreeBSD 9: fdisk -It crashes kernel Message-ID: <20130425184019.GA49312@stack.nl> References: <80F41679-9C3A-4E61-8AAD-403410344C32@gmail.com> <20130425155818.GA8454@icarus.home.lan> <257D766B-A296-43CD-A2B9-5F70A95A07A2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <257D766B-A296-43CD-A2B9-5F70A95A07A2@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Jeremy Chadwick , FreeBSD Stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 18:40:37 -0000 On Thu, Apr 25, 2013 at 11:58:42AM -0500, Guy Helmer wrote: > On Apr 25, 2013, at 10:58 AM, Jeremy Chadwick 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