[Home]

Summary:ASTERISK-13811: Asterisk using 100% of cpu on 64 bit ubuntu
Reporter:hoolahoous (hoolahoous)Labels:
Date Opened:2009-03-23 23:31:56Date Closed:2011-06-07 14:07:29
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asteriskDebug.txt
Description:I have installed asterisk 1.4.24 on ubuntu 8.10, 64 bit with SMP kernal

Linux XXXX 2.6.27-11-generic #1 SMP Thu Jan 29 19:28:32 UTC 2009 x86_64 GNU/Linux

My is SIP/IAX only solution so I do not load any hardware card drivers. I do load dahdi_dummy.
When using asterisk 1.4.24, cpu usage is constantly around 100% with no calls in progress. I can't see anything on CLI apart from usual registrations. I then installed 1.4.22 with everything else same and cpu usage is down to 0% when idle.
Everything else is same (same addons, same extensions and same trunks).

If there is any additional info is needed I can do that.
Comments:By: Leif Madsen (lmadsen) 2009-03-24 07:15:25

Could you first expand upon what you are doing on your system, and what kind of system this is running on?

Beyond that, if you could do a 'thread apply all bt' in gdb when the system is in that state, and attach the output as a file to this issue, that will help us get started.

Thanks!

By: hoolahoous (hoolahoous) 2009-03-24 08:20:50

I am running a AMD BE-2300 with 4 GB DDR2 RAM. 600 GB HDD. My purpose is to pretty much run asterisk (compiled from source). I have other programs installed on same machine but none of them are running when asterisk usage is 100%.

Sorry I am not too familiar with gdb so I google for it. Here is the output

root@xxx:/usr/src/asterisk-1.4.24# gdb asterisk
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(gdb) run
Starting program: /usr/sbin/asterisk
[Thread debugging using libthread_db enabled]

Program exited normally.
(gdb) thread apply all bt
No registers.
(gdb)



By: Leif Madsen (lmadsen) 2009-03-26 07:29:19

Hmmmm.... you may need to verify that Asterisk is compiled with "DONT_OPTIMIZE" in the Compiler Flags section of menuselect.

By: hoolahoous (hoolahoous) 2009-03-27 00:54:31

I compiled with  DONT_OPTIMIZE and  DEBUG_THREADS both on. However still same output

root@XXX:/usr/src/asterisk-1.4.24# gdb asterisk
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(gdb)
(gdb) run
Starting program: /usr/sbin/asterisk
[Thread debugging using libthread_db enabled]

Program exited normally.
(gdb) thread apply all bt
No registers.
(gdb)

By: Leif Madsen (lmadsen) 2009-03-27 09:20:37

You may not be attaching quite right here.  Try this:

gdb /usr/sbin/asterisk `pidof asterisk`

Let me know if that gives you better output.

Thanks!

By: hoolahoous (hoolahoous) 2009-03-29 23:42:58

Thanks I had better luck this time. `pidof asterisk` gave the hint. I was trying to run asterisk inside gdb. Instead when I ran asterisk upfront and then started gbd. Have attached the file with output.
CPU was 100% and more when this output was taken.
Hope this gives a clue. Let me know if you need further info.

By: Leif Madsen (lmadsen) 2009-04-01 13:12:44

Thanks for the feedback! Someone will get to this as soon as they can.

By: hoolahoous (hoolahoous) 2009-04-15 12:01:56

any update ?

By: Amilcar S Silvestre (amilcar) 2009-04-16 06:25:48

I think this is a duplicate of issue 14723 (or at least related). Just like 14866 and 14868.



By: hoolahoous (hoolahoous) 2009-04-16 10:07:53

those bugs indicate that issue occurs when hangup occurs. In my case cpus jumps to 100% and more as soon as asterisk is started.

By: Mark Michelson (mmichelson) 2009-04-16 10:32:01

Is the gdb output you uploaded taken when the system was taking up 100% CPU?

The only thread that isn't sleeping is a thread which is in the process of unlocking a lock in chan_iax2.

By: hoolahoous (hoolahoous) 2009-04-16 16:23:55

Yes.. as soon as astrisk starts, the cpu goes through roof.. no attempts to make calls (sip or IAX) after starting asterisk..

By: hoolahoous (hoolahoous) 2009-04-18 11:33:03

one more update.. i found out that i had a iax trunk (Free world dialup), and the hostname did not resolve (since they changed their host name).
once I removed that trunk, now cpu usage is no longer over 100%.. so maybe for some reason if iax trunk is not able to resolve the hostname, cpu jumps to 100%.

this problem did not exist in 1.4.22.

By: hoolahoous (hoolahoous) 2009-04-27 18:20:29

any progress .. or need more detail ?

By: Leif Madsen (lmadsen) 2009-05-12 14:14:10

Just reassigned this to dvossel to take a look at this issue to try and determine if there is something in chan_iax2 domain lookups that could cause this. Additionally, if you (dvossel) have any other ideas of how to get debugging information that would be useful, then that would be appreciate.

To the reporter: this is a low priority issue currently, so thank you for your continued patience on this issue.

By: David Vossel (dvossel) 2009-05-22 11:05:19

Hey, I looked over this issue a bit and I'm not sure what is causing it.  Based on the gdb output I do believe it involves IAX, but I can't tell what it could be doing that consumes 100% cpu.

There are a few things you could look into that might provide us a clue.  In the gdb output, the only active thread is the IAX network thread and it seems to be reading packets.  I know you don't have any calls going, but try a packet capture on UDP port 4569 (IAX's port) and see what you get.  Some cli debug output may be useful as well.

If the issue is as simple as starting Asterisk to reproduce, the easiest thing would be to provide access to the system so I could isolate what part of the code is causing it.  Email me the information if you are able to do this.

By: hoolahoous (hoolahoous) 2009-06-14 12:04:36

Sorry for late response. i might not be able to give you access to my server. But do you think it could be related to bug 14717 ?

By: David Vossel (dvossel) 2009-06-15 11:12:31

Yes, it may have to do with 14717.  If you are able to upgrade, it is worth upgrading to 1.4.25.1 and seeing if you still have a problem.

By: David Vossel (dvossel) 2009-07-10 14:41:16

As it is, I can't reproduce this or move it forward without additional information.  Feel free to reopen if you were able to update and can provide any of the additional information requested.