[Home]

Summary:ASTERISK-13726: Segfaults if queue name is wrong
Reporter:Alec Davis (alecdavis)Labels:
Date Opened:2009-03-11 04:59:35Date Closed:2009-03-11 09:30:11
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Applications/app_queue
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Dialplan typo can crash asterisk if queue names don't exist, due to a typo or a missed change.

queues are really 'itg_queue' and 'itg_queue2'
type is in priority 3.

;Incoming calls to queue 1
exten => 8301,1,Answer()
exten => 8301,2,Queue(itgqueue,hH,,,60)
exten => 8301,3,NoOp(QUEUE1STATUS=${QUEUESTATUS})
exten => 8301,4,Queue(itg_queue2,hH,,,60)
exten => 8301,5,NoOp(QUEUE2STATUS=${QUEUESTATUS})
exten => 8301,6,Voicemail(${EXTEN},u)


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

Even though I'm using the console as example here, to report problem, the Box is now at the other end of country.

segfaulting console output using console to dial:

chch1*CLI> console dial 8301
[Mar 11 22:51:28] WARNING[7033]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 11 22:51:28] NOTICE[7033]: console_video.c:133 console_video_start: voice only, console video support not present
   -- Executing [8301@default:1] Answer("Console/dsp", "") in new stack
<< Console call has been answered >>
chch1*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
Asterisk cleanly ending (0).


***********************
Good console output using console to dial:

chch1*CLI> console dial 8301
[Mar 11 22:57:13] WARNING[7088]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 11 22:57:13] NOTICE[7088]: console_video.c:133 console_video_start: voice only, console video support not present
   -- Executing [8301@default:1] Answer("Console/dsp", "") in new stack
<< Console call has been answered >>
   -- Executing [8301@default:2] Queue("Console/dsp", "itg_queue,hH,,,60") in new stack
   -- Started music on hold, class 'default', on Console/dsp
[Mar 11 22:57:14] WARNING[7089]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 11 22:57:15] WARNING[7089]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 11 22:57:16] WARNING[7089]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 11 22:57:17] WARNING[7089]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 11 22:57:18] WARNING[7089]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 11 22:57:19] WARNING[7089]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
chch1*CLI> console hangup
   -- Stopped music on hold on Console/dsp
 == Spawn extension (default, 8301, 2) exited non-zero on 'Console/dsp'
<< Hangup on console >>

Comments:By: Alec Davis (alecdavis) 2009-03-11 05:07:59

oops, 2 typos in the description.
'type is in priority 3.'

should read.
'typo is in priority 2.'

You get that, 5am start, fly down country, have problems, return, then type up report at 11pm. No excuse really.

By: Mark Michelson (mmichelson) 2009-03-11 09:27:06

Good catch. Luckily this only affects trunk due to a recent check-in of some queue fixes. Looks like this didn't pass the scrutiny of the reviewers or the tests I ran.

The fix for this is trivial enough that I'm not going to bother uploading patches or anything like that. I'll just commit the necessary (and tested) change.

By: Digium Subversion (svnbot) 2009-03-11 09:28:41

Repository: asterisk
Revision: 181244

U   trunk/apps/app_queue.c

------------------------------------------------------------------------
r181244 | mmichelson | 2009-03-11 09:28:41 -0500 (Wed, 11 Mar 2009) | 11 lines

Fix segfault when dialing a typo'd queue

If trying to dial a non-existent queue, there would
be a segfault when attempting to access q->weight, even
though q was NULL. This problem was introduced during
the queue-reset merge and thus only affects trunk.

(closes issue ASTERISK-13726)
Reported by: alecdavis


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

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

By: Digium Subversion (svnbot) 2009-03-11 09:29:43

Repository: asterisk
Revision: 181245

_U  branches/1.6.0/

------------------------------------------------------------------------
r181245 | mmichelson | 2009-03-11 09:29:43 -0500 (Wed, 11 Mar 2009) | 16 lines

Blocked revisions 181244 via svnmerge

........
 r181244 | mmichelson | 2009-03-11 09:28:40 -0500 (Wed, 11 Mar 2009) | 11 lines
 
 Fix segfault when dialing a typo'd queue
 
 If trying to dial a non-existent queue, there would
 be a segfault when attempting to access q->weight, even
 though q was NULL. This problem was introduced during
 the queue-reset merge and thus only affects trunk.
 
 (closes issue ASTERISK-13726)
 Reported by: alecdavis
........

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

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

By: Digium Subversion (svnbot) 2009-03-11 09:30:10

Repository: asterisk
Revision: 181246

_U  branches/1.6.1/

------------------------------------------------------------------------
r181246 | mmichelson | 2009-03-11 09:30:10 -0500 (Wed, 11 Mar 2009) | 16 lines

Blocked revisions 181244 via svnmerge

........
 r181244 | mmichelson | 2009-03-11 09:28:40 -0500 (Wed, 11 Mar 2009) | 11 lines
 
 Fix segfault when dialing a typo'd queue
 
 If trying to dial a non-existent queue, there would
 be a segfault when attempting to access q->weight, even
 though q was NULL. This problem was introduced during
 the queue-reset merge and thus only affects trunk.
 
 (closes issue ASTERISK-13726)
 Reported by: alecdavis
........

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

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