[Asterisk-code-review] res xmpp: Prevent deadlock on module unload (asterisk[13])
Sean Bright
asteriskteam at digium.com
Thu Mar 30 08:47:24 CDT 2017
Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/5361 )
Change subject: res_xmpp: Prevent deadlock on module unload
......................................................................
Patch Set 1:
> > > It would be better to fix the global obj to release the obj ref
> > > outside of the global rwlock in astobj2.c. There are a couple
> > > other global obj functions that may do the same thing.
> >
> > The only thing that ao2_global_obj_release() does is grab the
> lock,
> > deref the object, and unlock. Short of just removing the lock, I
> > don't know how I would "fix" it.
>
> I was thinking you would simply need to defer unreffing the object
> until after the lock was released to fix this deadlock problem.
OK, so I grab the write lock, copy the holder->obj pointer, NULL out the holder->obj pointer, unlock and then deref the saved pointer.
What happens when the destructors call ao2_global_obj_ref()?
--
To view, visit https://gerrit.asterisk.org/5361
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Idf40ae136b5070dba22cb576ea8414fbc9939385
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-HasComments: No
More information about the asterisk-code-review
mailing list