From owner-freebsd-current@FreeBSD.ORG Tue Jan 11 21:11:15 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 4FA11106566B for ; Tue, 11 Jan 2011 21:11:15 +0000 (UTC) (envelope-from demelier.david@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id D66D28FC16 for ; Tue, 11 Jan 2011 21:11:14 +0000 (UTC) Received: by fxm16 with SMTP id 16so20395805fxm.13 for ; Tue, 11 Jan 2011 13:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=cXUzViFfPZmTOB/RgPiPL2aVGrGJtIMmQMbBIjDKTWk=; b=Jzltxc8z+/x74gAdBn61Dtc/9kGyTb2py1AwZDx42yDJhwRTD6jMPY+F/qH2NZXO+Y IuUrqYnpUZj+4XGV6tKbjtLVRawOfqknCa3rAkbFF+aN7gr+JW4C2vQLkF+myKb7Ijo/ H3hgCtpEVzoIIG8xpvwnvS+2/A/ULZVHEwdkY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=EERmY2JavrZV5YgIis63vi9CGQKpL+vMHsyYDC/YUthWSs5JqCY2AUhwAhIQL+Bkcx RWSrafPUvgm2k+mfCbB0uHsDxVt7XLntpHwoPQUTexXtoIW71HcuqLJTiFho+QW59HcH jsyJPA3fqES5VI6zQD0mNg8lSeTbDUuDu6bR8= MIME-Version: 1.0 Received: by 10.223.107.82 with SMTP id a18mr104868fap.88.1294780273561; Tue, 11 Jan 2011 13:11:13 -0800 (PST) Received: by 10.223.70.208 with HTTP; Tue, 11 Jan 2011 13:11:13 -0800 (PST) In-Reply-To: References: Date: Tue, 11 Jan 2011 22:11:13 +0100 Message-ID: From: David DEMELIER To: Chuck Swiger Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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:11:15 -0000 2011/1/11 Chuck Swiger : > 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. =C2=A0A system panic()s to avoid writing corrupt= ed 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. =C2=A0If it was possible for the kernel to handle an erro= r condition without panic()ing, then that is obviously preferred-- but ther= e are situations where there is no way for the system to recover. =C2=A0Com= mon examples of that include when the boot disk fails or disappears, or whe= n the kernel runs out of memory in a situation where it can't get more free= pages available. =C2=A0Less common is when some kind of kernel invariant i= s violated, indicating that essential kernel data structures have been corr= upted. > Well I see, I know that kern.sync_on_panic exists to force a sync on a panic but because my laptop usually does not core dump so never reboot my disk are not sync'ed :-( it results in a file system not clean an that's the thing I really hate. >> Imagine someone working on something really important and his computer j= ust 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. =C2=A0:-) =C2=A0The 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 n= ext, then MacOS X, then Linux, then Windows. > > I expect anything based on Unix to be routinely capable of multi-year upt= imes; some carefully chosen Windows boxes can also do that, but the widespr= ead 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. > No no, it was a panic that didn't core dump so I needed to do a hard reboot= . >> 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? =C2=A0W= e are in 2011 ! I think even Window 2000 does not crash on a user-land soft= ware. > > "think"? =C2=A0If 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. > In fact I like FreeBSD, and I don't expect running anything else. But I must say that I didnt see windows 2000 crashing on my every boxes I have before switching to FreeBSD. I understand everything, corrupts kernel data must not be used. That's why panic are made to prevent any dangerous things. --=20 Demelier David