Bug 36110 - dmesg(8) output corrupt if /dev/console is busy
Summary: dmesg(8) output corrupt if /dev/console is busy
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 4.5-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2002-03-19 22:30 UTC by chris
Modified: 2018-05-20 23:50 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description chris 2002-03-19 22:30:01 UTC
     At version 4.3 dmesg -a was added, so you can see console output remotely.  If you have lots of output going to /dev/console (happened at 32k of data here) dmesg output will not be readable eventually.  The LINT file says MSGBUF_SIZE=40960, but "dmesg -a >file;du file" reports 32(k) when it is broken.  It should push out old lines and append new ones when it is full.


Reboot to get a sane dmesg output back.
How-To-Repeat: Set up syslog to log to /dev/console, and send more than ~32k (or whatever your MSGBUF_SIZE is) of data to that facility.  Then run dmesg.  If it is corrupt, run dmesg -a, redirect to a file, and see how large the file is.  It should be about the same as MSGBUF_SIZE.
Comment 1 Robert Watson freebsd_committer 2004-05-02 23:25:33 UTC
State Changed
From-To: open->analyzed

This occurs because we use a single combined buffer for both kernel 
messages (normally captured in the kernel's msgbuf) and logged 
console output (/dev/console).  This results in a variety of problems, 
and would probably be best corrected by breaking out msgbuf into two 
separate buffers since their contents have different properties. 

An important security issue relating to this bug/feature can be found 
in bin/25337.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:50:40 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

- Set Status to "Open"