Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: runaway klogd/syslogd happening now
@ 1998-10-05 21:24 Greg Lindahl
  1998-10-06  0:09 ` Uncle George
  0 siblings, 1 reply; 31+ messages in thread
From: Greg Lindahl @ 1998-10-05 21:24 UTC (permalink / raw)
  To: axp-list

> [root@helix01 /root]# cat /proc/kmsg 
> <sc 49(140f3bc70,40,8)>

Hm, that's right, unimplemented system calls do not have newlines
after them. So if there were enough, that would cause memory
corruption downstream in syslogd.

So let's make a patch for syslogd which inserts a newline if
the buffer is growing too close to the limit.

-- g


^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: runaway klogd/syslogd happening now
@ 1998-10-06 15:47 Greg Lindahl
  1998-10-06 16:05 ` Michal Jaegermann
  1998-10-06 19:53 ` Quant-X Alpha Linux Support
  0 siblings, 2 replies; 31+ messages in thread
From: Greg Lindahl @ 1998-10-06 15:47 UTC (permalink / raw)
  To: axp-list

> > It's fine to fix the kernel, which will paper over the other bugs, but
> > it would be good to fix the other bugs too. We know that syslogd also
> > has a bug because it is reading a bogus fd.
> 
> No, actually we don't (unless this is a lack of a guard against
> a buffer overflow somewhere where there is no way to control input
> data).

If syslogd doesn't have a bug, why is it reading from a fd which is
too large? It must have a bug.

> I did not analyze the bug in depth; indeed, I was not even struck by an
> instance of it.

You can probably generate it by just intentionally making a lot of
unimplemented system calls. Remember that folks are reporting that
under unknown circumstances, normal binaries start producing lots of
those messages about unimplemented system calls.

-- g


^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: runaway klogd/syslogd happening now
@ 1998-10-06 15:44 Greg Lindahl
  0 siblings, 0 replies; 31+ messages in thread
From: Greg Lindahl @ 1998-10-06 15:44 UTC (permalink / raw)
  To: axp-list

> Maybe syslogd can't read the /proc file system and in a result is reporting
> the bogus fd problem?

Why say "maybe"? The strace posted earlier makes it clear that syslogd
is printing that error because it is trying to read from a bogus fd
number. Somehow it got overwritten. That somehow could revolve around
long messages.

> I'm moving slow on my changes to klogd, does anyone have any patch or
> sample code/ideas to fix this?  My Alpha machine is crashing daily on
> 2.0.35,

Exactly how did you build 2.0.35? No one else has reported that level
of problem. If you look through the archive of this list you will find
instructions on how to take vanilla 2.0.35 and apply the 2.0.34 axp
patch to it. I'm running 67 machines with 2.0.35 and have never gotten
a mysterious crash.

> and I would love to know if kmesgd/syslogd is the problem,

No one else has ever reported a crash from the klogd/syslogd problem,
just high cpu consumption.

-- g


^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: runaway klogd/syslogd happening now
@ 1998-10-06 13:15 Greg Lindahl
  1998-10-06 13:26 ` Barrett G. Lyon
  1998-10-06 15:31 ` Michal Jaegermann
  0 siblings, 2 replies; 31+ messages in thread
From: Greg Lindahl @ 1998-10-06 13:15 UTC (permalink / raw)
  To: axp-list

> > actually its klogd that reads kern messages, like the one u posted.
> > 
> > its probably better to fix the kern messages.
> 
> Patches which Jay announced for 2.0.35 (and things which I hacked
> based on that for an upcoming 2.0.36) actually add missing
> newline.  It is in arch/alpha/kernel/traps.c.

It's fine to fix the kernel, which will paper over the other bugs, but
it would be good to fix the other bugs too. We know that syslogd also
has a bug because it is reading a bogus fd.

As for what buffer size to insert the \n at, how about the length of
the buffer you're reading into minus one?

-- g


^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: runaway klogd/syslogd happening now
@ 1998-10-04 21:20 Greg Lindahl
  1998-10-04 21:48 ` B. James Phillippe
  1998-10-04 23:24 ` Uncle George
  0 siblings, 2 replies; 31+ messages in thread
From: Greg Lindahl @ 1998-10-04 21:20 UTC (permalink / raw)
  To: axp-list

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

Except:

1) People say that there are no kernel errors unterminated by a
newline (other than ones which are quickly followed by one that does
have a newline), and

2) There is a patch for klogd which fixes the buffer overflow that
would result from a repeated kernel message sans newline, and that
klogd patch does not fix the overall problem.

For #2 I am not sure I am remembering things right, but I'd swear that
there was a new klogd rpm issued for rh 5.1 specifically for that
particular buffer overflow problem.

-- g


^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: runaway klogd/syslogd happening now
@ 1998-10-04 14:39 Greg Lindahl
  0 siblings, 0 replies; 31+ messages in thread
From: Greg Lindahl @ 1998-10-04 14:39 UTC (permalink / raw)
  To: axp-list

> 3) klogd is annoying the hell outta syslogd ( which seems to be prevalent
> to 5.0 folks )

This theory is proven by the strace posted before. What we don't know
yet is why klogd is reading off the wrong fd. However, it's easy to
work around it, since klogd only opens one file... and indeed, if you
could detect where the fd variable is being corrupted (by checking it
frequently), that could tell you what was causing the corruption.

-- g


^ permalink raw reply	[flat|nested] 31+ messages in thread
[parent not found: <199810030609.CAA23387@neptune.phys.ufl.edu>]
* Re: runaway klogd/syslogd happening now
@ 1998-10-03 15:03 David Levine
  0 siblings, 0 replies; 31+ messages in thread
From: David Levine @ 1998-10-03 15:03 UTC (permalink / raw)
  To: axp-list

Shane Steven Sturrock writes:

> Paul Tomblin wrote:
>
> > Last weekend I upgraded my system to RedHat 5.1 (thanks to the Cable Modem
> an
> > FTP upgrade takes less time than a CD-ROM upgrade used to).  I've been runn
> ing
> > for 6 days without a runaway, and (knock wood) I'm hoping that's it.
>
> Don't bet on it.  My 164SX ground to a halt with the syslogd runaway and I am
> running RH5.1 with all the updates.

Ditto.  I tried RH 5.1 both with and without updates, but
still hit the problem.

I avoid the problem but not running any of my threaded
applications.

I'm still looking for glibc 2.0.7-7 :-/

Thanks,
David


^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: runaway klogd/syslogd happening now
@ 1998-10-03  7:12 Shane Steven Sturrock
  0 siblings, 0 replies; 31+ messages in thread
From: Shane Steven Sturrock @ 1998-10-03  7:12 UTC (permalink / raw)
  To: axp-list

Paul Tomblin wrote:

> Last weekend I upgraded my system to RedHat 5.1 (thanks to the Cable Modem an
> FTP upgrade takes less time than a CD-ROM upgrade used to).  I've been running
> for 6 days without a runaway, and (knock wood) I'm hoping that's it.

Don't bet on it.  My 164SX ground to a halt with the syslogd runaway and I am
running RH5.1 with all the updates.  I didn't have the presence of mind at the
time to get the necessary info together about what was going on but the next
time it happens I will have a poke about before I shut the thing down.  Its
running now after a reboot.  The machine had been up for 37 days before the bug
hit.  Looks like its not just SXs that get this either...... :-(

Shane

--
Dr. Shane Sturrock - sss@holyrood.ed.ac.uk
kernel: Calibrating delay loop.. ok - 529.53 BogoMIPS
Mmmmmmmmmmm :-)


^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: runaway klogd/syslogd happening now
@ 1998-10-03  0:29 Greg Lindahl
  1998-10-03  0:58 ` B. James Phillippe
  0 siblings, 1 reply; 31+ messages in thread
