Bug 24704

Summary: syslog produces repeated corrupt messages to /dev/console under certain circumstances
Product: Base System Reporter: tony <tony>
Component: binAssignee: Poul-Henning Kamp <phk>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   

Description tony 2001-01-28 21:20:01 UTC
Under certain circumstances, syslogd will quickly and repeatedly fill /dev/console with corrupt log output.  Messages are output at a rate of tens per second.  Whenever syslogd exhibits this behaviour, it consumes a large slice of CPU time.  An example of this output is:

4 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus /kernel: Jan 24 23:17:23 cerberus syslogd: restart

These messsages appear on the console without line breaks and without any meaningful log content.

The problem seems to be connected with the newly added LOG_CONSOLE facility (MFC'd recently from CURRENT).  It occurs whenever /etc/syslog.conf contains an entry that causes log messages with the LOG_CONSOLE facility to be directed to /dev/console.  A typical example of a triggering syslog.conf entry would be:

*.*                 /dev/console

Fix: 

Ensure that syslog.conf does not use wildcards in such a way that messages with the LOG_CONSOLE facility are directed to /dev/console.

The syslogd.c source file seems to include code to prevent this particular problem from arising, but it appears to be broken.
How-To-Repeat: 1) Edit /etc/syslog.conf

2) Insert the line:
   *.*                /dev/console
   near the top of the file.

3) Restart syslogd
Comment 1 Kris Kennaway freebsd_committer freebsd_triage 2001-02-02 10:50:40 UTC
Responsible Changed
From-To: freebsd-bugs->phk

phk is the one who added LOG_CONSOLE
Comment 2 dwmalone freebsd_committer freebsd_triage 2001-02-05 13:36:17 UTC
State Changed
From-To: open->closed

Should now be fixed in -current and -stable.