<div>
<style type="text/css">
.successful a, .successful a:visited, .successful a:link, .successful a:hover,.successful  a:active {color:#393}
.failed a, .failed a:visited, .failed a:link, .failed a:hover,.failed  a:active {color:#d62829}
td a, td a:link, td a:visited, td a:hover, td a:active {background:transparent;font-family: Arial, sans-serif;text-decoration:underline;}
td a:link {color:#369;}
td a:visited {color:#444;}
td a:hover, td a:active {color:#036;}
td a:hover {text-decoration:none;}
</style>
<font size="2" color="black" face="Arial, Helvetica, sans-serif" style="font-family: Arial, sans-serif;font-size: 13px;color:#000">
<table align="center" border="0" cellpadding="5" cellspacing="0" width="98%">
<tr>
        <td style="vertical-align:top">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:#ffe6e7;border-top:1px solid #eec0c0;border-bottom:1px solid #eec0c0;color:#d62829;">
        <tr>
        <td width="20" style="vertical-align:top;padding:5px 0 5px 10px">
            <img src="http://bamboo.asterisk.org/images/jt/icn_plan_failed.gif" width="15" height="15">
        </td>
        <td width="100%" style="font-family: Arial, sans-serif; font-size: 13px; color:#d62829;padding:5px 10px">
            <a href="http://bamboo.asterisk.org/browse/AST-1432-45/" style="font-family: Arial, sans-serif; font-size: 15px; font-weight:bold; color:#d62829">AST-1432-45</a>
            <span class="failed" style="font-family: Arial, sans-serif; font-size: 14px;">failed.</span>
            <span class="failed" style="font-family: Arial, sans-serif; font-size: 13px;">
            <br/>Code has been updated by <a href="http://bamboo.asterisk.org/browse/author/jpeeler">jpeeler</a>.
                <br/><strong>1/45</strong> tests failed.
            </span>
        </td>
        </tr>
        </table>
        <br>


   <table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:#ecf1f7;border-top:1px solid #bbd0e5;border-bottom:1px solid #bbd0e5;color:#036;">
        <tr>
            <td width="60%" style="font-family: Arial, sans-serif;text-align:left;font-size:16px;font-weight:bold;color:#036;padding:5px 10px">
                <a href="http://bamboo.asterisk.org/browse/AST-1432-45/commit" style="text-decoration: none; font-family: Arial, sans-serif;text-align:left;font-size:16px;font-weight:bold;color:#036" >Code Changes</a>
            </td>
            <td width="40%" style="font-family: Arial, sans-serif;text-align:right;font-size:13px;color:#036;padding:5px 10px">
                <a href="http://bamboo.asterisk.org/browse/AST-1432-45/commit" style="font-family: Arial, sans-serif; font-size: 13px; color:#036">See full change details</a><img src="http://bamboo.asterisk.org/images/icons/more.gif" width="15" height="15" style="vertical-align:middle;padding:2px">
            </td>
        </tr>
   </table>
   <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr><td width="20" style="vertical-align:top;padding:10px 0 0px 10px">
                        <img src="http://bamboo.asterisk.org/images/icons/businessman.gif" width="15" height="15">
                    </td>
                    <td width="100%" style="font-family: Arial, sans-serif; font-size: 13px; color:#000;vertical-align:top;padding:10px 10px 0px 10px">
                        <a href="http://bamboo.asterisk.org/browse/author/jpeeler" style="font-family: Arial, sans-serif; font-size: 13px; font-weight:bold; color:#000">
                           jpeeler</a><br>
                        Fix a deadlock in device state change processing.<br/>
<br/>
Copied from some notes from the original author (Russell):<br/>
<br/>
Deadlock scenario:<br/>
Thread 1: device state change thread<br/>
&nbsp;&nbsp;Holds - rdlock on contexts<br/>
&nbsp;&nbsp;Holds - hints lock<br/>
&nbsp;&nbsp;Waiting on channels container lock<br/>
<br/>
Thread 2: SIP monitor thread<br/>
&nbsp;&nbsp;Holds the &quot;iflock&quot;<br/>
&nbsp;&nbsp;Holds a sip_pvt lock<br/>
&nbsp;&nbsp;Holds channel container lock<br/>
&nbsp;&nbsp;Waiting for a channel lock<br/>
<br/>
Thread 3: A channel thread (chan_local in this case)<br/>
&nbsp;&nbsp;Holds 2 channel locks acquired within app_dial<br/>
&nbsp;&nbsp;Holds a 3rd channel lock it got inside of chan_local<br/>
&nbsp;&nbsp;Holds a local_pvt lock<br/>
&nbsp;&nbsp;Waiting on a rdlock of the contexts lock<br/>
<br/>
A bunch of other threads waiting on a wrlock of the contexts lock<br/>
<br/>
<br/>
To address this deadlock, some locking order rules must be put in place and<br/>
enforced. Existing relevant rules:<br/>
<br/>
1) channel lock before a pvt lock<br/>
2) contexts lock before hints lock<br/>
3) channels container before a channel<br/>
<br/>
What's missing is some enforcement of the order when you involve more than any<br/>
two. To fix this problem, I put in some code that ensures that (at least in the<br/>
code paths involved in this bug) the locks in (3) come before the locks in (2).<br/>
To change the operation of thread 1 to comply, I converted the storage of hints<br/>
to an astobj2 container. This allows processing of hints without holding the<br/>
hints container lock. So, in the code path that led to thread 1's state, it no<br/>
longer holds either the contexts or hints lock while it attempts to lock the<br/>
channels container.<br/>
<br/>
(closes issue #18165)<br/>
Reported by: antonio<br/>
<br/>
ABE-2583<br/>
<br/>

                    </td>
                    <td width="60" style="font-family: Arial, sans-serif; font-size: 13px; ;color:#036;vertical-align:top;padding:10px 10px 0px 10px">
                         (294384)
                    </td></tr>
    </table><br>
     
            <table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:#ecf1f7;border-top:1px solid #bbd0e5;border-bottom:1px solid #bbd0e5;color:#036;">
                <tr>
                    <td width="60%" style="font-family: Arial, sans-serif;text-align:left;font-size:16px;font-weight:bold;color:#036;vertical-align:top;padding:5px 10px">
                        <a href="http://bamboo.asterisk.org/browse/AST-1432-45/test" style="text-decoration: none; font-family: Arial, sans-serif;text-align:left;font-size:16px;font-weight:bold;color:#036" >Tests</a>
                    </td>
                    <td width="40%" style="font-family: Arial, sans-serif;text-align:right;font-size:13px;color:#036;padding:5px 10px">
                        <a href="http://bamboo.asterisk.org/browse/AST-1432-45/test" style="font-family: Arial, sans-serif; font-size: 13px;color:#036">See full test details</a><img src="http://bamboo.asterisk.org/images/icons/more.gif" width="15" height="15" style="vertical-align:middle;padding:2px">
                    </td>
                </tr>
            </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">


                    <tr>
                        <td colspan="2" width="100%" style="font-family: Arial, sans-serif; font-size: 13px; font-weight:bold; color:#000;vertical-align:top;padding:10px 0 0 10px">
                            Failed Tests (1)
                        </td>
                    </tr>
<tr>
<td width="20" style="vertical-align:top;padding:5px 0 5px 10px">
<img src="http://bamboo.asterisk.org/images/jt/icn_plan_failed.gif" width="15" height="15">
</td>
<td width="100%" style="font-family: Arial, sans-serif; font-size: 13px; color:#000;vertical-align:top;padding:5px 10px">
AsteriskTestSuite :
<a href="http://bamboo.asterisk.org/browse/AST-1432-45/test/case/3506254" style="font-family: Arial, sans-serif; font-size: 13px;color:#000">Manager/response-time</a>
<span style="color:#999">(Existing)</span>
</td>
</tr>            </table><br>


            <table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:#ecf1f7;border-top:1px solid #bbd0e5;border-bottom:1px solid #bbd0e5;color:#036;">
                <tr>
                    <td width="60%" style="font-family: Arial, sans-serif;text-align:left;font-size:16px;font-weight:bold;color:#036;padding:5px 10px">
                        <a href="http://bamboo.asterisk.org/browse/AST-1432-45/log" style="text-decoration: none; font-family: Arial, sans-serif;text-align:left;font-size:16px;font-weight:bold;color:#036" >Error Summary</a>
                    </td>
                    <td width="40%" style="font-family: Arial, sans-serif;text-align:right;font-size:13px;color:#036;padding:5px 10px">
                        <a href="http://bamboo.asterisk.org/browse/AST-1432-45/log" style="font-family: Arial, sans-serif; font-size: 13px;color:#036">See full build log</a>
                        <img src="http://bamboo.asterisk.org/images/icons/more.gif" width="15" height="15" style="vertical-align:middle;padding:2px">
                    </td>
                </tr>
            </table>

            <table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:#f2f2f2;border-top:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;color:#000;margin-top:5px;padding:10px">
               <tr>
                <td width="100%" style="font-family:'Courier New', Courier, monospace; font-size: 12px; color:#000;vertical-align:top">
                    [: 150: missing ]<br/>
                </td>
                </tr>
               <tr>
                <td width="100%" style="font-family:'Courier New', Courier, monospace; font-size: 12px; color:#000;vertical-align:top">
                    ./configure: line 6017: echo: write error: Broken pipe<br/>
                </td>
                </tr>
               <tr>
                <td width="100%" style="font-family:'Courier New', Courier, monospace; font-size: 12px; color:#000;vertical-align:top">
                    Package gtk+-2.0 was not found in the pkg-config search path.<br/>
                </td>
                </tr>
               <tr>
                <td width="100%" style="font-family:'Courier New', Courier, monospace; font-size: 12px; color:#000;vertical-align:top">
                    Perhaps you should add the directory containing `gtk+-2.0.pc'<br/>
                </td>
                </tr>
               <tr>
                <td width="100%" style="font-family:'Courier New', Courier, monospace; font-size: 12px; color:#000;vertical-align:top">
                    to the PKG_CONFIG_PATH environment variable<br/>
                </td>
                </tr>
               <tr>
                <td width="100%" style="font-family:'Courier New', Courier, monospace; font-size: 12px; color:#000;vertical-align:top">
                    No package 'gtk+-2.0' found<br/>
                </td>
                </tr>
               <tr>
                <td width="100%" style="font-family:'Courier New', Courier, monospace; font-size: 12px; color:#000;vertical-align:top">
                    Package gtk+-2.0 was not found in the pkg-config search path.<br/>
                </td>
                </tr>
               <tr>
                <td width="100%" style="font-family:'Courier New', Courier, monospace; font-size: 12px; color:#000;vertical-align:top">
                    Perhaps you should add the directory containing `gtk+-2.0.pc'<br/>
                </td>
                </tr>
               <tr>
                <td width="100%" style="font-family:'Courier New', Courier, monospace; font-size: 12px; color:#000;vertical-align:top">
                    to the PKG_CONFIG_PATH environment variable<br/>
                </td>
                </tr>
               <tr>
                <td width="100%" style="font-family:'Courier New', Courier, monospace; font-size: 12px; color:#000;vertical-align:top">
                    No package 'gtk+-2.0' found<br/>
                </td>
                </tr>
            </table>
            <br />

        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr><td colspan="2" align="center" style="font-family: Arial, sans-serif;text-align:center;font-size:11px;font-weight:bold;color:#999;vertical-align:top;padding:20px;padding-bottom:10px">
                Email generated by <a href="http://bamboo.asterisk.org" style="font-family: Arial, sans-serif; font-size: 11px; color:#999">Atlassian Bamboo</a> - if you wish to stop receiving these emails edit your  <a href="http://bamboo.asterisk.org/profile/userNotifications.action" style="font-family: Arial, sans-serif; font-size: 11px; color:#999">user profile</a> or <a href="http://bamboo.asterisk.org/viewAdministrators.action" style="font-family: Arial, sans-serif; font-size: 11px; color:#999">notify your administrator</a>
            </td>
            </tr>
            <tr><td colspan="2" align="center" style="font-family: Arial, sans-serif;text-align:center;font-size:11px;font-weight:bold;color:#999;vertical-align:top">
                <a href="http://www.atlassian.com/software/ideconnector/" style="font-family: Arial, sans-serif; font-size: 11px; color:#999">Want this information in your IDE?</a>
            </td></tr>
        </table>
    </td>
    <td width="150" style="vertical-align:top">
        <table width="150" border="0" cellpadding="0" cellspacing="0" style="background-color:#ecf1f7;border-top:1px solid #bbd0e5;border-bottom:1px solid #bbd0e5;color:#036;">
            <tr>
                <td style="font-family: Arial, sans-serif;text-align:left;font-size:16px;font-weight:bold;color:#036;vertical-align:top;padding:5px 10px">
                    Actions
                </td>
            </tr>
        </table>
        <table width="150" border="0" cellpadding="0" cellspacing="0" style="background-color:#f5f9fc;border-bottom:1px solid #bbd0e5;">
            <tr>
                <td style="font-family: Ariel, sans-serif; font-size: 13px; color:#036;vertical-align:top;padding:5px 10px;line-height:1.7">
                    <a href="http://bamboo.asterisk.org/browse/AST-1432-45/" style="font-family: Arial, sans-serif; font-size: 13px; color:#036">View Online</a>
                    <br>
                    <a href="http://bamboo.asterisk.org/browse/AST-1432-45/comment" style="font-family: Arial, sans-serif; font-size: 13px; color:#036">Add Comments</a>
                    <br>
                    <a href="http://bamboo.asterisk.org/browse/AST-1432-45/artifact" style="font-family: Arial, sans-serif; font-size: 13px; color:#036">View Artifacts</a>
                    <br>
                    <a href="http://bamboo.asterisk.org/download/AST-1432/build_logs/AST-1432-45.log" style="font-family: Arial, sans-serif; font-size: 13px; color:#036">Download Logs</a>
                    <br>
                </td>
            </tr>
        </table>
    </td>
<tr>
</table>
</font>
</div>