[Home]

Summary:ASTERISK-04932: Crash on GROUP_COUNT function error
Reporter:John Todd (jtodd)Labels:
Date Opened:2005-08-29 23:58:26Date Closed:2011-06-07 14:10:17
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:This error seems to be caused by my (mis)use of the GROUP_COUNT function.  I'm not 100% certain of how GROUP_COUNT is called, so this could be my mistake.  However, regardless of the error, my dialplan foolishness should not cause a core dump.  This might not even be a problem with the function; it may be with my syntax on the n(existscallers) line, but it seems OK to my eyes.  As soon as the line n(existscallers) is called... kaboom.  This has never worked to my knowledge; I've tried against three week's worth of CVS-HEAD images with no luck, so this may be a long-lurking bug.



****** ADDITIONAL INFORMATION ******

This is a snippet of config from a larger conference calling recording application.  I have "dumbed" this down to eliminate external references, but the general idea remains consistent.  
[conference-noauth2]
exten => 2626,1,Answer                                                
exten => 2626,n,Set(ORIG=${EXTEN})                                    
exten => 2626,n,Wait(1)                                                
                                                                     
exten => 2626,n,MeetMeCount(2626,callers-inside)
exten => 2626,n,GotoIf($[${callers-inside} > 0]?existscallers:nocallers)
                                                                     
exten => 2626,n(nocallers),Background(to-record-call)                  
exten => 2626,n,Background(press)                                      
exten => 2626,n,Background(digits/1)
exten => 2626,n,Background(silence/3)                                  
exten => 2626,n,Goto(no-recording)                                    
                                                                     
exten => 2626,n(start-w-recording),Playback(call)
exten => 2626,n,Playback(is-now-being-recorded)                        
exten => 2626,n,Set(GROUP()=1)                                        
exten => 2626,n,Goto(startcall)                                        
                                                                     
exten => 2626,n(no-recording),Playback(nothing-recorded)              
exten => 2626,n,Goto(startcall)                                        
                                                                     
exten => 2626,n(existscallers),GotoIf($[${GROUP_COUNT()} > 0]?monitored:startcall)
exten => 2626,n(startcall),NoOp                                        
exten => 2626,n(monitored),Playback(this-call-may-be-monitored-or-recorded)
exten => 2626,n(startcall),MeetMe(2626,dc)

exten => 1,1,Monitor(gsm|/var/spool/asterisk/recording/${TIMESTAMP}-2626-cc.gsm|m)
exten => 1,n,Goto(2626,start-w-recording)
exten => i,1,Goto(${ORIG},1)




*CLI> show dialplan conference-noauth2
[ Context 'conference-noauth2' created by 'pbx_config' ]
 '1' =>            1. Monitor(gsm|/var/spool/asterisk/recording/${TIMESTAMP}-2626-cc.gsm|m) [pbx_config]
                   2. Goto(2626|start-w-recording)               [pbx_config]
 '2626' =>         1. Answer()                                   [pbx_config]
                   2. Set(ORIG=${EXTEN})                         [pbx_config]
                   3. Wait(1)                                    [pbx_config]
                   4. MeetMeCount(2626|callers-inside)           [pbx_config]
                   5. GotoIf($[${callers-inside} > 0]?existscallers:nocallers) [pbx_config]
    [nocallers]    6. Background(to-record-call)                 [pbx_config]
                   7. Background(press)                          [pbx_config]
                   8. Background(digits/1)                       [pbx_config]
                   9. Background(silence/3)                      [pbx_config]
                   10. Goto(no-recording)                        [pbx_config]
    [start-w-recording] 11. Playback(call)                            [pbx_config]
                   12. Playback(is-now-being-recorded)           [pbx_config]
                   13. Set(GROUP()=1)                            [pbx_config]
                   14. Goto(startcall)                           [pbx_config]
    [no-recording] 15. Playback(nothing-recorded)                [pbx_config]
                   16. Goto(startcall)                           [pbx_config]
    [existscallers] 17. GotoIf($[${GROUP_COUNT()} > 0]?monitored:startcall) [pbx_config]
    [startcall]    18. NoOp()                                    [pbx_config]
    [monitored]    19. Playback(this-call-may-be-monitored-or-recorded) [pbx_config]
    [startcall]    20. MeetMe(2626|dc)                           [pbx_config]
 'i' =>            1. Goto(${ORIG}|1)                            [pbx_config]

-= 3 extensions (23 priorities) in 1 contexts. =-
*CLI>
   -- Executing AbsoluteTimeout("SIP/2598-8ec6", "21000") in new stack
