Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jan 2011 22:11:13 +0100
From:      David DEMELIER <demelier.david@gmail.com>
To:        Chuck Swiger <cswiger@mac.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: why panic(9) ?
Message-ID:  <AANLkTikP%2BxuPpVOxhU2msHHraRQRSUCqjG59S_Ss6pQ=@mail.gmail.com>
In-Reply-To: <CB13B0A9-E5EF-4351-9F17-C4628AA38004@mac.com>
References:  <AANLkTi=OQbS-0jJx0YwZhM7xDWPLOkaYYZAYfESUEvvM@mail.gmail.com> <CB13B0A9-E5EF-4351-9F17-C4628AA38004@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2011/1/11 Chuck Swiger <cswiger@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. =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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikP%2BxuPpVOxhU2msHHraRQRSUCqjG59S_Ss6pQ=>