[asterisk-bugs] [Asterisk 0018615]: Format list should be copied before being iterated in ast_filehelper

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Jan 18 16:57:50 CST 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18615 
====================================================================== 
Reported By:                heath1444
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18615
Category:                   Core/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.6.2.15 
JIRA:                       SWP-2908 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-01-13 14:55 CST
Last Modified:              2011-01-18 16:57 CST
====================================================================== 
Summary:                    Format list should be copied before being iterated
in ast_filehelper
Description: 
If the disk is slow for whatever reason you get resource starvation if too
many threads are making calls to this function because the list is locked
the entire time.

It's bad enough for me that I'm going to have to put all the files in
/var/lib/asterisk/sounds/en/ on a ramdisk.

Thanks for looking!

Heath
====================================================================== 

---------------------------------------------------------------------- 
 (0130650) heath1444 (reporter) - 2011-01-18 16:57
 https://issues.asterisk.org/view.php?id=18615#c130650 
---------------------------------------------------------------------- 
I'm used to just doing std::copy(blah blah) lol... Am I on the right track
here?

   AST_LIST_HEAD(copy_of_formats, format) copy_of_formats;
   AST_RWLIST_RDLOCK(&formats);

   AST_RWLIST_TRAVERSE(&formats, f, list) {   
// ?????????
//    AST_LIST_INSERT_TAIL(&copy_of_formats, &f, wat do)                  
                    
   }                    

    // Unlock here instead of after iteration
   //AST_RWLIST_UNLOCK(&formats); 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-18 16:57 heath1444      Note Added: 0130650                          
======================================================================




More information about the asterisk-bugs mailing list