CPU Usage at 100%

I am using SVN-trunk-r42298M.

Every 24 hours or so, asterisk CPU usage is at 99% to 100% when I view the stats through top. During this time, DTMF tones are not recognized by asterisk.

Sometimes it becomes normal after few hours, but most often I have to restart asterisk to bring it to normal state.

Usually this starts happening right after certain calls. But I haven’t been able to reproduce it.

Asterisk is running on dual cpu 64 bit xeon on fedora core 5. Is there anything that I can check when this happens next time to find out the exact problem so that I can reproduce it?

I tried installing it in a 32 bit box. But still the problem persist. It actually happend after a meetme conference.

Any tips on how to debug the process?

posting the debug log file fragment for the call might prove helpful.

When the process is running at 100%, I used gdb to connect to the process. Following is the output

(gdb) bt
#0 0x00710402 in __kernel_vsyscall ()
#1 0x008afb8b in __read_nocancel () from /lib/libpthread.so.0
#2 0x080ebcde in read_char ()
#3 0x080f4f7f in el_gets ()
#4 0x0806bd38 in main (argc=-1486780416, argv=0xa76478bf) at asterisk.c:2718

It looks normal to me. Please let me know if something is wrong

I was seeing a similar issue with CPU @ 100%

Right after starting asterisk, the first process would die

user@host:/# /etc/init.d/asterisk start
Starting Asterisk PBX: asterisk.
user@host:/# Asterisk ended with exit status 0
Asterisk shutdown normally.

the process which restarted automatically (by asterisk itself)
after that was functional, but hogging 100% of the CPU.

I’m running debian (etch, latest), and it only shows up
with asterisk 1.4 (release or svn). asterisk 1.2.x on the
same box does NOT have this problem, using
identical config files.

After some investigation, I was able to resolve it in my case
by changing my asterisk.conf (in /etc/asterisk in my case).

putting the following settings in asterisk.conf cleared it up for me

alwaysfork = no
nofork = yes