sysklogd enters infinite loop, uses 100% CPU

Bug #348286 reported by Chris Eineke
2
Affects Status Importance Assigned to Milestone
sysklogd (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: klogd

# lsb_release -rd
Description: Ubuntu 8.10
Release: 8.10

# dpkg-query --show | grep sysklogd
sysklogd 1.5-2ubuntu6

Initial Symptom: I was dd'ing from /dev/zero to a file, when klogd's CPU usage shot to about 100%. I strace'd the process:
...
read(0, "", 4095) = 0
read(0, "", 4095) = 0
read(0, "", 4095) = 0
read(0, "", 4095) = 0
read(0, "", 4095) = 0
...
and it seems to be stuck in an infinite loop. I dug through the source to see where read is called. There's a non-match in syslogd.c (3rd parameter would be 1024) and a match in klogd.c: function LogProcLine, line 988, which is called from main, line 1219. LogProcLine checks if read's return code is less than zero, else passes the buffer to LogLine. LogLine's main loop is while len is bigger than 0, which obviously is never hit. I surmise that LogProcLine needs to handle the zero return code (which indicates that the stream has been closed) or pass this fact back to the main loop which should take appropriate steps.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.