[asterisk-dev] [Code Review] [17949] Error that mutex 'dialog' has been free'd more than it's been locked in add_header_max_forwards

Russell Bryant russell at digium.com
Thu Nov 4 07:03:39 CDT 2010




----- Original Message -----
> > On 2010-11-03 16:35:22, Russell Bryant wrote:
> > > It would be good to add a comment to add_header_max_forwards()
> > > that documents the assumption about the sip_pvt lock being held
> > > before the function is called.
> > >
> > > Also, add some info to the "testing done" section of this review.
> > > I would suggest starting with just making some basic calls. From
> > > there, try running the Asterisk test suite to make sure the tests
> > > using SIP pass before and after the patch (or at least fail in the
> > > same way if something goes wrong ...). Be aware, though, that the
> > > test suite will wipe out your configuration, so back up your
> > > configs before you try to run it.
> 
> I think we should revisit my original design. We could get the value
> of the channel variable earlier, when we set up the channel instead of
> reading the channel variable for each message. We only need to get it
> once from the dialplan, when we start the dial.

That's a good idea, I think.  Trying to figure out this locking problem in all of the different code paths that lead to this function turned out to be much more complicated than I first expected.

I suppose the variable could be retrieved in sip_call() and saved on the sip_pvt.  That should do the trick and greatly simplify this situation!

--
Russell Bryant
Digium, Inc.  |  Engineering Manager, Open Source Software
445 Jan Davis Drive NW   -    Huntsville, AL 35806  -  USA
jabber: rbryant at digium.com    -=-    skype: russell-bryant
www.digium.com -=- www.asterisk.org -=- blogs.asterisk.org



More information about the asterisk-dev mailing list