[asterisk-bugs] [Asterisk 0013653]: [patch] Shared IMAP mailboxes can cause the server to crash

Asterisk Bug Tracker noreply at bugs.digium.com
Sat Oct 11 06:19:17 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13653 
====================================================================== 
Reported By:                howardwilkinson
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13653
Category:                   Applications/app_voicemail/IMAP
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     confirmed
Asterisk Version:           1.4.21.2 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-10-09 09:02 CDT
Last Modified:              2008-10-11 06:19 CDT
====================================================================== 
Summary:                    [patch] Shared IMAP mailboxes can cause the server
to crash
Description: 
If the IMAP mailbox used to hold the voice messages is shared amongst a
number of users then the server can crash with problems inside the UW-IMAP
C-Client code. This is caused by multiple threads trying to use the shared
structure that the c-client code produces for the mailbox stream.

The particular installation is using Cyrus Imap server, with
authuser/authpassword set and multiple users having the same imapuser
setting.
====================================================================== 

---------------------------------------------------------------------- 
 (0093515) howardwilkinson (reporter) - 2008-10-11 06:19
 http://bugs.digium.com/view.php?id=13653#c93515 
---------------------------------------------------------------------- 
I have uploaded a new patch which only contains the lock code and not my
extension which exaggerated the problem in the first place. I will update
the extension as a second patch with a feature request.

This patch does not fix the under lying issue it just stops * from
crashing when the code tries to enter the UW library twice.

The underlying problem is that independent threads of the * code can try
to update the same mailbox and trip over each other. This requires a larger
locking regime and some additional logic to overcome as a failure but
raises a problem with this approach which arises if 2 users try to access
the mailbox at the same time.

In the circumstance, they will get told that there are 'x' new messages
and may listen to the same one and both try to delete it. Or possibly one
deletes before the other can access. The code as it stands means that the
list of available messages is updated in 2 threads and less than
predictable results could occur.

With more intelligence in the call-backs from the UW library most of this
could be removed as an issue. Careful coding of the access to the data
retrieved from the IMAP server and a widening of the locks should remove
any other logical inconsistencies. This would just leave the transaction
issue where 2 users access at the same time but get told "exaggerated"
numbers for available messages. It might be worth looking at adding an
interface options that allows the system to issue a 'there are 1 or more
messages available' prompt followed by a 'last message deleted by another
user' if this circumstance arises.

I will look at fixing the logical issue today but may only provide a half
fix. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-11 06:19 howardwilkinsonNote Added: 0093515                          
======================================================================




More information about the asterisk-bugs mailing list