[Home]

Summary:ASTERISK-15722: For loop never exists when calling an extension that exists with BUSY, failure to leave 'for' loop in 'scan_thread'
Reporter:Shane Spencer (whardier)Labels:
Date Opened:2010-03-01 14:46:04.000-0600Date Closed:2011-06-07 14:01:05
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:PBX/pbx_spool
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) gdb.txt
( 1) strace.txt.gz
Description:I have the following dialplan set up, calling 0012@phones-extensions while SIP/0012 is set to DND causes nanosleep({0,1000}) to be called forever according to strace.  I'll attach strace and gdb output.  I can reproduce this after several attempts, often I can reproduce this on the first call.


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


[dundi-priv-sipregistrations]
include => sipregistrations
exten => _00XX,2,Goto(sipdial,${EXTEN},1)
exten => _00XX-.,2,Goto(sipdial,${EXTEN},1)

[dundi-priv-iaxregistrations]
include => iaxregistrations
exten => _00XX,2,Goto(iaxdial,${EXTEN},1)

[dundi-priv-local]
include => dundi-priv-sipregistrations
include => dundi-priv-iaxregistrations
include => dundi-priv-applications
include => dundi-priv-via-pstn

[sipdial]
exten => _XXXX,1,Dial(SIP/${EXTEN},,R)

[iaxdial]
exten => _XXXX,1,Dial(IAX2/${EXTEN},,R)

[phones-extensions]
include => phones-stdexten

exten => 600,1,Goto(demo,600,1)
exten => 0012,1,Gosub(stdexten(${EXTEN},0012))
exten => _00XX,1,Gosub(stdexten(${EXTEN},0000))

exten => i,1,Answer
exten => i,2,Playback(pbx-invalid)
exten => i,3,Hangup

[phones-stdexten]
exten => _X.,50000(stdexten),NoOp(Start stdexten)
exten => _X.,n,Set(GROUP()=${EXTEN})
exten => _X.,n,Set(LOCAL(ext)=${EXTEN})
exten => _X.,n,Set(LOCAL(dev)=${ARG1})
exten => _X.,n,Set(LOCAL(mbx)=${ARG2})

exten => _X.,n,Set(DIALGROUP(${EXTEN})=Local/${dev}@dundi-priv-local)

exten => _X.,n,Set(LOCAL(query)=${DUNDIQUERY(${EXTEN},priv)})
exten => _X.,n,Set(LOCAL(num)=${DUNDIRESULT(${query},getnum)})
exten => _X.,n,Set(LOCAL(x)=1)
exten => _X.,n,While($[${x} <= ${num}])
exten => _X.,n,Set(DIALGROUP(${EXTEN},add)=${DUNDIRESULT(${query},${x})})
exten => _X.,n,Set(LOCAL(x)=$[${x} + 1])
exten => _X.,n,EndWhile

exten => _X.,n,Answer()
exten => _X.,n,Dial(${DIALGROUP(${EXTEN})},20)
exten => _X.,n,Goto(stdexten-${DIALSTATUS},1)

exten => stdexten-NOANSWER,1,NoOp(NOANSWER ${EXTEN})
exten => stdexten-NOANSWER,n,Goto(dundi-priv-lookup,u${mbx},1)

exten => stdexten-BUSY,1,NoOp(Busy ${EXTEN})
exten => stdexten-BUSY,n,Goto(dundi-priv-lookup,b${mbx},1)

exten => _stdexten-.,1,Goto(stdexten-NOANSWER,1)

exten => #,1,Goto(dundi-priv-lookup,v${mbx},1)

exten => i,1,Answer
exten => i,2,Playback(pbx-invalid)
exten => i,3,Hangup
Comments:By: Shane Spencer (whardier) 2010-03-01 14:59:31.000-0600

I'm not very familiar with threading and posix locks, etc.. apparently the for loop in inotify_daemon in localtime.c may be suspect as well?

By: Shane Spencer (whardier) 2010-03-01 18:25:19.000-0600

fixed in 1.6.2.5