[Home]

Summary:ASTERISK-24516: [patch]Asterisk segfaults when playing back voicemail under high concurrency with an IMAP backend
Reporter:David Duncan Ross Palmer (m6kvm)Labels:
Date Opened:2014-11-11 06:03:02.000-0600Date Closed:2014-12-03 10:47:00.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail/IMAP
Versions:11.8.1 Frequency of
Occurrence
One Time
Related
Issues:
Environment:Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux Debian version 7.6Attachments:( 0) ASTERISK-24516.diff
( 1) backtrace.txt
Description:We have managed to reliably reproduce a crash when playing back voicemail from a specific mailbox, when using the IMAP_STORAGE backend, via libc-client2007e.
The actual IMAP implementation is an in house product, and likely beyond the scope of the problem

▪ STEPS TO REPRODUCE ******
1. Build Asterisk to use IMAP_STORAGE
2. Create a voicemailbox in voicemail.conf.
3. Create a peer within sip.conf to allow sipp to have unauthenticated access to dial the mailbox
4. Set up a dialplan so that you can call “VoicemailMain <extension>,sa(1)” that is, to play an old message automagically.
5. Run the following SIPp command:

{code}
sipp -sn uac -d 7000 -s ‘*1’ 127.0.0.1 -l 400 -mp 5606
{code}

ie. dial to listen to your voicemail, using the aforementioned dialplan with 400 concurrent calls, each 7 secs max duration.  It will be a mere matter of a minute or so until the condition is triggered, in our experience.
▪ ADDITIONAL INFORMATION ******
The following files are attached:
# 
ASTERISK-24516.dff

The idea of ASTERISK-24516.diff being that some operations that mail_open does may not be thread safe, so just implement a global mutex around it in Asterisk.
Comments:By: David Duncan Ross Palmer (m6kvm) 2014-11-11 06:05:15.996-0600

ASTERISK-24516.diff pending (due to code signing paperwork)

By: Matt Jordan (mjordan) 2014-11-11 07:20:58.470-0600

Thank you for your bug report. In order to move your issue forward, we require a backtrace[1] from the core file produced after the crash. Also, be sure you have DONT_OPTIMIZE enabled in menuselect within the Compiler Flags section, then:

make install

After enabling, reproduce the crash, and then execute the backtrace[1] instructions. When complete, attach that file to this issue report.

[1] https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace

It will be helpful to have a backtrace in order to evaluate the proposed solution.

By: David Duncan Ross Palmer (m6kvm) 2014-11-11 08:17:49.111-0600

Backtrace uploaded, some values redacted, but no offsets changed.  Strings have same length etc.

By: David Duncan Ross Palmer (m6kvm) 2014-11-13 09:02:12.052-0600

Added suggested patch which worked in our environment.

By: Rusty Newton (rnewton) 2014-11-13 16:22:02.542-0600

[~m6kvm] thanks for the patch - glad to hear it is working for you. The next step in the [Code Review process|https://wiki.asterisk.org/wiki/display/AST/Code+Review] is likely to get your patch up on Reviewboard so that others can review and test. Please check out the [Code Review steps|https://wiki.asterisk.org/wiki/display/AST/Code+Review].

Thanks!

By: David Duncan Ross Palmer (m6kvm) 2014-11-17 09:03:40.485-0600

I have raised the review https://reviewboard.asterisk.org/r/4188/