[asterisk-bugs] [JIRA] (ASTERISK-23554) deadlock on forced disconnect of DAHDI PRI span

Tzafrir Cohen (JIRA) noreply at issues.asterisk.org
Mon Mar 31 13:07:18 CDT 2014


     [ https://issues.asterisk.org/jira/browse/ASTERISK-23554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tzafrir Cohen updated ASTERISK-23554:
-------------------------------------

    Attachment: pri_destroy_span_prilist.patch

pri_destroy_span_prilist.patch: A slightly different approach: destroy the span in the monitor thread:

* A global list: doomed_pris
* On DAHDI_EVENT_REMOVED to the span: add it to the list.
* The monitor thread checks the list periodically, and destroys all the spans there.

This mostly gets rid of the problem I mentioned in the previous comment, but I still managed to reproduce it.

> deadlock on forced disconnect of DAHDI PRI span
> -----------------------------------------------
>
>                 Key: ASTERISK-23554
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23554
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_dahdi
>    Affects Versions: SVN, 12.1.1
>            Reporter: Tzafrir Cohen
>         Attachments: pri_destroy_span_nolock.patch, pri_destroy_span_prilist.patch, pri_destroy_span_threads.patch
>
>
> There is a deadlock on the locks of iflock (the chan_dahdi lock of the interfaces list) and pri->lock of the specific span.
> Path 1:
> DAHDI_EVENT_REMOVED received on a B channel. Later on:
> do_monitor
> dahdi_destroy_channel_range (takes iflock)
> destroy_dahdi_pvt
> dahdi_unlink_pri_pvt (tries to take pri->lock)
> Path 2:
> pri_dchannel (takes pri->lock)
> sig_pri_handle_dchan_exception
> my_handle_dchan_exception (handling DAHDI_EVENT_REMOVED)
> pri_destroy_span
> dahdi_destroy_channel_range (tries to take iflock)
> It seems that this is esy to reproduce as DAHDI will emit a DAHDI_EVENT_REMOVED in response to any ioctl on a channel in a device that has been removed.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list