[asterisk-bugs] [Asterisk 0018310]: [patch] hint state changes deadlock/race

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Jan 6 17:12:04 UTC 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18310 
====================================================================== 
Reported By:                one47
Assigned To:                jpeeler
====================================================================== 
Project:                    Asterisk
Issue ID:                   18310
Category:                   Core/PBX
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     ready for testing
Target Version:             1.6.2.17
Asterisk Version:           1.6.2.14 
JIRA:                       SWP-2541 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-11-15 12:19 CST
Last Modified:              2011-01-06 11:12 CST
====================================================================== 
Summary:                    [patch] hint state changes deadlock/race
Description: 
VERY similar to https://issues.asterisk.org/view.php?id=18165, but this is a
different deadlock path, so I have
raised a separate report.

Thread 1: taskprocessor  -> handle_statechange
    Lock order = conlock, hints, hint, pvt
Thread 2: chan_sip.c:  handle_request_do -> handle_response_notify
    Lock order = pvt, conlock

Thread2 only gets into the conlock if STATECHANGEQUEUE is true, ie. there
are rapid state changes happening on a subscribed hint.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0018165 [patch] hint state changes deadlock pro...
has duplicate       0018535 app_queue deadlocks if weight is set
====================================================================== 

---------------------------------------------------------------------- 
 (0130264) one47 (reporter) - 2011-01-06 11:12
 https://issues.asterisk.org/view.php?id=18310#c130264 
---------------------------------------------------------------------- 
I have updated jpeeler's patch, and will attach it in a moment. It makes
the following changes, which now compile, run, and do not crash or deadlock
here (yet)

1) find_hint_by_cb_id() - Do not use OBJ_NODATA in the ao2_find call or
NULL is always returned. This results in old callbacks never being deleted,
and invalid pointers soon get referenced.

2) ast_merge_contexts_and_delete() - The callbacks are temporarily moved
into a state_list, and then restored to the hints. The patch as provided
copied instead of moving, and also left a free() of an ao2 object in the
code. The updated patch is my attempt to fix this - Hope it looks right!

I will leave it soaking under high load overnight. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-06 11:12 one47          Note Added: 0130264                          
======================================================================




More information about the asterisk-bugs mailing list