why panic(9) ?

David DEMELIER demelier.david at gmail.com
Tue Jan 11 21:11:15 UTC 2011

2011/1/11 Chuck Swiger <cswiger at mac.com>:
> 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.

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 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.

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?  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.

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.

Demelier David

More information about the freebsd-current mailing list