[Home]

Summary:ASTERISK-01133: Crash in ChanIsAvail when checking for a lot of users
Reporter:geertn (geertn)Labels:
Date Opened:2004-03-02 11:19:33.000-0600Date Closed:2008-01-15 14:45:17.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bt.txt
( 1) cli.txt
Description:I do ChanIsAvail. When having a lot of phones here, it crashes:

   -- Executing ChanIsAvail("SIP/1200*662-bf29", "SIP/henk&SIP/henklaptop&IAX2/henklaptop&SIP/geert&SIP/geertlaptop&IAX2/geertlaptop&SIP/niels&SIP/nielslaptop&IAX2/nielslaptop&SIP/arien&SIP/arienhome&SIP/arieng5&IAX2/arieng5&IAX2/arienlaptop&SIP/steven&SIP/stevenlaptop&IAX2/stevenlaptopn new stack
Segmentation fault
Ouch ... error while writing audio data: : Broken pipe

Backtrace:
#0  0x40544cfb in chanavail_exec (chan=0x0, data=0x0) at app_chanisavail.c:84
84                              if ((tempchan = ast_request(tech, chan->nativeformats, number))) {
(gdb)
(gdb)
(gdb) bt
#0  0x40544cfb in chanavail_exec (chan=0x0, data=0x0) at app_chanisavail.c:84


I do chanis available for:
SIP/henk&SIP/henklaptop&IAX2/henklaptop&SIP/geert&SIP/geertlaptop&IAX2/geertlaptop&SIP/niels&SIP/nielslaptop&IAX2/nielslaptop&SIP/arie
n&SIP/arienhome&SIP/arieng5&IAX2/arieng5&IAX2/arienlaptop&SIP/steven&SIP/stevenlaptop&IAX2/stevenlaptop

Maybe this isn't the way to go, but I think this should not result in a crash.
Comments:By: geertn (geertn) 2004-03-02 11:24:32.000-0600

Sorry, attached the CLI and BT info as I should have done right away.

By: James Golovich (jamesgolovich) 2004-03-02 12:35:55.000-0600

Your right this shouldn't result in a crash, and I'll fix it up.  but I'm not sure your going to get the results you expect with ChanIsAvail.  When I wrote it originally it was just for Zap channels, but it kinda works with everything so I made it generic.  but it usually wont do exactly what you expect, depending on how the channel driver works.  in some cases (as I believe it is with sip) ChanIsAvail will think a sip channel is available if it can resolve its dns name or check if there is a sip peer setup.  It shouldn't actually be checking if it can reach the user, or if its not busy

By: James Golovich (jamesgolovich) 2004-03-02 12:59:49.000-0600

Fixed in CVS

By: Digium Subversion (svnbot) 2008-01-15 14:45:17.000-0600

Repository: asterisk
Revision: 2295

U   trunk/apps/app_chanisavail.c

------------------------------------------------------------------------
r2295 | citats | 2008-01-15 14:45:16 -0600 (Tue, 15 Jan 2008) | 2 lines

Fix app_chanisavail.c when passed string is big (bug ASTERISK-1133)

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

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

By: Digium Subversion (svnbot) 2008-01-15 14:45:17.000-0600

Repository: asterisk
Revision: 2296

U   branches/v1-0_stable/apps/app_chanisavail.c

------------------------------------------------------------------------
r2296 | citats | 2008-01-15 14:45:17 -0600 (Tue, 15 Jan 2008) | 2 lines

Fix app_chanisavail.c when passed string is big (bug ASTERISK-1133)

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

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