[Home]

Summary:ASTERISK-09005: [patch] Improper gain param syntax in app_voicemail causes segfault
Reporter:Mark Farver (mfarver)Labels:
Date Opened:2007-03-14 09:39:20Date Closed:2007-07-06 19:18:18
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/Configuration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) backtrace-vm.txt
( 1) backtrace-vm-full.txt
( 2) M9274.diff
Description:When experimenting with the gain settings on the voicemail app I accidentially left off the paratheses around the gain value in extensions.conf:

exten => 1,2,Voicemail(17,ug9 )

When Asterisk executes that line it will segfault and discontinue operation.  

(I believe the correct syntax is ug(9), which seems to work )

Tested on both 1.4.1 and svn trunk.
Comments:By: Serge Vecher (serge-v) 2007-03-14 10:26:06

1. Enable DONT_OPTIMIZE flag in menuselect under Compiler Options.
2. Rebuild Asterisk
3. Start Asterisk with '-g' option
4. When crash occurs, perform 'bt' on the core file. Then 'thread apply all bt full'

By: Mark Farver (mfarver) 2007-03-14 11:44:23

Backtrace attached, let me know if I screwed it up.

By: Clod Patry (junky) 2007-03-14 11:46:43

i will take a look at this in the near future.
add a bt full.

Also, ya can read the file doc/backtrace.txt


Thanks for this report.

By: Clod Patry (junky) 2007-03-20 23:25:45

try that patch and let me know how it goes for ya.

You should see something like:
  -- Executing [188@default:1] VoiceMail("SIP/20-006d6250", "10|ug9 ") in new stack
[Mar 21 00:24:11] WARNING[7397]: app_voicemail.c:6768 vm_exec: Invalid value '(null)' provided for record gain option

Thanks for this report.


(Build on 59070)



By: Mark Farver (mfarver) 2007-03-22 11:11:10

The patch prevents the crash,. but it appears to leave a dangling lock.  I don't know if that is necessarily an issue.  I do not get the lock warning messages when the syntax of the record option is correct.


---snip---
[Mar 22 11:02:13] NOTICE[19483]: chan_zap.c:6688 ss_thread: Got event 18 (Ring Begin)...
[Mar 22 11:02:20] WARNING[19483]: app_voicemail.c:6826 vm_exec: Invalid value '(null)' provided for record gain option
 == Spawn extension (macro-vm, s, 2) exited non-zero on 'Zap/14-1' in macro 'vm'
 == Spawn extension (macro-vm, s, 2) exited non-zero on 'Zap/14-1'
[Mar 22 11:02:20] ERROR[19483]: /usr/src/asterisk/include/asterisk/lock.h:310 __ast_pthread_mutex_trylock: channel.c line 1567 (ast_hangup): Warning: '&c->lock' was locked here.
[Mar 22 11:02:20] ERROR[19483]: /usr/src/asterisk/include/asterisk/lock.h:310 __ast_pthread_mutex_trylock: channel.c line 1567 (ast_hangup): Warning: '&c->lock' was locked here.
[Mar 22 11:02:20] ERROR[19483]: /usr/src/asterisk/include/asterisk/lock.h:310 __ast_pthread_mutex_trylock: channel.c line 1567 (ast_hangup): Warning: '&c->lock' was locked here.
[Mar 22 11:02:20] ERROR[19483]: /usr/src/asterisk/include/asterisk/lock.h:310 __ast_pthread_mutex_trylock: channel.c line 1567 (ast_hangup): Warning: '&c->lock' was locked here.
[Mar 22 11:02:20] ERROR[19483]: /usr/src/asterisk/include/asterisk/lock.h:310 __ast_pthread_mutex_trylock: channel.c line 1567 (ast_hangup): Warning: '&c->lock' was locked here.
[Mar 22 11:02:20] ERROR[19483]: /usr/src/asterisk/include/asterisk/lock.h:310 __ast_pthread_mutex_trylock: channel.c line 1567 (ast_hangup): Warning: '&c->lock' was locked here.
[Mar 22 11:02:20] ERROR[19483]: /usr/src/asterisk/include/asterisk/lock.h:310 __ast_pthread_mutex_trylock: channel.c line 1567 (ast_hangup): Warning: '&c->lock' was locked here.
[Mar 22 11:02:20] ERROR[19483]: /usr/src/asterisk/include/asterisk/lock.h:310 __ast_pthread_mutex_trylock: channel.c line 1567 (ast_hangup): Warning: '&c->lock' was locked here.
[Mar 22 11:02:20] ERROR[19483]: /usr/src/asterisk/include/asterisk/lock.h:310 __ast_pthread_mutex_trylock: channel.c line 1567 (ast_hangup): Warning: '&c->lock' was locked here.
[Mar 22 11:02:20] ERROR[19483]: /usr/src/asterisk/include/asterisk/lock.h:310 __ast_pthread_mutex_trylock: channel.c line 1567 (ast_hangup): Warning: '&c->lock' was locked here.

By: Clod Patry (junky) 2007-03-22 11:16:43

could you add a bit before it (i need to see ur snip.)

By: Clod Patry (junky) 2007-03-30 08:14:52

mfarver: could you add feedback here please?
Your problem is probably a lock related to macro or in chan_zap,
cause i dont see any lock for that part of voicemail.

By: Mark Farver (mfarver) 2007-03-30 08:52:15

It appears to be a spurious issue, I am unable to duplicate the lock messages today.

    -- Starting simple switch on 'Zap/14-1'
[Mar 30 08:50:51] NOTICE[14602]: chan_zap.c:6688 ss_thread: Got event 18 (Ring Begin)...
[Mar 30 08:50:56] NOTICE[14602]: chan_zap.c:6688 ss_thread: Got event 2 (Ring/Answered)...
   -- Executing [s@ext25:1] Macro("Zap/14-1", "vm|21") in new stack
   -- Executing [s@macro-vm:1] Answer("Zap/14-1", "") in new stack
   -- Executing [s@macro-vm:2] VoiceMail("Zap/14-1", "21|ug10 ") in new stack
[Mar 30 08:50:56] WARNING[14602]: app_voicemail.c:6826 vm_exec: Invalid value '(null)' provided for record gain option
 == Spawn extension (macro-vm, s, 2) exited non-zero on 'Zap/14-1' in macro 'vm'
 == Spawn extension (macro-vm, s, 2) exited non-zero on 'Zap/14-1'
   -- Hungup 'Zap/14-1'



By: Clod Patry (junky) 2007-03-30 08:54:25

these locks are provocated by something else then the voicemail.
So no more crash, so this patch works fine on ur side too?

By: Mark Farver (mfarver) 2007-03-30 08:56:19

The patch fixes the issue and prevents the segfault.  I think you can mark this one resolved.  Thanks.

By: Clod Patry (junky) 2007-03-30 08:58:39

since this patch prevent the segfault when an invalid syntax is entered for voicemail.


By: Joshua C. Colp (jcolp) 2007-06-21 16:41:31

Fixed in 1.2 as of revision 70898, 1.4 as of revision 70899, and trunk as of revision 70900.