Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 154465 - syslog-ng hangs writing to /dev/ttyN
Summary: syslog-ng hangs writing to /dev/ttyN
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Mr. Bones. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-08 06:06 UTC by Richard Smith
Modified: 2006-11-15 11:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch (syslog-ng-2.0.0-alarm.patch,994 bytes, patch)
2006-11-08 06:08 UTC, Richard Smith
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Smith 2006-11-08 06:06:04 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20060109 Firefox/1.0.6
Build Identifier: 

When syslog-ng writes to a tty under Linux, for example as a
result of a usertty directive, the write syscall to
/dev/ttyN can ocassionally block indefinitely.  One
situation when this occurs is when the user has set XOFF
(perhaps with Ctrl-S or Scroll Lock).

Aside from the fact that this obvious prevents any further
log messages from being written, /dev/log's buffer
eventually fills up causing other programs to block writing
to /dev/log.  In extremis, this can render a machine
inaccesible when ssh, etc., all block preventing access.



Reproducible: Always

Steps to Reproduce:
1. Check that there is a usertty("*") directive for (say) kern.emerg logs
2. Ensure syslog-ng is running
3. On console, press Scroll Lock
4. Log something, e.g. logger -p kern.emerg 'Foo'.
5. Repeat #4 many times; eventually it will hang trying to log
Comment 1 Richard Smith 2006-11-08 06:08:31 UTC
Created attachment 101464 [details, diff]
Patch

The attached patch (relative to the 2.0.0 release) fixes
this by imposing a 15s timeout on all console writes.
(This figure should perhaps be configurable, but for my
immediate purposes 15s is quite sufficient.)  I've only
tested this patch on Linux.
Comment 2 Richard Smith 2006-11-08 06:16:39 UTC
I suspect that bug #69294 (which was never fully diagnosed and eventually closed as 'invalid') is a duplicate of this.
Comment 3 Mr. Bones. (RETIRED) gentoo-dev 2006-11-08 12:03:12 UTC
Did you send this patch upstream?
Comment 4 Richard Smith 2006-11-08 15:22:15 UTC
I sent it to the address the AUTHORS file and to their mailing list, though I've not had a reply and the mailing list archive is accessible to subscribers only so I've no way of knowing whether the patch was actually received.  (The upstream doesn't extactly make it easy to submit patches ;-(.)
Comment 5 Mr. Bones. (RETIRED) gentoo-dev 2006-11-15 11:52:00 UTC
I talked with the upstream and they're not excited about this patch.  There is a different, more general solution to this issue in the works for a future version of syslog-ng.  I'm not inclined to make the patch part of the Gentoo package.

Since upstream won't be absorbing the patch and the issue is very avoidable and understood, and since upstream is working on a feature to address this situation, I'm going to mark this bug as UPSTREAM.  Please work with upstream on the feature for a future release of syslog-ng.  Thanks.