From: Greg Lindahl @ 1998-10-03  0:29 UTC (permalink / raw)
  To: axp-list

> [root@helix01 /root]# cat /etc/redhat-release 
> release 5.0 (Hurricane)
> [root@helix01 /root]# cat /proc/sys/kernel/file-max
> 1024
> [root@helix01 /root]# cat /proc/sys/kernel/file-nr
> 320
> [root@helix01 /root]# cat /proc/sys/kernel/inode-max 
> 3072
> [root@helix01 /root]# cat /proc/sys/kernel/inode-nr 
> 920     665

Thanks much. This proves that it's some process-local problem.

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

I would forward this to bugs@redhat.com, except of course they don't
allow submission of bugs by email anymore. So I guess I'm supposed to
paste a few hundred lines of complaint into a web form or something.
Heck, maybe I'll just mail it to the right person and bypass their
bug-tracking system... In any case, I will report it.

Thanks much for your report. It is good to see that you have carefully
read the previous discussions and you provided every single bit of
possible useful information that was ever asked. An excellent job.

-- g


^ permalink raw reply	[flat|nested] 31+ messages in thread
* runaway klogd/syslogd happening now
@ 1998-10-02 19:30 Craig P Prescott
  1998-10-02 22:39 ` Uncle George
  1998-10-03  3:00 ` Paul Tomblin
  0 siblings, 2 replies; 31+ messages in thread
