[Home]

Summary:ASTERISK-12256: IAX2 channel gets stuck, causes CLI to get stuck, * won't restart
Reporter:Russell Brown (ruffle)Labels:
Date Opened:2008-06-24 06:29:38Date Closed:2008-06-30 11:10:16
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_iax2
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Using 1.4.21, I've just setup a VOIP incoming trunk from a third party (Gradwell.co.uk) that connects via IAX.

When a call comes in on this trunk, the call often (>50% of the time) gets 'stuck' with no audio being passed and/or the channel stays up after the end of the call.

When * gets into this state, an existing CLI won't do tab expansion of commands and stalls if you try. (type show ch<TAB> and it just sits there till I give it a keyboard interrupt).

Typing 'show channels' in full tends to show the channels the first time and then shows nothing. Firing up another CLI and typing 'show channels' in full again shows the channels the first time and then returns nothing. Tab expansion also gets stuck after the first 'show channels'. ie:

asterisk*CLI> show channels
Channel              Location             State   Application(Data)            
SIP/112-0076cb60     (None)               Up      Bridged Call(IAX2/GradwellVOIP
asterisk*CLI> show channels
asterisk*CLI> show ch<TAB>

The CLI stays like this till I kill it.

Starting a fresh CLI I get exactly the same as shown above.

The IAX2 channel never goes away. * won't restart (I have to kill -9).

I'm using 1.4.21. Reverting to 1.4.20.1 and the problem doesn't seem to appear.

I even tried the patch 123391 and that didn't solve the problem.

****** ADDITIONAL INFORMATION ******

I tried recompiling 1.4.21 with DEBUG_CHANNEL_LOCKS but I can't make outgoing calls on our ISDN PRI channels then :-(
Comments:By: Tim Panton (tpanton) 2008-06-24 08:00:07

I can reproduce this on a quad core SuSE 10.1 machine.
Linux api 2.6.16.54-0.2.5-smp #1 SMP Mon Jan 21 13:29:51 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux

At first I thought it was related to my cdr_odbc - it isn't

A bit more experimentation and I've learnt the following:
1) it isn't present in 1.4.4
2) it still happens in 1.4.21 if I disable cdr_odbc - but less often.
3) it freezes the CLI - so I don't think 'core show locks' will work.

The machine isn't in production (yet) so if there are other tests I can
run I'd be happy to.



By: rkelly (rkelly) 2008-06-24 15:20:48

Same issue here.
This is quite a show stopper.
Centos 5.1 x86_64
Asterisk tag 1.4.21 from svn.

Once up for a little bit, the trunk goes down and after which, executing a core show channels lists the channels then hangs before displaying the call info. Performing that on the console hangs the cli. Performing the same command from a remote console session only outputs the channel info, then after the first fails, outputs nothing on successive executions.
IAX trunking is dead until a restart.
Our other Asterisk box is 1.4.19 and doesn't exhibit the behavior.
We just downgraded to 1.4.19 to hopefully stop this issue until resolved.

By: Tilghman Lesher (tilghman) 2008-06-24 16:40:30

Do not recompile with DEBUG_CHANNEL_LOCKS.  Only recompile with DEBUG_THREADS and DONT_OPTIMIZE and obtain the output of 'core show locks' by using the remote console interface:

asterisk -rx 'core show locks'

By: Tim Panton (tpanton) 2008-06-25 09:11:00

Unfortunately when compiled with DEBUG_THREADS and DONT_OPTIMIZE  1.4.21 doesn't
exhibit the problem. (at least not over the last 24 hours....)

By: Francesco Romano (francesco_r) 2008-06-25 14:03:49

The problem is very similar to the bug i reported some days ago (ASTERISK-12146) and already fixed. Have you tried the latest 1.4 SVN?

By: Digium Subversion (svnbot) 2008-06-30 10:59:02

Repository: asterisk
Revision: 126573

U   branches/1.4/include/asterisk/lock.h

------------------------------------------------------------------------
r126573 | russell | 2008-06-30 10:57:56 -0500 (Mon, 30 Jun 2008) | 10 lines

Fix a typo in the non-DEBUG_THREADS version of the recently added DEADLOCK_AVOIDANCE()
macro.  This caused the lock to not actually be released, and as a result, not
avoid deadlocks at all.  This resolves the issues reported in the last while about
Asterisk locking up all over the place (and most commonly, in chan_iax2).

(closes issue ASTERISK-12258)
(closes issue ASTERISK-12270)
(closes issue ASTERISK-12256)
(potentially closes others ...)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=126573

By: Digium Subversion (svnbot) 2008-06-30 11:10:16

Repository: asterisk
Revision: 126578

U   tags/1.4.21.1/include/asterisk/lock.h

------------------------------------------------------------------------
r126578 | russell | 2008-06-30 11:09:42 -0500 (Mon, 30 Jun 2008) | 10 lines

Fix a typo in the non-DEBUG_THREADS version of the recently added DEADLOCK_AVOIDANCE()
macro.  This caused the lock to not actually be released, and as a result, not
avoid deadlocks at all.  This resolves the issues reported in the last while about
Asterisk locking up all over the place (and most commonly, in chan_iax2).

(closes issue ASTERISK-12258)
(closes issue ASTERISK-12270)
(closes issue ASTERISK-12256)
(potentially closes others ...)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=126578