Summary:ASTERISK-09450: Asterisk segfaults if a message/name is recorded on voicemail with imap storage enabled.
Reporter:xmarksthespot (xmarksthespot)Labels:
Date Opened:2007-05-15 16:53:24Date Closed:2007-05-31 12:55:14
Versions:Frequency of
Environment:Attachments:( 0) 2.patch
( 1) bt.txt
( 2) bt_full.txt
( 3) output.txt
( 4) thread_apply_all_bt.txt
( 5) verbosedebug.txt
( 6) verbosedebug-cleanedstartup.txt
( 7) verbosedebugoption4.txt
( 8) verbosedebugoption4-cleanedstartup.txt
Description:On Asterisk 1.4.4, recording a message such as "unavailable", "busy" or the "name" for the directory service segfaults asterisk.

In this test, I dial 7777 to get to VoiceMailMain(2500@default).
I then enter the password for the voicemail.
Press on 0 to get to "Advanced options"
Press on 1 to get to "Record an unavailable message".
I record the message, it seems to work properly, except it DOES NOT PLAYBACK
Pressing on pound (#) to end the recording then segfaults the machine.

This is somewhat major. I can imagine it could be a problem if anyone recording a greeting can crash the machine.

I have encountered at least two other bugs that I will report soon, both probably easily fixable by experts.

****** STEPS TO REPRODUCE ******

1. Get a working IMAP storage setup (no small feat.)
2. Create a voicemailbox in voicemail.conf.
3. Create a user account in your MUA.
4. Create an extension that allows you to get to
5. Enter your password.
6. Press 0 to get to advanced options.
7. Press 1 to record an unavailable message.
8. Record the message at the tone.
9. Press # to end the recording.
(another bug I have not reported, feel free to fix)
11. Accept the message.
12. Asterisk will segfault upon accepting the message.

Happens 100% of the time, reproducibility = always.


I am hereby submitting the requested files, namely:
bt.txt - backtrace
bt full.txt - backtrace full
thread apply all bt.txt - thread apply all output
output.txt - all the previous files pasted in one
verbosedebug.txt - verbose debug, debug 5, verbose 5.

I have found a number of bugs in IMAP storage that I have not reported yet.

Thank you for helping.
Comments:By: Mark Michelson (mmichelson) 2007-05-22 20:37:47

Try using 0009735.patch and re-test.

By: xmarksthespot (xmarksthespot) 2007-05-23 10:45:13

You're a genius! Does not segfault anymore! (Look at the next message, it still crashes for temporary message).

HOWEVER I still get an error message (2500 is the extension I'm calling):

[May 23 11:43:38] WARNING[2683]: app_voicemail.c:1701 base_encode: Failed to open log file: /var/spool/asterisk/voicemail/default/2500/unavail/msg-001.wav: No such file or directory

I checked that directory while I was recording a new message, no file ever gets created there.

Maybe we can get rid of that part of code about the log file entirely? Seems pointless.

By: xmarksthespot (xmarksthespot) 2007-05-23 10:58:10

All right, after further testing, choice number 4, the temporary greeting still crashes asterisk. It's the only one that still causes problems. Do you need me to submit another bt, bt full, thread apply all bt and verbose debug?

If you need them tell me I'll submit them asap.

By: Mark Michelson (mmichelson) 2007-05-24 11:03:53

I've got a good handle on the crash cause so I won't need any info from that. I appreciate your offering though.

Regarding your new problem, it would be helpful to hear the context behind what caused it (i.e. what were you trying to do and at what point did you get the message) along with verbose debug output.

I'll continue to investigate without those files, but their inclusion would help.

By: xmarksthespot (xmarksthespot) 2007-05-24 14:03:48

Sure thing buddy, I'll do it and attach a verbose debug thingamajig ASAP.

By: xmarksthespot (xmarksthespot) 2007-05-24 14:29:31

Here we go!

Done, added two verbose debug things as usual, one with a cleaned startup, one in its entirety.

Extension 2400 calls 7777 to access voicemailmain.
In voicemailmain I go into advanced options by pressing on 0.
In advanced options I press on 4 for temporary message.
I record the message then press on pound (#) to end the recording.
I then press 1 to save and it hits the fan right there.

Thanks a lot!

By: Mark Michelson (mmichelson) 2007-05-25 08:53:30

I've been advised to only address the crashes initially reported in this patch. Once those are all resolved, this bug will be closed. As far as the other problem goes (regarding the inability to open the message file), please open this as a separate issue.

I've uploaded a second patch, 0009735-2.patch, which should fix all the crashes you've experienced. Please re-test and let me know if you have any problems.


Edit: Apparently Mantis handles '-' a bit funny in file names, so the new patch I uploaded is just called 2.patch

By: xmarksthespot (xmarksthespot) 2007-05-25 11:03:15

I'm testing it right now.

However is it supposed to play the just recorded file? Because if I record it and press for review (to replay the file) it does work (at least it did with the first patch).

By: xmarksthespot (xmarksthespot) 2007-05-25 11:13:25

All right, it no longer segfaults, however there is an avalanche of odd behavior here.

I guess your work here is done concerning the segfaults and for that I thank you.

For the sake of just being aware:

If you record the message and there was already a message recorded before, you can't change it. It always remains at the first version of the message.

There's still the weird "No such file or directory" messages.

The message cannot be reviewed, as it always reviews the old version of the message, not the just recorded one.

Thank you for all this though. I myself don't know backtraces or anything so the segfault and crash bugs I can't help at all.

I'll try to get fixing those three bugs.

Unfortunately there is still one other nasty segfault in app_voicemail that I will report on soon. You'll know what to do with it I guess!

By: Mark Michelson (mmichelson) 2007-05-31 12:55:13

Fixed in 1.4 in SVN revision 66671.
Fixed in trunk in SVN revision 66672.