[asterisk-bugs] [Asterisk 0014496]: IMAP crash multiple callers / callers hangup at beep

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Feb 18 11:18:32 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14496 
====================================================================== 
Reported By:                vbcrlfuser
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   14496
Category:                   Applications/app_voicemail/IMAP
Reproducibility:            sometimes
Severity:                   crash
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.22 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-02-17 22:10 CST
Last Modified:              2009-02-18 11:18 CST
====================================================================== 
Summary:                    IMAP crash multiple callers / callers hangup at beep
Description: 
A multiple CPU machine + asterisk-1.4.22 + imap2004g, with more than one
user in voicemail (not the same mailbox) disconnecting right after or close
to beep + 3 seconds timeout for abandon causes, is a bad combination.  

In same cases IMAP warnings about parsing response and in most cases a
segfault. I'd like to know what the root cause is and what fixes it? I can
produce any backtraces / scenarios anyone needs to lend a hand here.


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

---------------------------------------------------------------------- 
 (0100315) vbcrlfuser (reporter) - 2009-02-18 11:18
 http://bugs.digium.com/view.php?id=14496#c100315 
---------------------------------------------------------------------- 
Ok more information. Each time there is a core dump the backtrace indicates
more than one thread in libc-client library. The segfaults happen on libc
calls like ucase or strtok. 

Theorized that libc-client is not thread safe like others may have. Say in
another bug report the suggestion to have ast_mutex_locks around
libc-client calls. But it looks like the locks are implemented the vms
structure.

Locks on the vms structure would be "perm mailbox" locks? Right? And these
locks would only prevent concurrent libc-client calls to the same mailbox,
not concurrent libc-client calls in general.

With that train of thought. Created a global
AST_MUTEX_DEFINE_STATIC(cclient-lock). Then replaced all existing vms->lock
locks around libc-client calls. Also added ones where none was not
present.

The concurrent access test does not fail when these new locks are in
place. Putting the non-locking version back in and segfaults come back.

Not sure what the impact of single thread access to libc-client will be.
The IMAP server is local to the box. Will test this evening and report.
Imagine concurrent users listening to voicemail having to fetch the body
might slow down the MWI checks and quota checks for users leaving
voicemail.

This heavy handed solution may be tolerable given the alternative is
segfaults, until a better solution, by someone far wiser than I, comes
along. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-02-18 11:18 vbcrlfuser     Note Added: 0100315                          
======================================================================




More information about the asterisk-bugs mailing list