[asterisk-bugs] [Asterisk 0010347]: Asterisk Crashes in cdr_csv.c during csv_log while trying to close the log file

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Aug 27 14:42:28 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10347 
====================================================================== 
Reported By:                explidous
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   10347
Category:                   CDR/cdr_csv
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     new
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 77826 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             07-31-2007 16:13 CDT
Last Modified:              08-27-2007 14:42 CDT
====================================================================== 
Summary:                    Asterisk Crashes in cdr_csv.c during csv_log while
trying to close the log file
Description: 
Under moderately high load Asterisk crashes while trying to close the the
log file at line 296 in cdr_csv.c. It seems that two processes call this
function at the same time and try to close the file descriptor twice. This
is most likely because a lock was removed somewhere in Asterisk.

To fix this I made the module only close the file on unload and reload and
open the file on load and reload and put a lock around where it actually
writes to the file. Previously Asterisk opened the file, wrote to the file,
flushed the buffer, then closed the file. This was most likely due to the
fact that fflush() had problems in the past not properly flushing the
buffer. This has been fixes since about 2002. Now Asterisk locks, writes to
the file, unlocks, then flushes the buffer. This also makes this function
thread safe.

I have not had Asterisk crash at this point since (12 tries so far).
====================================================================== 

---------------------------------------------------------------------- 
 Corydon76 - 08-27-07 14:42  
---------------------------------------------------------------------- 
Any reason why this issue seems to be stuck in limbo?  Should it be added
to 1.4, as well? 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-27-07 14:42  Corydon76      Note Added: 0069516                          
======================================================================




More information about the asterisk-bugs mailing list