From: Craig P Prescott @ 1998-10-02 19:30 UTC (permalink / raw)
  To: axp-list


Hi, all;

We have 13 533 MHz 164LXs in a producing high energy physics
simulation data.  Two of these nodes are presently suffering from the
"klogd and syslogd are eating all the CPU" problem, so I thought I
would post and ask the readers of this list if there is any more
information I can provide regarding this problem, in the hope that
additional info can help to solve this problem once and for all.
Barring any responses, at least this can be a data point.  I will not
restart the logging daemons on these boxes for at least a few hours to
give time for replies from the group.

Enclosed below is some info which may be helpful.  These are 5.0 boxes
running kernel 2.0.32 with patches.  I know the kernel version is
ancient...  Microway set these boxes up a bit weird when we purchased
them, IMHO - I'll be installing 5.1 from scratch during the next down
time.

This particular problem has never happened here when the nodes are
idling (i.e., not running the big simulation jobs).  This means CPU
load and network access.  

We've been running since May or so, and we switched from hard mounting
all the disks to using amd during the first few weeks of running.  I
mention this since I don't recall us having this problem before we
went to using automount.  I know this is a shot in the dark, but do
the others who suffer from this problem also use amd?  amd -v output
is at the end of this note.

Anyway, if I can provide any more useful info, please tell me what to
do.  Also, as I have never used strace before, any pointers on how to
get the most useful info out of it would be appreciated.

Many thanks in advance,
Craig
---
Craig P Prescott                              (352) 846-3145 (Phone)
2011 New Physics Building                     (352) 392-8863 (Fax)
University of Florida, Gainesville, FL 32611  prescott@phys.ufl.edu


[root@helix01 /root]# uname -a
Linux helix01 2.0.32 #1 Mon Mar 23 12:52:55 EST 1998 alpha unknown
[root@helix01 /root]# cat /etc/redhat-release 
release 5.0 (Hurricane)
[root@helix01 /root]# cat /proc/sys/kernel/file-max
1024
[root@helix01 /root]# cat /proc/sys/kernel/file-nr
320
[root@helix01 /root]# cat /proc/sys/kernel/inode-max 
3072
[root@helix01 /root]# cat /proc/sys/kernel/inode-nr 
920     665
[root@helix01 /root]# grep initdefault /etc/inittab | grep id
id:3:initdefault:
[root@helix01 /root]# ls /etc/rc.d/rc3.d/
K10named        K40snmpd        S30syslog       S60lpd          S80sendmail
K15gpm          K55routed       S40atd          S60nfs          S99local
K15httpd        K98kerneld      S40crond        S60nfs.rpmsave
K15sound        S10network      S40portmap      S60rwhod
K20rusersd      S15nfsfs        S50inet         S72amd
K35smb          S20random       S55ypbind       S75keytable
[root@helix01 /root]# strace -V
strace -- version 3.1
[root@helix01 /root]# top
  2:23pm  up 4 days,  4:23,  3 users,  load average: 2.94, 2.61, 2.60
47 processes: 41 sleeping, 5 running, 1 zombie, 0 stopped
CPU states: 72.4% user, 27.4% system,  0.0% nice,  0.4% idle
Mem:  125760K av, 124312K used,   1448K free,  31536K shrd,   5728K buff
Swap: 523640K av,   1568K used, 522072K free                 66960K cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME COMMAND
  165 root      19   0   632  608   488 R     560 26.0  0.2 469:31 klogd
  156 root      19   0   920  800   696 S     728 25.7  0.3 461:07 syslogd
15116 cleomc    20   0 42376  41M  5416 R     35M 23.6 16.8   1:05 cleog
  635 root       4   0  2688 2536  1944 S    2320 14.5  1.0   0:06 xterm
  254 root       3   0   944  928   640 R     816  9.1  0.3 163:38 rpc.nfsd
15150 root       1   0  1072 1072   816 R    1008  0.7  0.4   0:00 top
    1 root       0   0   600  520   472 S     472  0.0  0.2   0:17 init
    2 root       0   0     0    0     0 SW      0  0.0  0.0   0:16 kflushd
    3 root      17  17     0    0     0 SWN     0  0.0  0.0   0:00 kswapd
    4 root       0   0     0    0     0 SW      0  0.0  0.0   0:00 nfsiod
    5 root       0   0     0    0     0 SW      0  0.0  0.0   0:00 nfsiod
    6 root       0   0     0    0     0 SW      0  0.0  0.0   0:00 nfsiod
    7 root       0   0     0    0     0 SW      0  0.0  0.0   0:00 nfsiod
  650 cleomc     0   0  1672 1552  1160 S    1032  0.0  0.6   0:00 tcsh
  341 root       0   0   480  384   376 S     376  0.0  0.1   0:00 mingetty
  342 root       0   0   480  384   376 S     368  0.0  0.1   0:00 mingetty
   27 root       0   0   528  456   416 S     424  0.0  0.1   0:00 kerneld

