[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [Asterisk-Dev] Re: Asterisk core
From:       Derek Smithies <derek () indranet ! co ! nz>
Date:       2004-03-31 23:54:28
Message-ID: Pine.LNX.4.44.0404011145420.25962-100000 () kauri ! acheron ! indranet ! co ! nz
[Download RAW message or body]

Hi,
 
 My view is that it is not open file limit.

 My understanding is that Peter meant in his initial letter,
   After processing 200 calls, 
 and 
   when there were  20 concurrent calls, the h323 module failed.

Openh323, which generates far more open files than asterisk, can manage
70 concurrent calls through a proxy before the file handle limit is 
reached.

===================
A quick perusal of the code in the cvs, chan_h323.cxx revealed two
instances of the strtok_r function.

 From the man page of strtok_r:: (which is combined with strtok)
BUGS
       Never use these functions. If you do, note that:
 
              These functions modify their first argument.
 
              These functions cannot be used on constant strings.
 
              The identity of the delimiting character is lost.
 
              The strtok() function uses a static  buffer  while  parsing,  
              so it's not thread safe. Use strtok_r() if this matters to you.
 

Now, in 
static struct ast_channel *oh323_request(char *type, int format, void *data)
{

there is a call to ::
      strtok_r(host, "/", &(h323id));
                 

further down the procedure,
there are two calls which use the variable host.
>From the bugs section above, 
  "These functions modify their first argument" (the variable host)


My view is that the strtok_r calls should be replaced...

Derek.
============================================================
On Thu, 1 Apr 2004, Peter Nixon wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Ignore my previous email. Its late..
> - From "uname -a":
> 
> open files                    (-n) 1024
> 
> 
> Peter
> 
> On Thursday 01 April 2004 01:39, James Golovich wrote:
> > I see lots of 'Too many open files'.  Try increasing your maximum files
> > limit.  Since you say ~200 calls, I bet your max files is set to 255
> >
> > James
> >
> > On Thu, 1 Apr 2004, Peter Nixon wrote:
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > Hi Guys
> > >
> > > I am having some problems with G729 and H323.
> > > Both are  working for small numbers of calls, but when I tried to run 20
> > > simultaneous calls I got though approximately 200 calls before Asterisk
> > > dumped core :-(
> > >
> > > The last page of error messages are below.
> > >
> > > Does anyone have any idea on what to do to fix it? Is anyone else having
> > > this problem?
> > >
> > > Mar 31 20:35:32 NOTICE[6127863]: Unable to create channel of type 'Zap'
> > > Mar 31 20:35:33 WARNING[6160633]: Channel
> > > 'H323/ip$x.74.46.201:38800/4578' sent into invalid extension 's' in
> > > context 'default', but no invalid handler Mar 31 20:35:35
> > > NOTICE[6193402]: Unable to create channel of type 'Zap' Mar 31 20:35:35
> > > NOTICE[6226172]: Unable to create channel of type 'Zap' Mar 31 20:35:36
> > > NOTICE[6258942]: Unable to create channel of type 'Zap' Mar 31 20:35:37
> > > NOTICE[6291712]: Unable to create channel of type 'Zap' Mar 31 20:35:37
> > > NOTICE[6324482]: Unable to create channel of type 'Zap' Mar 31 20:35:37
> > > WARNING[6357252]: Channel 'H323/ip$x.74.46.201:38818/875' sent into
> > > invalid extension 's' in context 'default', but no invalid handler Mar 31
> > > 20:35:39 NOTICE[1277997]: Unknown RTP codec 19 received
> > > Mar 31 20:35:40 WARNING[6390020]: Channel
> > > 'H323/ip$x.74.46.201:38830/4594' sent into invalid extension 's' in
> > > context 'default', but no invalid handler Mar 31 20:35:41
> > > NOTICE[1277997]: Unknown RTP codec 19 received
> > > Mar 31 20:35:41 NOTICE[6422789]: Unable to create channel of type 'Zap'
> > > Mar 31 20:35:41 NOTICE[6455559]: Unable to create channel of type 'Zap'
> > > Mar 31 20:35:42 NOTICE[6504714]: Unable to create channel of type 'Zap'
> > > Mar 31 20:35:42 NOTICE[6521099]: Unable to create channel of type 'Zap'
> > > Mar 31 20:35:44 NOTICE[6553869]: Unable to create channel of type 'Zap'
> > > Mar 31 20:35:44 NOTICE[6586639]: Unable to create channel of type 'Zap'
> > > Mar 31 20:35:44 WARNING[6619409]: Channel
> > > 'H323/ip$64.74.46.201:38843/4605' sent into invalid extension 's' in
> > > context 'default', but no invalid handler Mar 31 20:35:46 NOTICE[966686]:
> > > Unknown RTP codec 19 received
> > > Mar 31 20:35:46 NOTICE[6652178]: Unable to create channel of type 'Zap'
> > > Mar 31 20:35:46 NOTICE[1277997]: Unknown RTP codec 19 received
> > > Mar 31 20:35:47 NOTICE[1277997]: Unknown RTP codec 19 received
> > > Mar 31 20:35:50 ERROR[2949217]: Unable to allocate private structure,
> > > this is very bad.
> > > Mar 31 20:35:50 ERROR[2949217]: Unable to allocate private structure,
> > > this is very bad.
> > > Mar 31 20:35:50 ERROR[2949217]: Unable to allocate private structure,
> > > this is very bad.
> > > Mar 31 20:35:50 ERROR[2949217]: Unable to allocate private structure,
> > > this is very bad.
> > > Mar 31 20:35:50 NOTICE[1277997]: Unknown RTP codec 19 received
> > > Mar 31 20:35:51 WARNING[6684703]: Channel 'H323/ip$x.74.46.201:38849/892'
> > > sent into invalid extension 's' in context 'default', but no invalid
> > > handler Mar 31 20:35:51 NOTICE[6717491]: Unable to create channel of type
> > > 'Zap' Mar 31 20:35:52 NOTICE[6750267]: Unable to create channel of type
> > > 'Zap' Mar 31 20:35:55 NOTICE[6783074]: Unable to create channel of type
> > > 'Zap' Mar 31 20:35:56 NOTICE[6816020]: Unable to create channel of type
> > > 'Zap' Mar 31 20:35:57 WARNING[6832405]: Unable to allocate socket: Too
> > > many open files
> > > Mar 31 20:35:57 WARNING[6832405]: Unable to create RTP session: Too many
> > > open files
> > > Mar 31 20:35:57 ERROR[6832405]: Unable to allocate private structure,
> > > this is bad.
> > > Mar 31 20:41:29 NOTICE[901144]: Unknown RTP codec 19 received
> > > Mar 31 20:41:51 NOTICE[1572919]: Unknown RTP codec 19 received
> > > Mar 31 20:41:53 NOTICE[1572919]: Unknown RTP codec 19 received
> > > Mar 31 20:41:53 NOTICE[1572919]: Unknown RTP codec 19 received
> > > Mar 31 20:41:55 NOTICE[1572919]: Unknown RTP codec 19 received
> > > Mar 31 20:41:59 NOTICE[1572919]: Unknown RTP codec 19 received
> > > Mar 31 20:42:03 NOTICE[1572919]: Unknown RTP codec 19 received
> > > Mar 31 20:42:03 NOTICE[1572919]: Unknown RTP codec 19 received
> > > Mar 31 21:16:29 NOTICE[966686]: Unknown RTP codec 19 received
> > > Mar 31 21:16:45 NOTICE[966686]: Unknown RTP codec 19 received
> > > Mar 31 21:19:24 NOTICE[802859]: Unknown RTP codec 19 received
> > > Mar 31 21:19:38 NOTICE[802859]: Unknown RTP codec 19 received
> > > Mar 31 21:19:41 NOTICE[802859]: Unknown RTP codec 19 received
> > > Mar 31 21:19:44 NOTICE[802859]: Unknown RTP codec 19 received
> > > Mar 31 21:19:47 NOTICE[802859]: Unknown RTP codec 19 received
> > > Mar 31 21:19:48 NOTICE[802859]: Unknown RTP codec 19 received
> > > Mar 31 21:19:52 NOTICE[802859]: Unknown RTP codec 19 received
> > > Mar 31 21:19:53 NOTICE[802859]: Unknown RTP codec 19 received
> > > Mar 31 21:19:57 NOTICE[802859]: Unknown RTP codec 19 received
> > > Mar 31 21:20:00 NOTICE[802859]: Unknown RTP codec 19 received
> > > Mar 31 22:19:13 WARNING[16384]: Translator 'g729tolinb' does not produce
> > > sample frames.
> > > Mar 31 22:19:13 WARNING[16384]: Ignoring port for now
> >
> > _______________________________________________
> > Asterisk-Dev mailing list
> > Asterisk-Dev@lists.digium.com
> > http://lists.digium.com/mailman/listinfo/asterisk-dev
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-dev
> 
> - -- 
> 
> Peter Nixon
> http://www.peternixon.net/
> PGP Key: http://www.peternixon.net/public.asc
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.2 (GNU/Linux)
> 
> iD8DBQFAa00rAcdsUt9pJjwRAuBVAJwNcGFpqmSLlHiPkWoZ6G7yiRTrHACg/bBI
> er4lWSfnb/Ct8DQiNYcDOwY=
> =8j/R
> -----END PGP SIGNATURE-----
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
> 
> 
> 

-- 
Derek Smithies Ph.D.                           This PC runs pine on linux for email
IndraNet Technologies Ltd.                     If you find a virus apparently from me, it has
Email: derek@indranet.co.nz                    forged  the e-mail headers on someone else's machine
ph +64 3 365 6485                              Please do not notify me when (apparently) receiving a
Web: http://www.indranet-technologies.com/     windows virus from me......


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic