bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inetutils-1.4.1: syslogd still not quite right


From: Michael Deutschmann
Subject: Re: inetutils-1.4.1: syslogd still not quite right
Date: Thu, 19 Sep 2002 03:47:05 -0700 (PDT)

On Thu, 19 Sep 2002, you wrote:
> Michael,
> 
> Thank you for the report. 
> 
> > Your syslogd no longer segfaults when processing accumulated messages at
> > bootup (as it did in 1.4.0).  However, shortly after installing 1.4.1, I
> > noticed that it still does not log these messages correctly.
> 
> Could you please supply some more detail? What incorrectness does the
> syslogd exhibit?

Some messages are truncated or repeated.  The problems strike at bootup
as that is the one practical case where 1k or more of data may be read
from /proc/kmsg at once.  (Since Linux logs ~3k of stuff to a ringbuffer
before even /sbin/init is run.)  Thus stressing the code dealing with 
partial messages that straddle the 1k boundary.

It's easier to point out bits of the present code that are Obviously
Wrong.

First, the for loop ("for (bol = kline, eol =" ...) decrements kline_len
as it goes, but does not move the data left in the buffer. So if kline_len
is nonzero at the end the following read is appended to data that was
already logged. Result: duplicated message (or bits of message).

Immediately afterwards, printsys() is explicitly called on any fragment
in the tail of the buffer, without attempting to re-assemble it.  Result:
Truncated message.

I suppose replacing the printsys(bol) with a memmove() could solve the
problem -- but my patch also allows better recovery from pathological 
kernel output.  And it's more readable IMHO.

---- Michael Deutschmann <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]