2005-08-29 21:41:34 WARNING[8175]: pbx.c:5606 pbx_builtin_atimeout: AbsoluteTimeout is deprecated, please use Set(TIMEOUT(absolute)=timeout) instead.
   -- Set Absolute Timeout to 21000
   -- Executing Goto("SIP/2598-8ec6", "from-desks2|2626|1") in new stack
   -- Goto (from-desks2,2626,1)
   -- Executing Goto("SIP/2598-8ec6", "conference-noauth1|2626|1") in new stack
   -- Goto (conference-noauth1,2626,1)
   -- Executing Answer("SIP/2598-8ec6", "") in new stack
   -- Executing Set("SIP/2598-8ec6", "ORIG=2626") in new stack
   -- Executing Wait("SIP/2598-8ec6", "1") in new stack
   -- Executing MeetMeCount("SIP/2598-8ec6", "2626|callers-inside") in new stack
   -- Executing GotoIf("SIP/2598-8ec6", "0?existscallers:nocallers") in new stack
   -- Goto (conference-noauth1,2626,6)
   -- Executing BackGround("SIP/2598-8ec6", "to-record-call") in new stack
   -- Playing 'to-record-call' (language 'en')
   -- Executing BackGround("SIP/2598-8ec6", "press") in new stack
   -- Playing 'press' (language 'en')
   -- Executing BackGround("SIP/2598-8ec6", "digits/1") in new stack
   -- Playing 'digits/1' (language 'en')
   -- Executing BackGround("SIP/2598-8ec6", "silence/3") in new stack
   -- Playing 'silence/3' (language 'en')
 == CDR updated on SIP/2598-8ec6
   -- Executing Monitor("SIP/2598-8ec6", "gsm|/var/spool/asterisk/recording/20050829-214138-2626-cc.gsm|m") in new stack
   -- Executing Goto("SIP/2598-8ec6", "2626|start-w-recording") in new stack
   -- Goto (conference-noauth1,2626,11)
   -- Executing Playback("SIP/2598-8ec6", "call") in new stack
   -- Playing 'call' (language 'en')
   -- Executing Playback("SIP/2598-8ec6", "is-now-being-recorded") in new stack
   -- Playing 'is-now-being-recorded' (language 'en')
   -- Executing Set("SIP/2598-8ec6", "GROUP()=1") in new stack
   -- Executing Goto("SIP/2598-8ec6", "startcall") in new stack
   -- Goto (conference-noauth1,2626,18)
   -- Executing NoOp("SIP/2598-8ec6", "") in new stack
   -- Executing Playback("SIP/2598-8ec6", "this-call-may-be-monitored-or-recorded") in new stack
   -- Playing 'this-call-may-be-monitored-or-recorded' (language 'en')
   -- Executing MeetMe("SIP/2598-8ec6", "2626|dc") in new stack
   -- Created MeetMe conference 1023 for conference '2626'
   -- Playing 'conf-onlyperson' (language 'en')

*CLI>
*CLI>
*CLI>
*CLI>  [so, the first call works OK, and is recorded and goes into the MeetMe]
*CLI>  [and here I dial 2626 from another extension...]
*CLI>
*CLI>
   -- Saved useragent "CSCO/7" for peer 2598
   -- Executing AbsoluteTimeout("SIP/2505-6f3a", "21000") in new stack
   -- Set Absolute Timeout to 21000
   -- Executing Goto("SIP/2505-6f3a", "from-desks2|2626|1") in new stack
   -- Goto (from-desks2,2626,1)
   -- Executing Goto("SIP/2505-6f3a", "conference-noauth1|2626|1") in new stack
   -- Goto (conference-noauth1,2626,1)
   -- Executing Answer("SIP/2505-6f3a", "") in new stack
   -- Executing Set("SIP/2505-6f3a", "ORIG=2626") in new stack
   -- Executing Wait("SIP/2505-6f3a", "1") in new stack
   -- Executing MeetMeCount("SIP/2505-6f3a", "2626|callers-inside") in new stack
   -- Executing GotoIf("SIP/2505-6f3a", "1?existscallers:nocallers") in new stack
   -- Goto (conference-noauth1,2626,17)
Segmentation fault (core dumped)
[root@cookies asterisk]#
[root@cookies asterisk]# uname -a
Linux cookies 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux
[root@cookies asterisk]#


[here's the output from a "gdb" backtrace.  Asterisk was compiled with no flags or options.]

...blah blah blah...
Reading symbols from /usr/lib/asterisk/modules/func_callerid.so...done.
Loaded symbols for /usr/lib/asterisk/modules/func_callerid.so
#0  ast_copy_string (dst=0x40a8a358 "", src=0x0, size=80) at utils.c:478
478             while (*src && size) {
(gdb) bt full
#0  ast_copy_string (dst=0x40a8a358 "", src=0x0, size=80) at utils.c:478
No locals.
#1  0x40815c7c in __dso_handle () from /usr/lib/asterisk/modules/pbx_functions.so
No symbol table info available.
(gdb) bt
#0  ast_copy_string (dst=0x40a8a358 "", src=0x0, size=80) at utils.c:478
#1  0x40815c7c in __dso_handle () from /usr/lib/asterisk/modules/pbx_functions.so
(gdb)


Comments:By: Kevin P. Fleming (kpfleming) 2005-08-30 18:04:03

Unfortunately that backtrace is not useful, since Asterisk was not built with optimization disabled.

Please redo the build using 'make dont-optimize', then run the scenario and get a backtrace and upload it as an attachment (not in the bugnote itself).

By: John Todd (jtodd) 2005-09-02 16:18:01

OK, working on it -day job keeps interfering.

By: Michael Jerris (mikej) 2005-09-09 20:18:40

Suspending bug pending a non-optimized backtrace.  Please reopen when you have it ready.  Thanks.