Skip to content
Snippets Groups Projects
  • Sean Bright's avatar
    c9648f46
    astobj2: Prevent potential deadlocks with ao2_global_obj_release · c9648f46
    Sean Bright authored
    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
    c9648f46
    History
    astobj2: Prevent potential deadlocks with ao2_global_obj_release
    Sean Bright authored
    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