Created attachment 348404 [details] Proposed patch +++ This bug was initially created as a clone of Bug #500354 +++ Description of problem: The fix for bug #140983 makes system calls interruptible with SIGALRM. But if that signal is triggered during a writev() (which can happen when writing so a slow console via serial), syslog will print a message "/dev/console: Interrupted system call" and stop logging to console. Version-Release number of selected component (if applicable): sysklogd-1.4.1-26_EL How reproducible: Just once in the customer's environment. 100% with following reproducer Steps to Reproduce: 1. Connect the serial console 2. Edit /etc/syslog.conf as follows to have syslogd write many messages to /dev/console. --- [/etc/syslog.conf] *.debug /dev/console --- 3. On the another system where the serial is connected, run "cu" as console: # cu -l ttyS0 -s 9600 -o -e (note: cu comes with the "uucp" package) 4. Execute the following example program to log messages continuously to syslog. $ for i in $(seq 1 500); do logger test $i; done 5. Suspend the output on the other system with "ctrl-s" Actual Results: After a random amount of time (t < 30s), either the messages get truncated or syslog will stop logging to the console. Expected Results: The messages are not truncated and there is at least a 30 secs grace time before syslog gives up and closes the file descriptor to the console. Additional info: The problem occurs because the sigalrm() is not set before calling writev() in syslog and may occur at any time. If the alarm is triggered during the writev(), the file descriptor is closed and syslog will not log anymore. Also, if the I/O buffer gets full, writev() will not send the entirety of the message to the log, causing messages to be truncated. The proposed patch avoids both problems by: - Rescheduling the ALARM just prior to call writev() to make avoid a signal coming up during the writev() - Recomputing iovec when writev() could not write all data to avoid messages being half written to the log. Customer confirmed the fix in bz#500354 - The patch is not entirely identical to the one in bz#500354 as the code is slightly different between syslog for el4 and el5.
Version-Release number of selected component (if applicable): sysklogd-1.4.1-44.el5
@Oliver, @GSS Could we ask the customer to test Beta bits to confirm this issue has been fixed? Thanks!
~~ Attention Customers and Partners - RHEL 5.5 Beta is now available on RHN ~~ RHEL 5.5 Beta has been released! There should be a fix present in this release that addresses your request. Please test and report back results here, by March 3rd 2010 (2010-03-03) or sooner. Upon successful verification of this request, post your results and update the Verified field in Bugzilla with the appropriate value. If you encounter any issues while testing, please describe them and set this bug into NEED_INFO. If you encounter new defects or have additional patch(es) to request for inclusion, please clone this bug per each request and escalate through your support representative.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2010-0211.html