[Home]

Summary:ASTERISK-16504: [patch] segfault on dialplan reload
Reporter:Pavel Litvinenko (pavell)Labels:
Date Opened:2010-08-04 09:53:10Date Closed:2010-09-07 15:56:54
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Core/Configuration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20100820__issue17794__1.4.diff.txt
( 1) 20100820__issue17794__1.6.2.diff.txt
( 2) backtrace.txt
Description:if context has syntax error like
exten =>;
exten => 111;
asterisk always crashed on dialplan reload command
here my extension.conf
[general]

static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no

;[default]
;include => office-people

[macro-startrecord]
exten => s,1,Monitor(gsm,${UNIQUEID},b)

[office-people]

exten => _1[0123]XX,1,GotoIf(${DB_EXISTS(CHANPORT/${EXTEN})}?chpy:chpno)
exten => _1[0123]XX,n(chpy),Set(chanport=${DB(CHANPORT/${EXTEN})})
exten => _1[0123]XX,n,Goto(chpcont)
exten => _1[0123]XX,n(chpno),Set(chanport=SIP/${EXTEN})
exten =>; _1[0123]XX,n(chpcont),Noop
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ here error - but it does not matter the position on wrong string  

exten => _1[0123]XX,n(main),Macro(startrecord)
exten => _1[0123]XX,n,GotoIf(${DB_EXISTS(VMREDIR/${EXTEN})}?vmredir:vmnoredir)
exten => _1[0123]XX,n(vmredir),Dial(SIP/${EXTEN},20,tTWw)
exten => _1[0123]XX,n,VoiceMail(${EXTEN},u)
exten => _1[0123]XX,n,Hangup
exten => _1[0123]XX,n(vmnoredir),GotoIf(${DB_EXISTS(REDIR/${EXTEN})}?redir:noredir)
exten => _1[0123]XX,n(redir),Dial(Local/${DB(REDIR/${EXTEN})}@office)
exten => _1[0123]XX,n(noredir),Dial(${chanport},20,tTWw)
exten => _1[0123]XX,n,GotoIf($[${DIALSTATUS} = BUSY]?hung:cont)
exten => _1[0123]XX,n(cont),GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?hung:cont2)
exten => _1[0123]XX,n(cont2),GotoIf(${DB_EXISTS(MOBY/${EXTEN})}?doit:wait)
exten => _1[0123]XX,n(doit),Playback(mob_go)
exten => _1[0123]XX,n,Set(number=${DB(MOB/${EXTEN})})
exten => _1[0123]XX,n,Set(CALLERID(num)=${EXTEN})
exten => _1[0123]XX,n,Goto(pstn-out,98${number},1)
exten => _1[1023]XX,n(wait),Wait(1)
exten => _1[0123]XX,n,Goto(main)
exten => _1[0123]XX,n(hung),Hangup

1.6.2.10 has this error too

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

on loading asterisk:
== Parsing '/etc/asterisk/extensions.conf':   == Found
   -- Registered extension context 'macro-startrecord' (0x8455a90) in local table 0x8454d60; registrar: pbx_config
   -- Added extension 's' priority 1 to macro-startrecord (0x8455a90)
   -- Registered extension context 'office-people' (0x8456808) in local table 0x8454d60; registrar: pbx_config
   -- Added extension '_1[0123]XX' priority 1 to office-people (0x8456808)
   -- Added extension '_1[0123]XX' priority 2 to office-people (0x8456808)
   -- Added extension '_1[0123]XX' priority 3 to office-people (0x8456808)
   -- Added extension '_1[0123]XX' priority 4 to office-people (0x8456808)
[Aug  4 18:28:43] NOTICE[30338]: pbx.c:3736 pbx_extension_helper: Cannot find extension '' in context ''
[Aug  4 18:28:43] WARNING[30338]: pbx_config.c:1491 pbx_load_config: Invalid priority/label '' at line 21
   -- Added extension '_1[0123]XX' priority 5 to office-people (0x8456808)
