[asterisk-bugs] [Asterisk 0012664]: [patch] MWI messages using MD message mutex and conditions

noreply at bugs.digium.com noreply at bugs.digium.com
Mon May 19 11:47:34 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12664 
====================================================================== 
Reported By:                tomo1657
Assigned To:                file
====================================================================== 
Project:                    Asterisk
Issue ID:                   12664
Category:                   Resources/res_smdi
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 116349 
Disclaimer on File?:        N/A 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             05-15-2008 13:47 CDT
Last Modified:              05-19-2008 11:47 CDT
====================================================================== 
Summary:                    [patch] MWI messages using MD message mutex and
conditions
Description: 
There are mutex and condition vars for each SMDI message type: MD and MWI.
iface->md_q_lock
iface->md_q_cond
iface->mwi_q_lock
iface->mwi_q_cond

The function ast_cond_timedwait() is called from both functions
ast_smdi_md_message() and ast_smdi_mwi_message(), but it uses md_q_lock and
md_q_cond for both types of SMDI messages.

This results in lock.h failing to wait on the condition and mutex and
floods the console with warning messages whenever ast_smdi_mwi_message() is
called:

lock.h:648 __ast_cond_timedwait: res_smdi.c line 443
(smdi_message_wait): mutex '&iface->md_q_lock' freed more times than
we've locked!
lock.h:665 __ast_cond_timedwait: res_smdi.c line 443
(smdi_message_wait): Error waiting on condition mutex 'Operation not
permitted'

This would also mean that the MWI mutex is not being used.

The fix is to make sure ast_cond_timedwait() use the correct variables
when calling ast_cond_timedwait().
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 05-19-08 11:47  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 117136

_U  trunk/
U   trunk/res/res_smdi.c

------------------------------------------------------------------------
r117136 | file | 2008-05-19 11:47:32 -0500 (Mon, 19 May 2008) | 14 lines

Merged revisions 117135 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r117135 | file | 2008-05-19 13:50:52 -0300 (Mon, 19 May 2008) | 6 lines

Use the right pthread lock and condition when waiting.
(closes issue http://bugs.digium.com/view.php?id=12664)
Reported by: tomo1657
Patches:
      res_smdi.c.patch uploaded by tomo1657 (license 484)

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=117136 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
05-19-08 11:47  svnbot         Checkin                                      
05-19-08 11:47  svnbot         Note Added: 0087021                          
======================================================================




More information about the asterisk-bugs mailing list