[asterisk-dev] Another *8 deadlock :(

Steve Davies davies147 at gmail.com
Thu Jun 2 15:42:28 CDT 2011


On 2 June 2011 21:06, Alec Davis <sivad.a at paradise.net.nz> wrote:
>> -----Original Message-----
>> From: asterisk-dev-bounces at lists.digium.com
>> [mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of
>> Steve Davies
>> Sent: Friday, 3 June 2011 6:26 a.m.
>> To: Asterisk Developers Mailing List
>> Subject: Re: [asterisk-dev] Another *8 deadlock :(
>>
>> On 2 June 2011 17:43, Gregory Nietsky <gregnietsky at gmail.com> wrote:
>> >
>> > Steve found this serves me well ....
>> >
>> >
>> >
>> >
>> > Index: main/channel.c
>> > ===================================================================
>> > --- main/channel.c      (.../trunk)     (revision 321557)
>> > +++ main/channel.c      (.../team/irroot/distrotech-customers-trunk)
>> >  (revision 321557)
>> > @@ -6493,8 +6501,12 @@
>> >         */
>> >        ao2_lock(channels);
>> >
>> > -       /* lock the original channel to determine if the
>> masquerade is
>> > require or not */
>> > -       ast_channel_lock(original);
>> > +       /* lock the original channel with deadlock avoidance to
>> > + determine if
>> > the masquerade is require or not */
>> > +       while (ast_channel_trylock(original)) {
>> > +               ao2_unlock(channels);
>> > +               usleep(1);
>> > +               ao2_lock(channels);
>> > +       }
>>
>>
>> That looks like a 1.8 upwards patch as you are ao2 locking
>> channels, but a solution for pre-1.8 cannot do that as
>> channels and the channel list are not ao2 objects (or are they?)
>>
>> I am considering scheduling the channel destruction for after
>> the masquerade as an alternative to risky unlock and re-lock blocks.
>>
>
> What is the test rig senario you use.
>
> I can get it to deadlock every time, with 1.6.2svn when 2 SIP channels try
> to pickup the same ringing extension.
>
> As 1.6.2 isn't yet closed, soon though, I'd suggest opening a bug report
> anyway. This will then put all of these directerd pickup bugs to bed.
>

We simply have a script placing calls to virtual (pjsua) SIP endpoints
so we repeatedly make calls that ring for 5 seconds, then are answered
for 10 seconds. No more than about 20 calls at a time - We just do
this so that we have a constant list of ringing calls available.

Dialling *8 a number of times soon causes a deadlock. We've also seen
it with one inbound call to a queue in Ringall mode to 5 handsets. A
single *8 killed everything.

You say "1.6.2 isn't yet closed" yet a number of 1.6.2 issues were
recently closed as "works okay in 1.8, so won't fix in 1.6.2". I will
open a ticket tomorrow with a couple of proposed patches; You never
know your luck :)

Regards,
Steve



More information about the asterisk-dev mailing list