Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Mar 2010 22:18:35 +0200
From:      "C. P. Ghost" <cpghost@cordula.ws>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: random FreeBSD panics
Message-ID:  <d74eb87c1003291318q334a9130p4e5f46dfb123611@mail.gmail.com>
In-Reply-To: <201003291427.34641.jhb@freebsd.org>
References:  <b10011eb1003280128k4034e667v1377205888e7a2d@mail.gmail.com> <b10011eb1003291001u767b860aybfc95286d6b04ea6@mail.gmail.com> <20100329173038.GA4969@icarus.home.lan> <201003291427.34641.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 29, 2010 at 8:27 PM, John Baldwin <jhb@freebsd.org> wrote:
>> To developers: what incentives would help get this issue well-needed
>> attention? =A0This problem makes kernel debugging, panic analysis, and
>> other console-oriented viewing basically impossible.
>
> I was recently going to look at it. =A0The somewhat drastic approach I wa=
s going
> to take was to add a simple serializing lock around trap_fatal() and a fe=
w
> other places that do similar block prints (e.g. mca_log()). =A0One of the=
 issues
> with fixing this in printf itself is that you'd want probably want to
> serialize complete lines of text on a per-thread basis. =A0You would want=
 to be
> able to accumulate this line of text across multiple calls to printf (thi=
nk of
> it as line-buffering ala stdio). =A0However, some folks may be nervous ab=
out
> printf not printing things immediately.
>
> The other issue is that lots of code assumes it can call printf from anyw=
here
> and everywhere. =A0Mostly this just means that if you add locking and lin=
e-
> buffering to printf(9) you have to be very careful to make sure it works =
in
> odd places. =A0Probably a lot of this could be solved by deferring things=
 like
> trap_fatal() until panic() has already been called (which is bde's prefer=
red
> solution I think).

How about serializing all printf(9) through a dedicated kernel thread? Mayb=
e
something as flexible as syslogd for kernel space (klogd), that could also
redirect output to a file, to a serial console etc...?

> John Baldwin

-cpghost.

--=20
Cordula's Web. http://www.cordula.ws/



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