From owner-freebsd-current@FreeBSD.ORG Tue Jan 11 23:03:45 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 7CC07106566B for ; Tue, 11 Jan 2011 23:03:45 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 117248FC17 for ; Tue, 11 Jan 2011 23:03:44 +0000 (UTC) Received: by wyf19 with SMTP id 19so21500353wyf.13 for ; Tue, 11 Jan 2011 15:03:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=qlxjVBDnVSVPbNHA1NM3zEjTx4oyFPDG5yeyTrCNvO0=; b=BBCkC1Xnn6/3SNdtqcrluf8iZ4QTzke2vbku5cd4prBxB1wTqgLsyxnZcWkr+guNPE gfdYJzHoUvvuguLlEsNqO5YYDKd/dF2abEi9++WD90ERj3ljA8DER0eg7j2C/BIlhHw7 MI0SX39bGsV4dcRrtETYnZC5ECvy+9ME8apEU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=uQNAbFCybfFCN1X1gZ3I5D8tgDVgH3V/X2L6FJlqkRhsNmM6jyCYOm7vZ0eU5vzO5g y/VyAnvimD7TLuq011DQik77PNdX1ZgdEwakE/4IcEXvzjO9htozCi6baZbWWLDcVxfl o5mt8WH42MEAD1/WZUKD4XvcVGEaKF87Q6J/g= MIME-Version: 1.0 Received: by 10.216.29.71 with SMTP id h49mr180032wea.46.1294787023826; Tue, 11 Jan 2011 15:03:43 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Tue, 11 Jan 2011 15:03:43 -0800 (PST) In-Reply-To: References: Date: Tue, 11 Jan 2011 15:03:43 -0800 X-Google-Sender-Auth: MSW9wfNO5QobFWBm8px-osvFKqE Message-ID: From: Garrett Cooper 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 23:03:45 -0000 On Tue, Jan 11, 2011 at 12: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() ! > > 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. So I guess with that reasoning we don't need asserts, bugs never occur, and the if the computer catches on fire we should just let it burn up instead of getting an extinguisher and put it out :D? As an example: I would rather have my PC panic and not write out corrupt data to disk instead of write out that corrupt data to disk. The latter has happened with userland apps on occasion before they crash, and that really fries my bacon... Similarly, if we're beyond recovery, panicing is the best and only option, but yes... recovery could be handled better in some cases. Filesystems are a bit trickier though because they're more mission critical than say a non-critical device driver (my sound driver?) tanking. Thanks, -Garrett