[asterisk-bugs] [JIRA] (ASTERISK-22857) Deadlock: Locked Here: chan_iax2.c line 9756 (socket_read)
Matt Jordan (JIRA)
noreply at issues.asterisk.org
Thu Nov 21 09:28:03 CST 2013
[ https://issues.asterisk.org/jira/browse/ASTERISK-22857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212080#comment-212080 ]
Matt Jordan commented on ASTERISK-22857:
----------------------------------------
Hm. That doesn't make a lot of sense.
The offending code is this:
{noformat}
iax2_lock_owner(fr->callno);
if (iaxs[fr->callno]) {
if (iaxs[fr->callno]->owner) {
struct ast_format_cap *orignative = ast_format_cap_dup(ast_channel_nativeformats(iaxs[fr->callno]->owner));
struct ast_format_cap *native = ast_channel_nativeformats(iaxs[fr->callno]->owner);
if (orignative) {
ast_format_cap_set(native, &f.subclass.format);
if (ast_channel_readformat(iaxs[fr->callno]->owner)->id) {
ast_set_read_format(iaxs[fr->callno]->owner, ast_channel_readformat(iaxs[fr->callno]->owner));
}
ast_format_cap_copy(native, orignative);
orignative = ast_format_cap_destroy(orignative);
}
ast_channel_unlock(iaxs[fr->callno]->owner);
{noformat}
Richard's patch moved the {{ast_channel_unlock}} from inside the {{if (orignative)}} call to outside of it. The only time that would have made any difference is if the channel did not have native formats on it (which is fairly off nominal) - in which case, the original code would have left the channel locked.
I'm not sure how or why reverting this would cause any difference to the scenario you're seeing.
> Deadlock: Locked Here: chan_iax2.c line 9756 (socket_read)
> ----------------------------------------------------------
>
> Key: ASTERISK-22857
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-22857
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Channels/chan_iax2
> Affects Versions: SVN, 11.6.0
> Environment: 64 bit CentOS, 4GB RAM
> Reporter: David Brillert
> Assignee: David Brillert
> Severity: Critical
> Attachments: backtrace.txt, core show locks_gdb thread apply all bt full.txt, gdbcorebtbtfull.txt, iax2 debug.txt, valgrind.txt
>
>
> Full deadlock no call processing, no SIP traffic.
> GDB output DONT_OPTIMIZE DEBUG_THREADS BETTER_BACKTRACES thread apply all bt full.txt attached. The deadlock occurred overnight while the system was idle.
> It is happening on multiple production servers.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the asterisk-bugs
mailing list