[asterisk-dev] Another *8 deadlock :(

Alec Davis sivad.a at paradise.net.nz
Thu Jun 2 15:06:40 CDT 2011


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.

Alec Davis


> -----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.
> 
> Regards,
> Steve
> 
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list