From: "B. James Phillippe" <bryan@terran.org>
To: axp-list@redhat.com
Subject: Re: runaway klogd/syslogd happening now
Date: Fri, 2 Oct 1998 17:58:45 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.3.96.981002173506.4172F-100000@earth.terran.org> (raw)
In-Reply-To: <199810030029.UAA15757@adder.cs.Virginia.EDU>
On Fri, 2 Oct 1998, Greg Lindahl wrote:
> > klogd:
> >
> > write(1, "<3>Oct 2 14:29:51 kernel: Canno"..., 82) = 82
> > read(15913, 0x120107f84, 4096) = -1 EBADF (Bad file descriptor)
>
> And here we see klogd is reading from a bogus file descriptor. A
> process-local bug, probably not a kernel bug.
>
> That doesn't tell you how klogd got the bogus fd, but it should be
> enough for RedHat to at least insert a workaround.
The only file descriptor klogd should be reading is /proc/kmsg. You can
verify this by:
Get the pid of klogd; ps has it, and so does top (which he posted
output from previously).
% ps aux|grep klog
bryan 20395 0.0 0.3 936 316 p7 S 17:32 0:00 grep klog
root 147 0.0 0.2 968 200 ? S Aug 25 0:00 klogd
%
Now look in the directory /proc/PID/fd (as root).
% ls -l /proc/147/fd
total 0
lr-x------ 1 root root 64 Oct 2 17:33 0 -> [0001]:5
lrwx------ 1 root root 64 Oct 2 17:33 1 -> [0000]:480
%
There are two filedescriptors; 0 and 1. fd0 is on device 00:01 (the /proc
filesystem) attached to inode #5, and fd1 is on device 00:00 (a UNIX domain
socket) attached to inode #480. I can guess that fd0 is for input and fd1
is for output (based on the permissions of the files).
netstat can find the UNIX domain socket (not that we need it; we know
there's not a problem writing, but it's fun to hunt down anyway).
% netstat
....
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ] STREAM CONNECTED 480
unix 2 [ ] STREAM 481 /dev/log
........
%
Okay, so that must be how klogd communicates with syslogd. One down, one
to go. We can use find to find the file matching inode #5 on device 00:01.
% find /proc -inum 5
/proc/kmsg
%
Ah, this is how klogd gets kernel messages.. so everything klogd said was
true; it can't read the /proc filesystem. Can another user-space utility
open and read from this file while klogd is spinning? For instance, when
you "cat /proc/kmsg", what do you see?
As for the cause of this problem, I think Uncle George posted a
reasonable-sounding explanation. IIRC, it was that use of an unimplemented
syscall returned a kernel error message that was not terminated by a
newline, many times over, and klogd trashes it's stack trying to parse it,
and ... ? Am I warm?
-bp
--
B. James Phillippe . bryan@terran.org
UNIX Software Engineer . http://www.terran.org/~bryan
Member since 1.1.59 . finger:bryan@earth.terran.org
MOTM: Waiting for the DSL to go in :)
next prev parent reply other threads:[~1998-10-03 0:57 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-10-03 0:29 runaway klogd/syslogd happening now Greg Lindahl
1998-10-03 0:58 ` B. James Phillippe [this message]
1998-10-05 6:11 ` Craig P Prescott
-- strict thread matches above, loose matches on Subject: below --
1998-10-06 15:47 Greg Lindahl
1998-10-06 16:05 ` Michal Jaegermann
1998-10-06 19:53 ` Quant-X Alpha Linux Support
1998-10-06 15:44 Greg Lindahl
1998-10-06 13:15 Greg Lindahl
1998-10-06 13:26 ` Barrett G. Lyon
1998-10-06 15:31 ` Michal Jaegermann
1998-10-05 21:24 Greg Lindahl
1998-10-06 0:09 ` Uncle George
1998-10-06 0:27 ` Barrett G. Lyon
1998-10-06 0:46 ` Uncle George
1998-10-06 0:45 ` Barrett G. Lyon
1998-10-06 7:12 ` Michal Jaegermann
1998-10-06 12:12 ` Craig P Prescott
1998-10-06 22:09 ` Jeff Sturm
1998-10-06 22:52 ` Peter Waltenberg
1998-10-07 10:22 ` Uncle George
1998-10-04 21:20 Greg Lindahl
1998-10-04 21:48 ` B. James Phillippe
1998-10-04 23:24 ` Uncle George
1998-10-04 14:39 Greg Lindahl
[not found] <199810030609.CAA23387@neptune.phys.ufl.edu>
1998-10-04 13:41 ` Uncle George
1998-10-03 15:03 David Levine
1998-10-03 7:12 Shane Steven Sturrock
1998-10-02 19:30 Craig P Prescott
1998-10-02 22:39 ` Uncle George
1998-10-03 0:02 ` Craig P Prescott
1998-10-03 3:00 ` Paul Tomblin
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox