Bug 491637 - possible deadlock in ctime() called from signal handler
possible deadlock in ctime() called from signal handler
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: sysklogd (Show other bugs)
4.6
All Linux
urgent Severity urgent
: rc
: ---
Assigned To: Peter Vrabec
BaseOS QE
: ZStream
Depends On:
Blocks: 485811 615340
  Show dependency treegraph
 
Reported: 2009-03-23 09:14 EDT by Tomas Smetana
Modified: 2011-02-16 09:07 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: In case a message is being logged, syslogd calls ctime() which locks a futex. If at the same moment also a MARK message alarm occurs, the ctime() is called again from the signal handler and the futex is never released. Consequence: deadlock Fix: syslogd will no longer generate any I/O nor call ctime() within the signal handler Result: no deadlock
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-02-16 09:07:12 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed patch (2.90 KB, patch)
2009-03-23 09:16 EDT, Tomas Smetana
no flags Details | Diff

  None (edit)
Description Tomas Smetana 2009-03-23 09:14:47 EDT
Description of problem:
The syslogd daemon can deadlock in ctime() call when set up to output MARK messages:  In case a message is being logged, syslogd calls ctime() which locks a futex.  If at the same moment also a MARK message alarm occurs, the ctime() is called again from the signal handler and the futex is never released which leads to a deadlock.

Version-Release number of selected component (if applicable):
sysklogd-1.4.1-26_EL

How reproducible:
Sometimes

Steps to Reproduce:
1. Configure syslogd to output the MARK messages (e.g. by setting SYSLOGD_OPTIONS="-m1" in /etc/sysconfig/syslog)
2. Let the system run
  
Actual results:
syslogd hangs in ctime() call sometimes

Expected results:
no hang

Additional info:
This is a known problem which was fixed in sysklogd-1.4.1-28 (and therefore is not present in RHEL-5) -- see bug #152319.
Comment 1 Tomas Smetana 2009-03-23 09:16:22 EDT
Created attachment 336287 [details]
Proposed patch

Merge of patches for bug #152319 and bug #158205 (the former contained a regression).
Comment 14 Florian Nadge 2011-01-19 10:42:03 EST
Please be so kind and add a few key words to the technical note of this
bugzilla entry using the following structure:

Cause:

Consequence:

Fix:

Result:


For details, see:
https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes

Thanks
Comment 15 Florian Nadge 2011-01-19 10:42:04 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause:

Consequence:

Fix:

Result:
Comment 16 Peter Vrabec 2011-01-20 10:47:12 EST
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,7 +1,10 @@
-Cause:
+Cause: In case a message is being logged, syslogd calls ctime() which locks a futex.  If at the same moment also a MARK message alarm occurs, the ctime() is called again from the signal handler and the futex is never released.
 
 Consequence:
+deadlock
 
 Fix:
+syslogd will no longer generate any I/O  nor call ctime() within the signal handler
 
-Result:+Result:
+no deadlock
Comment 17 errata-xmlrpc 2011-02-16 09:07:12 EST
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-2011-0225.html

Note You need to log in before you can comment on or make changes to this bug.