[asterisk-dev] 答复: the cpu be 99% for asterisk-1.4.0

scott.lv scott_lvsha at 163.com
Wed Mar 19 06:56:04 CDT 2008


I debug this asterisk process with gdb + asterisk + pid 

I found it will not break in for(){….} in asterisk.c ,look…

 

         for (;;) {

              buf = (char *)el_gets(el, &num);

              if (buf) {

                   if (buf[strlen(buf)-1] == '\n')

                       buf[strlen(buf)-1] = '\0';

 

                   consolehandler((char *)buf);

              } else if (ast_opt_remote && (write(STDOUT_FILENO, "\nUse EXIT
or QUIT to exit the asterisk console\n",

                      strlen("\nUse EXIT or QUIT to exit the asterisk
console\n")) < 0)) {

                   /* Whoa, stdout disappeared from under us... Make
/dev/null's */

                   int fd;

                   fd = open("/dev/null", O_RDWR);

                   if (fd > -1) {

                       dup2(fd, STDOUT_FILENO);

                       dup2(fd, STDIN_FILENO);

                   } else

                       ast_log(LOG_WARNING, "Failed to open /dev/null to
recover from dead console. Bad things will happen!\n");

                   break;

              }

         }

 

 

-----邮件原件-----
发件人: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com] 代表 Tzafrir Cohen
发送时间: 2008年3月19日 19:14
收件人: asterisk-dev at lists.digium.com
主题: Re: [asterisk-dev] the cpu be 99% for asterisk-1.4.0

 

On Wed, Mar 19, 2008 at 02:33:33PM +0800, scott.lv wrote:

> Step

> 

> 1.       login in centos by ssh SecureCRT 5.1

> 

> 2.       launch asterisk by command asterisk -cvvvvv

> 

> 3.       close ssh SecureCRT 5.1 window

> 

> 4.       login in centos from another ssh SecureCRT 5.1

> 

> 5.       look up asterisk status in top command 

> 

> 6.       asterisk cpu is 99%............................

 

You gave practically no details about your issue. Do you see any

interesting message in the logs? /var/log/asterisk/messages ?

 

Also note that many bugs have been fixed since 1.4.0 . Trying a newer

version (e.g: 1.4.18.1) is another option. There's a good chance that

that specific issue has been fixed since.

 

-- 

               Tzafrir Cohen

icq#16849755              jabber:tzafrir.cohen at xorcom.com

+972-50-7952406           mailto:tzafrir.cohen at xorcom.com

http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir

 

_______________________________________________

--Bandwidth and Colocation Provided by http://www.api-digital.com--

 

asterisk-dev mailing list

To UNSUBSCRIBE or update options visit:

   http://lists.digium.com/mailman/listinfo/asterisk-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20080319/1073a906/attachment-0001.htm 


More information about the asterisk-dev mailing list