Bug 501604

Summary: xinetd can hang while processing unknown signal
Product: Red Hat Enterprise Linux 5 Reporter: Bryan Mason <bmason>
Component: xinetdAssignee: Vojtech Vitek <vvitek>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: low    
Version: 5.3CC: azelinka, cww, hripps, mcermak, ovasik
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 694820 697785 (view as bug list) Environment:
Last Closed: 2011-05-25 08:39:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 502912, 590060, 694820, 697785    
Attachments:
Description Flags
Patch proposed by Siddhesh Poyarekar none

Description Bryan Mason 2009-05-19 23:51:36 UTC
Created attachment 344727 [details]
Patch proposed by Siddhesh Poyarekar

Description of problem:

  If a signal is sent to xinetd when xinetd is in the middle of
  logging to syslog, xinetd could end up hung.

Version-Release number of selected component (if applicable):

  xinetd-2.3.14-10

How reproducible:

  Depends on timing, but can be reproduced reliably once the timing is
  discovered.

Steps to Reproduce:

  1. kill -SIGHUP `pgrep xinetd` && sleep 0.001 && kill -SIGCONT `pgrep xinetd`
  2. adjust the value of sleep until xinetd hangs.  Values vary 
     from 0.001 to 0.2.
  
Actual results:

  xinetd hangs

Expected results:

  no hang

Additional info:

  The core issue seems to be the msg() call within one of the signal
  handlers. When signaled when within a msg() call the earlier
  syslog_write() has already acquired a lock to write the previous
  message to syslog. The current call then simply waits forever trying
  to acquire that lock.

  Proposed patch attached.

  Patch has been proposed upstream as well.  Awaiting feedback from
  upstream maintainer.

Comment 3 RHEL Program Management 2009-11-06 19:03:58 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 13 errata-xmlrpc 2011-05-25 08:39:21 UTC
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-0827.html