From owner-freebsd-current@FreeBSD.ORG Tue Jan 11 21:00:28 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52E42106564A for ; Tue, 11 Jan 2011 21:00:28 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0FB978FC12 for ; Tue, 11 Jan 2011 21:00:27 +0000 (UTC) Received: by qwj9 with SMTP id 9so20547209qwj.13 for ; Tue, 11 Jan 2011 13:00:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.81.206 with SMTP id y14mr61907qck.127.1294778024217; Tue, 11 Jan 2011 12:33:44 -0800 (PST) Received: by 10.229.102.19 with HTTP; Tue, 11 Jan 2011 12:33:44 -0800 (PST) X-Originating-IP: [93.221.179.70] In-Reply-To: References: Date: Tue, 11 Jan 2011 21:33:44 +0100 Message-ID: From: "C. P. Ghost" To: David DEMELIER Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-current@freebsd.org Subject: Re: why panic(9) ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 21:00:28 -0000 On Tue, Jan 11, 2011 at 9:11 PM, David DEMELIER wrote: > Hello, > > I'm just guessing why current BSD panic() when a problem occurs, all > modern operating systems solve the problem instead of crashing > suddently and corrupting all your data without saving your work. > > Yes, why this function exists? There is no way to solve a problem > without panic'ing? Is panic really needed? Imagine someone working on > something really important and his computer just panic, his work not > saved everybody shout at him in the corporation. He lose his job, his > wife, his dog, everything is wrong, just because of a panic() ! Sometimes, it's best to panic(9) rather than to try recovery. Imagine a situation where the kernel detects that some of its important internal data structures are corrupted. Should it resume execution with pointers pointing into some Nirwana (and "undefined behavior" in the worst case means that some serious bad things could happen), or is it preferable to panic(9) right away? Granted, some panics could handled more gracefully, e.g. flushing buffers and such to disk... but here again: in most cases, the kernel can't be sure that it is internally sane enough to write to disk (it could overwrite other parts of the disk by syncing, right?), so better leave the disks untouched in this circumstance (only exception: dumping core). > Seriously, I really hate when I play some music that suddenly the > music get stucked in a infinite loop, why ? I don't know because the > panic does not core dump. But after some search I found that the panic > was done because of conky. How the hell conky can panic FreeBSD? We > are in 2011 ! I think even Window 2000 does not crash on a user-land > software. > > I'm guessing now, if minix panic when a bloated crappy software is > running. I think Andrew is in the right way. The real problem we have here (IMHO), is that we don't have a microkernel architecture. Any error in a driver would panic the whole system. This is a real pain. But short of redesigning BSD from scratch, there's not much we could do atm. > -- > Demelier David -cpghost. -- Cordula's Web. http://www.cordula.ws/