[Home]

Summary:ASTERISK-05556: [patch] AddQueueMember segfaults Asterisk
Reporter:BJ Weschke (bweschke)Labels:
Date Opened:2005-11-10 11:28:35.000-0600Date Closed:2005-11-10 18:33:06.000-0600
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Applications/app_queue
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) app_queue_segfault.patch
Description:Anton Krall reports from -dev:

Guys.
I just discovered a bug in rc1, whenever We try to do an addqueuemember,
asterisk core dumps.

Here is the dialplan:

exten => 766,1,AddQueueMember(Ventas)
exten => 766,2,AddQueueMember(Soporte-Tecnico)
exten => 766,3,AddQueueMember(Soporte-Contrato)
exten => 766,4,UserEvent(Agentlogin|Agent: ${CALLERIDNUM})
exten => 766,5,Playback(agent-loginok)
exten => 766,6,Playback(vm-goodbye)

[Nov 10 11:15:41]     -- Executing AddQueueMember("SIP/201-5a35", "Ventas")
in new stack
voip*CLI>
Disconnected from Asterisk server
[Nov 10 11:15:41] Executing last minute cleanups
[Nov 10 11:15:41] Asterisk cleanly ending (0).

Any more info I can provide to help debug this?


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

I will be trying to lab this up now to reproduce/fix.
Comments:By: BJ Weschke (bweschke) 2005-11-10 11:38:09.000-0600

ummm. yup. VERY reproducible. :)

By: Tilghman Lesher (tilghman) 2005-11-10 12:11:19.000-0600

Appears to be a problem with the "app args" conversion.  Can you reproduce on other converted apps?

By: BJ Weschke (bweschke) 2005-11-10 12:16:22.000-0600

we were segfaulting because there was a wrong assumption made that args.interface was a zero length string when it was actually NULL. patch attached. disclaimer on file.

By: Jason Parker (jparker) 2005-11-10 12:23:38.000-0600

Corydon76: I think you've got that backwards.  The function is ast_separate_app_args, and not ast_app_separate_args.  Your point is still valid though.

edit: well if you're just gonna go and delete your note to fix the typo, you might as well delete this one too. :p



By: BJ Weschke (bweschke) 2005-11-10 12:32:00.000-0600

it would be reproducible on other apps where there's an ast_strlen_zero check done and that returned true and the string was null instead of zero length and then we started to try and do things with that string like we were here. (eg put chan->name in it's place and trunc it after the last -)

By: Tilghman Lesher (tilghman) 2005-11-10 12:35:01.000-0600

north:  No, it isn't.  I'd invite you to go look at the source.  I just spent a good 15 minutes trying to find where the hell "ast_separate_app_args" is defined.  It's NOT.

By: Anton Krall (akrall) 2005-11-10 12:36:02.000-0600

Patch didnt apply to 1.2rc1 on first try, applied manually, compiled and seems to have fixed the issue on rc1.

By: Jason Parker (jparker) 2005-11-10 12:38:18.000-0600

See note on 5709.

app.c:
int ast_separate_app_args(char *buf, char delim, char **array, int arraylen)

edit: who would have thought they would have renamed an entire function in the last week?  I concede.



By: Kevin P. Fleming (kpfleming) 2005-11-10 18:32:47.000-0600

Committed to CVS HEAD, thanks!