[Home]

Summary:ASTERISK-26197: chan_sip: Deadlock during hangup
Reporter:Dmitrii kondrashin (aldragon)Labels:
Date Opened:2016-07-14 02:51:13Date Closed:
Priority:MajorRegression?No
Status:Open/NewComponents:Channels/chan_sip/General
Versions:11.22.0 13.18.4 Frequency of
Occurrence
Occasional
Related
Issues:
Environment:CentOS release 6.7 (Final) x64Attachments:( 0) backtrace.txt
( 1) core-show-fd.txt
( 2) core-show-locks.txt
( 3) core-show-taskprocessors.txt
( 4) core-show-threads.txt
( 5) dumps.txt
Description:Periodically, the asterisk stop to handle call(SIP messages) correctly. Сorrect handling is restored only after restarting asterisk.
It seems that the lock is created while asterisk tries to read from the tls socket, after that the thread crushes without release  of lock, and  all other threads are waiting for the release of this lock.
Asterisk was compiled without srtp module and tls is disabled in asterisk's configs.

I've attached  the output of commands "core show locks", "core show taskprocessors", "core show threads", "core show fd", and backtrace-file prepared using gdb.

Build Options: DONT_OPTIMIZE, DEBUG_THREADS, LOADABLE_MODULES, DEBUG_FD_LEAKS
Comments:By: Asterisk Team (asteriskteam) 2016-07-14 02:51:14.152-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Dmitrii kondrashin (aldragon) 2016-07-14 02:52:53.022-0500

debug files

By: Joshua C. Colp (jcolp) 2016-07-14 05:02:01.571-0500

This appears to be a locking inversion between "sip show channels" and other operations. The repeated AMI executions of it just increases the chance greatly of it happening.

By: Gostkov Evgeniy (gostkov) 2016-07-14 05:42:47.765-0500

Please fix it!

By: Joshua C. Colp (jcolp) 2016-07-14 05:48:37.903-0500

The issue has been accepted, there is no timeframe on when a fix would occur though.

By: Dmitrii kondrashin (aldragon) 2016-07-14 07:18:48.530-0500

Joshua, please specify, lock occurs only when we run the command by ami or asterisk console too?
Maybe you advise a temporary solution until the problem is solved? I want to avoid deadlocks asterisk servers.
Thank you.

By: Joshua C. Colp (jcolp) 2016-07-14 07:20:47.497-0500

If you run the "sip show channels" command in any way there is a chance it may deadlock.

By: Oleg Schelicalnov (OlegSch) 2018-06-09 01:38:15.506-0500

I gets deadlock looks same which also happens in hangup. It easily reproduced when maxcalls variable is set to low value 200 or 300 calls and AMI originates call at 70 cps.

Version 13.21.0