Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jan 2011 08:10:00 +0100
From:      Martin Sugioarto <martin@sugioarto.com>
To:        David DEMELIER <demelier.david@gmail.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: why panic(9) ?
Message-ID:  <20110112081000.5330ae53@zelda.sugioarto.com>
In-Reply-To: <AANLkTikP%2BxuPpVOxhU2msHHraRQRSUCqjG59S_Ss6pQ=@mail.gmail.com>
References:  <AANLkTi=OQbS-0jJx0YwZhM7xDWPLOkaYYZAYfESUEvvM@mail.gmail.com> <CB13B0A9-E5EF-4351-9F17-C4628AA38004@mac.com> <AANLkTikP%2BxuPpVOxhU2msHHraRQRSUCqjG59S_Ss6pQ=@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/uKZDJ6SL4fmZ+JG+6+s5cWp
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Am Tue, 11 Jan 2011 22:11:13 +0100
schrieb David DEMELIER <demelier.david@gmail.com>:

Hi David,

I want to say something to the two statements below.

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

=46rom my experience, when FreeBSD crashes, it means mostly that you have
some defective hardware. Last time when I had regular panics, it was a
Xeon CPU that was broken and flipped some bits in its cache when it got
a bit hotter.

The point is... this kind of errors would never be discovered by
MS-Windows. Because it appears to crash from various reasons and you
never know if you have hardware problems or a programming error. Then
it's also normal that applications on MS-Windows crash here and there.
It's mostly ignored because the whole system is not stable. I've had
also MS-Windows 2000 long time ago. And it ran on a PC where CPU had
wrong frequency multiplicator setting (all the time!). No one complained
when it crashed. But when I tried to run a Linux Live-CD on it, it
panic'ed very soon (mostly when starting). I suspect that MS-Windows
has a few routines which ignore errors and tries to continue... which
is very bad, in my opinion!

It is really annoying to hear people saying "MS-Windows runs and
FreeBSD crashes", because it means to me that FreeBSD discovered
another hardware error where MS-Windows failed.

(Btw, I changed the CPU a year ago and now it works without panics.
Also the wrong multiplicator was corrected and the AMD K5 CPU ran
correctly.)

> I understand everything, corrupts kernel data must not be used. That's
> why panic are made to prevent any dangerous things.
=20
Yes. No one wants to lose data.

I don't want to say that FreeBSD does not have programming errors. Of
course, a panic might be triggered by an unknown situation in a driver.
But you have to figure it out somehow, where the origins of the error
are.

And that's why a panic helps here. The kernel shows you the NEAREST
POSSIBLE position where it detected that something went wrong. Panics
are also good for diagnosis.
=20
But also, you want to get the errors in FreeBSD fixed. I learned that
when I insert assertions (see assert(3)) and let my applications crash
intentionally when it detects an error, paradoxically the applications
have far less errors than the ones that try to run as far as possible.

First thing is, as I said before, you discover the programming error
NEAR the place it happened (easier to fix). Second, sometimes (after
years) a developer forgets what assertions he made to restrict the
usage of certain routines (special cases/values are the worst things
here). It reminds the developer quickly when doing basic tests
(regression tests e.g.).

But as I said, I would say that FreeBSD does not panic often. Look
first if it's a hardware error (and these PC-DOCTOR applications cannot
really discover any problems, I can tell you for sure; also memcheckers
do not find errors in memory except for some trivial cases).

The best test is to try to compile world on FreeBSD. When a PC survives
this, it's functioning well (very probable).

Then, think if you use any exotic hardware on your system. Some drivers
which are not very common, might not cover every vendor or are still
not tested well, because there are not many people who use them.

All in all, Panics are important. They show you problems, try to give
hints what happened that lead to this situation and save you from
subsequent data disasters, as others pointed out.

--
Martin

--Sig_/uKZDJ6SL4fmZ+JG+6+s5cWp
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iQIcBAEBAgAGBQJNLVPNAAoJEF8wvLx/5p/7MkEP/RGgf+rIg2SV9lUKeE4FAE+L
agFbsXs0sAyW/Gca7257QwDmE7Hjhf6UgDKsZsyrZg9PXMcSbvpYXdtCvhODGdQy
9kXwLbzWF5HGNuZxJcFv+BxYXxktPzO8zyoVit2A40rkc8RVMDIUyfjVlMTKgjMr
drnCLlxRE8BXdsl1Xn5+K9XWQCu1jR3gPvwzfCRTjTA6FC5TyRxfrZ/gvn8g+OAk
9SrMv0BcrkwZ+PlNAt1mkthRXpdiOGiq4y//p2aFLpScUvhuKdAHSncWIaT614HL
KqofW/ncoGFyHeDKIWJd8T/RXWK47RNg6B9ST75lNZWzTyEKv7K7fkFnpnUpj0MT
jIpz1b3Iarr6O3xFr3Y8TYqKalEgr+S8lfeycdi/uzUMvPqjij66SPnQrcRkjHia
zhbdZIpZZV8CI++XHc0IdGP9tV9oZJg0Ru7nTe8A8BXavefFKxYzwWa/mFh38wj+
b5CucTuVyfEgWk7KNHfTr+9yO5Iq2BnNpPcUlzCG++ARKHk7wF4r03FV4YNUCLe2
B3XXrYKfUI8tW6gfRsMXAoqx8lNbdtN96NmQ83dPDTsfqmCEzCVGSMf00Nsud5va
VUf4tIPLBko2C6GmwvUaqALYv5v9iVJaTlFMV5qp5DfrGU4G3wSVFRToZgziAJaI
sCdq51FmFNobQDu9DB5T
=yk6F
-----END PGP SIGNATURE-----

--Sig_/uKZDJ6SL4fmZ+JG+6+s5cWp--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110112081000.5330ae53>