-------------------------------------------------------------------------------


*CLI> dialplan reload
 == Parsing '/etc/asterisk/extensions.conf':   == Found
   -- Registered extension context 'macro-startrecord' (0xb5803680) in local table 0xb58033e8; registrar: pbx_config
   -- Added extension 's' priority 1 to macro-startrecord (0xb5803680)
   -- Registered extension context 'office-people' (0xb5804580) in local table 0xb58033e8; registrar: pbx_config
   -- Added extension '_1[0123]XX' priority 1 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 2 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 3 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 4 to office-people (0xb5804580)
[Aug  4 18:30:41] NOTICE[30338]: pbx.c:3736 pbx_extension_helper: Cannot find extension '' in context ''
[Aug  4 18:30:41] WARNING[30338]: pbx_config.c:1491 pbx_load_config: Invalid priority/label '' at line 21
   -- Added extension '_1[0123]XX' priority 5 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 6 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 7 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 8 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 9 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 10 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 11 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 12 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 13 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 14 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 15 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 16 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 17 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 18 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 19 to office-people (0xb5804580)
   -- Added extension '_1[1023]XX' priority 20 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 21 to office-people (0xb5804580)
   -- Added extension '_1[0123]XX' priority 22 to office-people (0xb5804580)
 == Parsing '/etc/asterisk/users.conf':   == Found
   -- Registered extension context 'app_queue_gosub_virtual_context' (0x81f2130) in local table 0xb58033e8; registrar: app_queue
   -- merging incls/swits/igpats from old(app_queue_gosub_virtual_context) to new(app_queue_gosub_virtual_context) context, registrar = pbx_config
   -- Added extension 's' priority 1 to app_queue_gosub_virtual_context (0x81f2130)
   -- Registered extension context 'app_dial_gosub_virtual_context' (0x81f1f88) in local table 0xb58033e8; registrar: app_dial
   -- merging incls/swits/igpats from old(app_dial_gosub_virtual_context) to new(app_dial_gosub_virtual_context) context, registrar = pbx_config
   -- Added extension 's' priority 1 to app_dial_gosub_virtual_context (0x81f1f88)
   -- Registered extension context 'parkedcalls' (0x8471d80) in local table 0xb58033e8; registrar: features
   -- merging incls/swits/igpats from old(parkedcalls) to new(parkedcalls) context, registrar = pbx_config
   -- Added extension '700' priority 1 to parkedcalls (0x8471d80)
Segmentation fault (core dumped)

trace removed - pabelanger
Comments:By: Paul Belanger (pabelanger) 2010-08-04 10:39:46

Please don't paste your backtrace within the notes, upload them.  Also, we need an unoptimized (see below) trace.
---
Thank you for your bug report. In order to move your issue forward, we require a backtrace from the core file produced after the crash. Please see the doc/backtrace.txt file in your Asterisk source directory.

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 instructions in doc/backtrace.txt.

When complete, attach that file to this issue report. Thanks!

By: Pavel Litvinenko (pavell) 2010-08-04 13:04:25

I have attached backtrace reproduced on 1.6.2.10

By: Paul Belanger (pabelanger) 2010-08-04 14:52:38

Hmm, I believe I experienced this issue last weekend working with the testsuite.  Never opened an issue about it.  Will see if I can reproduce.

By: Tilghman Lesher (tilghman) 2010-08-20 14:00:57

This patch should fix this crash by catching the error earlier in the load process and logging a warning.

By: Tilghman Lesher (tilghman) 2010-08-26 18:54:11

Would anybody like to test these patches and verify whether they fix the issue?

By: Pavel Litvinenko (pavell) 2010-08-27 02:27:10

I'm sorry for long delay - I'll do it today...

By: Tilghman Lesher (tilghman) 2010-09-03 13:05:01

PavelL:  has your test succeeded?

By: Pavel Litvinenko (pavell) 2010-09-04 07:16:52

Thanks a lot - my problem is fixed. 1 week without segfaults ...

