[asterisk-bugs] [Asterisk 0016639]: Crash In chan_local in local_queue_frame (ast_mutex_trylock)

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jan 18 20:37:10 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16639 
====================================================================== 
Reported By:                geoff2010
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16639
Category:                   Channels/chan_local
Reproducibility:            random
Severity:                   crash
Priority:                   normal
Status:                     new
Asterisk Version:           Older 1.4 - please test a newer version 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-01-18 16:07 CST
Last Modified:              2010-01-18 20:37 CST
====================================================================== 
Summary:                    Crash In chan_local in local_queue_frame
(ast_mutex_trylock)
Description: 
I had a server randomly crash on me today.  I am currently running 1.4.26,
but have scanned all the release notes up until 1.4.29 and found nothing
that would indicate a change to chan_local was made to correct this issue. 
Unfortunately this is a very high profile platform and I can't just upgrade
without knowing for certain the bug has been corrected.

I also searched the bug list and the most similar ticket I found was for
the 1.6 branch.  I have attached the bt and bt full.  Please let me know if
there is anything else I can provide.

Thanks.
Geoff


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

---------------------------------------------------------------------- 
 (0116870) geoff2010 (reporter) - 2010-01-18 20:37
 https://issues.asterisk.org/view.php?id=16639#c116870 
---------------------------------------------------------------------- 
The following code is the source of the crash in chan_local.  It appears
that 'other' is most likely an invalid pointer at this point... but I am
not sure what else could be done to prevent this particular crash.  


        /* Recalculate outbound channel */
       	other = isoutbound ? p->owner : p->chan;

        if (!other) {
                return 0;
       	}

        /* do not queue frame if generator is on both local channels */
        if (us && us->generator && other->generator) {
                return 0;
        }

        /* Set glare detection */
        ast_set_flag(p, LOCAL_GLARE_DETECT);

        /* Ensure that we have both channels locked */
        while (other && ast_channel_trylock(other)) {
                ast_mutex_unlock(&p->lock);
                if (us && us_locked) {
                        do {
                                ast_channel_unlock(us);
                               	usleep(1);
                                ast_channel_lock(us);
                        } while (ast_mutex_trylock(&p->lock));
                } else {
                        usleep(1);
                        ast_mutex_lock(&p->lock);
                }
                other = isoutbound ? p->owner : p->chan;
        } 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-01-18 20:37 geoff2010      Note Added: 0116870                          
======================================================================




More information about the asterisk-bugs mailing list