From owner-freebsd-current@FreeBSD.ORG Tue Jan 11 20:34:11 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 E688F1065693 for ; Tue, 11 Jan 2011 20:34:11 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id CDC7E8FC16 for ; Tue, 11 Jan 2011 20:34:11 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from cswiger1.apple.com ([17.209.4.71]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 64bit)) with ESMTPSA id <0LEV006BPL4JK560@asmtp029.mac.com> for freebsd-current@freebsd.org; Tue, 11 Jan 2011 12:33:56 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1010190000 definitions=main-1101110095 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2011-01-11_08:2011-01-11, 2011-01-11, 1970-01-01 signatures=0 From: Chuck Swiger In-reply-to: Date: Tue, 11 Jan 2011 12:33:54 -0800 Message-id: References: To: David DEMELIER X-Mailer: Apple Mail (2.1082) 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 20:34:12 -0000 On Jan 11, 2011, at 12:11 PM, David DEMELIER wrote: > 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. You've got it backwards. A system panic()s to avoid writing corrupted data to disk. > Yes, why this function exists? There is no way to solve a problem > without panic'ing? Is panic really needed? Sometimes, yes. If it was possible for the kernel to handle an error condition without panic()ing, then that is obviously preferred-- but there are situations where there is no way for the system to recover. Common examples of that include when the boot disk fails or disappears, or when the kernel runs out of memory in a situation where it can't get more free pages available. Less common is when some kind of kernel invariant is violated, indicating that essential kernel data structures have been corrupted. > 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() ! I admire your contrived example. :-) The data available to me suggests that Solaris boxes on enterprise-grade hardware have the highest uptimes; FreeBSD (and related platforms like NetBSD/OpenBSD/DFly/etc) are next, then MacOS X, then Linux, then Windows. I expect anything based on Unix to be routinely capable of multi-year uptimes; some carefully chosen Windows boxes can also do that, but the widespread prevalence of security issues requiring reboots on Windows means that I don't usually see Windows boxes with uptimes of greater than a month. > Seriously, I really hate when I play some music that suddenly the > music get stucked in a infinite loop, why ? Probably a bug in the sound card driver. > 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. "think"? If you don't have experience running Windows 2000 are thus are simply guessing, let me assure you that Win 2000 can and does (or did) panic due to userland software. Regards, -- -Chuck