By: Digium Subversion (svnbot) 2010-09-07 15:30:22

Repository: asterisk
Revision: 285365

U   branches/1.4/pbx/pbx_config.c

------------------------------------------------------------------------
r285365 | tilghman | 2010-09-07 15:30:22 -0500 (Tue, 07 Sep 2010) | 9 lines

Catch invalid extensions at the parser, instead of making the core deal with them.

(closes issue ASTERISK-16504)
Reported by: PavelL
Patches:
      20100820__issue17794__1.6.2.diff.txt uploaded by tilghman (license 14)
      20100820__issue17794__1.4.diff.txt uploaded by tilghman (license 14)
Tested by: PavelL

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=285365

By: Digium Subversion (svnbot) 2010-09-07 15:31:42

Repository: asterisk
Revision: 285366

_U  branches/1.6.2/
U   branches/1.6.2/pbx/pbx_config.c

------------------------------------------------------------------------
r285366 | tilghman | 2010-09-07 15:31:42 -0500 (Tue, 07 Sep 2010) | 16 lines

Merged revisions 285365 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r285365 | tilghman | 2010-09-07 15:30:22 -0500 (Tue, 07 Sep 2010) | 9 lines
 
 Catch invalid extensions at the parser, instead of making the core deal with them.
 
 (closes issue ASTERISK-16504)
  Reported by: PavelL
  Patches:
        20100820__issue17794__1.6.2.diff.txt uploaded by tilghman (license 14)
        20100820__issue17794__1.4.diff.txt uploaded by tilghman (license 14)
  Tested by: PavelL
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=285366

By: Digium Subversion (svnbot) 2010-09-07 15:56:08

Repository: asterisk
Revision: 285367

_U  branches/1.8/
U   branches/1.8/pbx/pbx_config.c

------------------------------------------------------------------------
r285367 | tilghman | 2010-09-07 15:56:08 -0500 (Tue, 07 Sep 2010) | 23 lines

Merged revisions 285366 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
 r285366 | tilghman | 2010-09-07 15:31:41 -0500 (Tue, 07 Sep 2010) | 16 lines
 
 Merged revisions 285365 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r285365 | tilghman | 2010-09-07 15:30:22 -0500 (Tue, 07 Sep 2010) | 9 lines
   
   Catch invalid extensions at the parser, instead of making the core deal with them.
   
   (closes issue ASTERISK-16504)
    Reported by: PavelL
    Patches:
          20100820__issue17794__1.6.2.diff.txt uploaded by tilghman (license 14)
          20100820__issue17794__1.4.diff.txt uploaded by tilghman (license 14)
    Tested by: PavelL
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=285367

By: Digium Subversion (svnbot) 2010-09-07 15:56:53

Repository: asterisk
Revision: 285368

_U  trunk/
U   trunk/pbx/pbx_config.c

------------------------------------------------------------------------
r285368 | tilghman | 2010-09-07 15:56:53 -0500 (Tue, 07 Sep 2010) | 30 lines

Merged revisions 285367 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
 r285367 | tilghman | 2010-09-07 15:56:07 -0500 (Tue, 07 Sep 2010) | 23 lines
 
 Merged revisions 285366 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.6.2
 
 ................
   r285366 | tilghman | 2010-09-07 15:31:41 -0500 (Tue, 07 Sep 2010) | 16 lines
   
   Merged revisions 285365 via svnmerge from
   https://origsvn.digium.com/svn/asterisk/branches/1.4
   
   ........
     r285365 | tilghman | 2010-09-07 15:30:22 -0500 (Tue, 07 Sep 2010) | 9 lines
     
     Catch invalid extensions at the parser, instead of making the core deal with them.
     
     (closes issue ASTERISK-16504)
      Reported by: PavelL
      Patches:
            20100820__issue17794__1.6.2.diff.txt uploaded by tilghman (license 14)
            20100820__issue17794__1.4.diff.txt uploaded by tilghman (license 14)
      Tested by: PavelL
   ........
 ................
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=285368