/var/log/messages containts the standard slew of complaints:

Oct  2 14:21:57 helix01 kernel: Cannot read proc file system: 9 - Bad file descriptor.
Oct  2 14:22:27 helix01 last message repeated 155510 times
Oct  2 14:23:28 helix01 last message repeated 351761 times
Oct  2 14:24:30 helix01 last message repeated 262479 times
Oct  2 14:25:30 helix01 last message repeated 355391 times
Oct  2 14:26:31 helix01 last message repeated 377503 times
Oct  2 14:27:32 helix01 last message repeated 373464 times
Oct  2 14:28:33 helix01 last message repeated 356431 times

and so on.

I "strace -c"'d the klogd and syslogd PIDs.  Here is what they spit
out:

klogd:

write(1, "<3>Oct  2 14:29:51 kernel: Canno"..., 82) = 82
read(15913, 0x120107f84, 4096)          = -1 EBADF (Bad file descriptor)
gettimeofday({907352991, 883789}, NULL) = 0
write(1, "<3>Oct  2 14:29:51 kernel: Canno"..., 82) = 82
read(15913, 0x120107f84, 4096)          = -1 EBADF (Bad file descriptor)
gettimeofday({907352991, 886719}, NULL) = 0

etc., over and over again.  The return value of the write is always
82, and the read is always -1 EBADF.

syslogd:

gettimeofday({907353054, 104492}, NULL) = 0
gettimeofday({907353054, 104492}, NULL) = 0
gettimeofday({907353054, 105469}, NULL) = 0
gettimeofday({907353054, 105469}, NULL) = 0
select(1024, [0 3 8 9 10 11 12 13 14], NULL, NULL, NULL) = 1 (in [3])
read(3, "not read proc file system: 9 - B"..., 1024) = 1024
gettimeofday({907353054, 115235}, NULL) = 0
gettimeofday({907353054, 115235}, NULL) = 0
gettimeofday({907353054, 115235}, NULL) = 0
gettimeofday({907353054, 115235}, NULL) = 0
gettimeofday({907353054, 115235}, NULL) = 0
gettimeofday({907353054, 116211}, NULL) = 0
gettimeofday({907353054, 116211}, NULL) = 0
gettimeofday({907353054, 116211}, NULL) = 0
gettimeofday({907353054, 116211}, NULL) = 0
gettimeofday({907353054, 116211}, NULL) = 0
gettimeofday({907353054, 116211}, NULL) = 0
gettimeofday({907353054, 117188}, NULL) = 0
select(1024, [0 3 8 9 10 11 12 13 14], NULL, NULL, NULL) = 1 (in [3])
read(3, "descriptor.\0<3>Oct  2 14:30:54 "..., 1024) = 1024
gettimeofday({907353054, 118164}, NULL) = 0
gettimeofday({907353054, 118164}, NULL) = 0

etc., over and over again.  There are usually 12 (though sometimes 13)
gettimeofday messages between every select and read.

Not too surprising, I guess...

[root@helix01 /root]# amd -v
Copyright (c) 1997-1998 Erez Zadok
Copyright (c) 1990 Jan-Simon Pendry
Copyright (c) 1990 Imperial College of Science, Technology & Medicine
Copyright (c) 1990 The Regents of the University of California.
am-utils version 6.0a16 (build 1).
Built by root@spacely.redhat.com on date Tue May  5 20:11:27 EDT 1998.
cpu=alphaev5 (little-endian), arch=alpha, karch=alpha.
full_os=linux, os=linux, osver=2.0.30, vendor=unknown.
Map support for: root, passwd, union, ndbm, file, error.
AMFS: nfs, link, nfsx, nfsl, host, linkx, program, union, inherit, 
      ufs, cdfs, pcfs, auto, direct, toplvl, error.
FS: isofs, nfs, vfat, ext2.
Network: wire="npb2-net.phys.ufl.edu" (netnumber=128.227.89).


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~1998-10-07 10:26 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-10-05 21:24 runaway klogd/syslogd happening now 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
  -- 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-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-03  0:29 Greg Lindahl
1998-10-03  0:58 ` B. James Phillippe
1998-10-05  6:11   ` Craig P Prescott
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox