[asterisk-bugs] [JIRA] (ASTERISK-21409) IAX2 locks up with many threads blocked by iax2_destroy_helper
Matt Jordan (JIRA)
noreply at issues.asterisk.org
Wed May 8 08:25:39 CDT 2013
[ https://issues.asterisk.org/jira/browse/ASTERISK-21409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=206192#comment-206192 ]
Matt Jordan commented on ASTERISK-21409:
----------------------------------------
That's rather strange - it appears to be blocking on the removal of the scheduled callback for the {{lagid}}:
{noformat}
AST_SCHED_DEL_SPINLOCK(ast_sched_thread_get_context(sched), pvt->pingid, &iaxsl[pvt->callno]);
pvt->pingid = DONT_RESCHEDULE;
AST_SCHED_DEL_SPINLOCK(ast_sched_thread_get_context(sched), pvt->lagid, &iaxsl[pvt->callno]);
pvt->lagid = DONT_RESCHEDULE;
{noformat}
And in fact, we can see that some thread has stalled out while holding this lock at this location:
{noformat}
===
=== Thread ID: 0xaf4c3b70 (iax2_process_thread started at [12405] chan_iax2.c start_network_thread())
=== ---> Lock #0 (chan_iax2.c): MUTEX 1920 iax2_destroy_helper &iaxsl[pvt->callno] 0xb698cbe0 (1)
/usr/sbin/asterisk(ast_bt_get_addresses+0x19) [0x8139751]
/usr/sbin/asterisk(__ast_pthread_mutex_lock+0xac) [0x81329c1]
/usr/lib/asterisk/modules/chan_iax2.so(+0x13860) [0xb683a860]
/usr/sbin/asterisk() [0x81a922f]
/usr/sbin/asterisk() [0x81ba1e3]
/lib/i686/cmov/libpthread.so.0(+0x5955) [0xb72f9955]
/lib/i686/cmov/libc.so.6(clone+0x5e) [0xb77391de]
=== -------------------------------------------------------------------
{noformat}
We shouldn't be getting stuck on this - at most, we attempt to delete the scheduled ID 10 times:
{noformat}
int _sched_res = -1; \
while (id > -1 && (_sched_res = ast_sched_del(sched, id)) && ++_count < 10) { \
ast_mutex_unlock(lock); \
usleep(1); \
ast_mutex_lock(lock); \
} \
{noformat}
So, the question is: what is this thread waiting on?
A gdb backtrace may answer that.
> IAX2 locks up with many threads blocked by iax2_destroy_helper
> --------------------------------------------------------------
>
> Key: ASTERISK-21409
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-21409
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Channels/chan_iax2
> Affects Versions: 1.8.15.0, 11.3.0
> Environment: Debian Squeeze
> Reporter: Alec Davis
> Attachments: full.may08.C-0000034cd.txt, iax-coreshowlocks-may08-auckland.txt, iax-lock-asterisk-11.txt, iax-lock-asterisk-1-8-15.txt, var_log_messages.txt
>
>
> Intermittently all IAX calls stop over the trunk.
> I think this is reproduced when a call is transferred back to the originating site, we have "transfer=on"
> Also happened with asterisk SVN-branch-11-r382514.
> Attached are the 1.8.15.0 lockup, and the 11-branch lockup.
>
--
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