Cees de Groot
2004-Dec-28 08:54 UTC
[Asterisk-Users] Asterisk consuming 100% CPU - CDR loop
Hi, I had Asterisk threads consuming 100% CPU at times since last week. Of course, last week an extra card was installed (we had a 1PRI, a 4PRI was added) so search concentrated on that, but to no avail. Today, I installed DDD on the machine and quickly found out that it was looping because cdr->next->next == cdr in ast_cdr_setapp(). I patched this up with some simple code in ast_cdr_append(), but that's just masking the bug. The only place were cdr->next is set is in ast_cdr_append(), and this (as far as I can tell) code is called from ForkCDR() and the Zap channel transfer logic (also from SIP, but SIP is not involved here). I do a ForkCDR() somewhere before Dial() so I think my dialplan hits both (people dial in through Zap and out again through Zap). And the trouble started when I added ForkCDR() to the dialplan. I suspect the code in chan_zap.c:attempt_transfer() is flawed somewhere w.r.t. blindingly glueing CDR's together, but I'm not completely sure: first, I am not even sure whether I hit this function, second, it *seems* to happen just now and then which would indicate a race condition. The system is a production system, all the calls are essentially the same: people call in, go through some IVR, enter a number to dial out, the system does a Dial(). Anyone else had this problem?