[Asterisk-code-review] astobj2: Prevent potential deadlocks with ao2 global obj rel... (asterisk[master])
Sean Bright
asteriskteam at digium.com
Thu Mar 30 12:59:28 CDT 2017
Hello Richard Mudgett, Anonymous Coward #1000019,
I'd like you to reexamine a change. Please visit
https://gerrit.asterisk.org/5363
to look at the new patch set (#4).
Change subject: astobj2: Prevent potential deadlocks with ao2_global_obj_release
......................................................................
astobj2: Prevent potential deadlocks with ao2_global_obj_release
The ao2_global_obj_release() function holds an exclusive lock on the
global object while it is being dereferenced. Any destructors that
run during this time that call ao2_global_obj_ref() will deadlock
because a read lock is required.
Instead, we make the global object inaccessible inside of the write
lock and only dereference it once we have released the lock. This
allows the affected destructors to fail gracefully.
While this doesn't completely solve the referenced issue (the error
message about not being able to create an IQ continues to be shown)
it does solve the backtrace spew that accompanied it.
ASTERISK-21009 #close
Reported by: Marcello Ceschia
Change-Id: Idf40ae136b5070dba22cb576ea8414fbc9939385
---
M include/asterisk/astobj2.h
M main/astobj2.c
2 files changed, 2 insertions(+), 28 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/63/5363/4
--
To view, visit https://gerrit.asterisk.org/5363
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Idf40ae136b5070dba22cb576ea8414fbc9939385
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
More information about the asterisk-code-review
mailing list