[Home]

Summary:ASTERISK-23983: IAX2 Potentially Causing Multiple Locks and Hanging Asterisk
Reporter:Adam Kenneth Dean (AdamKDean)Labels:
Date Opened:2014-07-02 10:33:11Date Closed:2014-07-02 11:12:05
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_iax2
Versions:11.10.0 11.10.2 Frequency of
Occurrence
Frequent
Related
Issues:
is duplicated byASTERISK-22851 Asterisk/SIP+RTP stops responding when compiled with DEBUG_THREADS
Environment:Pair of Debian (Wheezy) based Asterisk 11 systems. Linux version 3.2.0-4-amd64 Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz 4GB RAMAttachments:( 0) backtrace-threads.txt
( 1) iax2-locks.png
Description:Please note, this is my first time submitting a bug, if there is anything else required and it is in my power to do so, I shall happily supply it.

I am having an issue on pair of systems. Whereby seemingly randomly one system (Troublesome) will lock up and you are unable to dial in, out, or between it and the other system (Non-Troublesome.) Sometimes the systems appear to recover, other times the Troublesome side will require a restart (kill -9 first) and the Non-Troublesome IAX2 module will need reloading.

Initially I was stumped, but twice now the issue has happened when a call was going between the sites over an IAX2 trunk, which has led me to suspect that it may be related to this.

Initially the server installations were out of sync, the troublesome one being on 11.10.2 and the non-troubled one being on 11.10.0. As a potential fix I downgraded the troublesome one to be in line with 11.10.0.

I was able to run "core show locks" from a moment when the system locked up (before it recovered) I caught this lock because I tried to originate out and it didn't work. A few seconds later though, a few errors were spat out to the console and the call originated:

[2014-07-02 15:50:01] ERROR[15068] utils.c: write() returned error: Broken pipe
[2014-07-02 15:50:01] ERROR[15068] utils.c: write() returned error: Broken pipe
[2014-07-02 15:50:01] ERROR[15068] utils.c: write() returned error: Broken pipe
[2014-07-02 15:50:01] ERROR[15068] utils.c: write() returned error: Broken pipe
[2014-07-02 15:50:01] ERROR[15068] utils.c: write() returned error: Broken pipe
[2014-07-02 15:50:01] VERBOSE[15068][C-0000002c] sig_pri.c:     -- Requested transfer capability: 0x00 - SPEECH
[2014-07-02 15:50:09] VERBOSE[825][C-0000002c] pbx.c:     -- Launching playback(hello-world) on DAHDI/i1/01618504004-22
[2014-07-02 15:50:09] ERROR[15068] utils.c: write() returned error: Broken pipe

This was an originated call out of an ISDN30 connection.

---

This is the troublesome side of the IAX2 friend:

---Start---
[sal-lon]
type=friend
host=10.34.43.10
trunk=yes
secret=<A super secret>
context=from-site
deny=0.0.0.0/0.0.0.0
permit=10.34.43.10/255.255.255.255
qualify=yes
;autokill=yes
maxregexpire=180
minregexpire=60
maxauthreq=10
---End---

This is the non-troublesome side of the IAX2 friend:

---Start---
[sal-lon]
type=friend
host=192.168.20.10
trunk=yes
secret=<A super secret>
context=from-site
deny=0.0.0.0/0.0.0.0
permit=192.168.20.10/255.255.255.255
qualify=yes
;autokill=yes
maxregexpire=180
minregexpire=60
maxauthreq=10
---End---

I believe it is an MPLS circuit between the two sites.

---

Asterisk 11.10.0 built by root @ asterisklon on a x86_64 running Linux on 2014-06-30 22:25:39 UTC

DAHDI Version: 2.9.1.1 Echo Canceller: MG2
Comments:By: Adam Kenneth Dean (AdamKDean) 2014-07-02 10:34:22.461-0500

This is the backtrace I was able to grab using:

# gdb -ex "thread apply all bt" --batch /usr/sbin/asterisk `pidof asterisk` > /tmp/backtrace-threads.txt

While the system was hung and before it processed the call.

By: Adam Kenneth Dean (AdamKDean) 2014-07-02 10:36:43.968-0500

I apologise that this is a screenshot, but this is the output of:

> core show locks

While the system appeared hung.

By: Matt Jordan (mjordan) 2014-07-02 11:11:58.607-0500

The output of your backtrace indicates that this is the same issue as ASTERISK-22851. As such, I'm going to close this out as a duplicate of that issue.

If you compile Asterisk without {{DEBUG_THREADS}}, the issue should go away. If you find that the issue persists without DEBUG_THREADS, please ask a bug marshal in #asterisk-bugs or comment on this issue and we will reopen it.