]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Convert device state callbacks to ao2 objects to fix a deadlock in chan_sip.
authorJeff Peeler <jpeeler@digium.com>
Tue, 18 Jan 2011 20:13:52 +0000 (20:13 +0000)
committerJeff Peeler <jpeeler@digium.com>
Tue, 18 Jan 2011 20:13:52 +0000 (20:13 +0000)
commit7ca6a0e2bd1b1621e8526d37ba2472548b23d9f1
tree7b71bc7cda4f769acdd70636e89261bdb09a0cc9
parentf78288c30b69a56f248e2aa2595b95ab1f8f0184
Convert device state callbacks to ao2 objects to fix a deadlock in chan_sip.

Lock scenario presented here:
Thread 1
 holds ast_rdlock_contexts &conlock
 holds handle_statechange hints
 holds handle_statechange hint
  waiting for cb_extensionstate
   Locked Here: chan_sip.c line 7428 (find_call)
Thread 2
 holds handle_request_do &netlock
 holds find_call sip_pvt_ptr
  waiting for ast_rdlock_contexts &conlock
   Locked Here: pbx.c line 9911 (ast_rdlock_contexts)

Chan_sip has an established locking order of locking the sip_pvt and then
getting the context lock. So the as stated by the summary, the operations in
thread 2 have been modified to no longer require the context lock.

(closes issue #18310)
Reported by: one47
Patches:
      statecbs_ao2.mk2.patch uploaded by one47 (license 23),
      modified by me

Review: https://reviewboard.asterisk.org/r/1072/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@302265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/pbx.c