[asterisk-bugs] [Asterisk 0015474]: Race condition in cdr_syslog.c (SVN Revision 205561)

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Jul 9 06:28:42 CDT 2009


The following issue has been SUBMITTED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15474 
====================================================================== 
Reported By:                praise
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   15474
Category:                   CDR/NewFeature
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 205561 
Request Review:              
====================================================================== 
Date Submitted:             2009-07-09 06:28 CDT
Last Modified:              2009-07-09 06:28 CDT
====================================================================== 
Summary:                    Race condition in cdr_syslog.c (SVN Revision 205561)
Description: 
There is a race condition in these lines of code:

openlog(sink->ident, LOG_CONS, sink->facility);
syslog(sink->priority, "%s", ast_str_buffer(str));
closelog();

openlog interferes with all syslog calls in the process. Since asterisk
is multithreaded, some other syslog message may be sent with syslog
ident/facility, or some other call to openlog might interfere with this
module's
syslog call.
This is not going to happen very often, but nevertheless it is an issue.

I have resolved here piping to a different process which routes all
messages
to syslog with correct values,but implementation of a global syslog
manager could be a more elegant solution.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-07-09 06:28 praise         New Issue                                    
2009-07-09 06:28 praise         Asterisk Version          => SVN             
2009-07-09 06:28 praise         Regression                => No              
2009-07-09 06:28 praise         SVN Branch (only for SVN checkouts, not tarball
releases) =>  trunk          
2009-07-09 06:28 praise         SVN Revision (number only!) => 205561          
======================================================================




More information about the asterisk-bugs mailing list