[Home]

Summary:ASTERISK-12029: [patch] MWI messages using MD message mutex and conditions
Reporter:Tomo Takebe (tomo1657)Labels:
Date Opened:2008-05-15 13:47:46Date Closed:2008-05-19 11:52:06
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_smdi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) res_smdi.c.patch
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().
Comments:By: Digium Subversion (svnbot) 2008-05-19 11:44:56

Repository: asterisk
Revision: 117135

U   branches/1.4/res/res_smdi.c

------------------------------------------------------------------------
r117135 | file | 2008-05-19 11:44:55 -0500 (Mon, 19 May 2008) | 6 lines

Use the right pthread lock and condition when waiting.
(closes issue ASTERISK-12029)
Reported by: tomo1657
Patches:
     res_smdi.c.patch uploaded by tomo1657 (license 484)

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

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

By: Digium Subversion (svnbot) 2008-05-19 11:47:33

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 ASTERISK-12029)
Reported by: tomo1657
Patches:
     res_smdi.c.patch uploaded by tomo1657 (license 484)

........

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

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

By: Digium Subversion (svnbot) 2008-05-19 11:52:06

Repository: asterisk
Revision: 117137

_U  branches/1.6.0/
U   branches/1.6.0/res/res_smdi.c

------------------------------------------------------------------------
r117137 | file | 2008-05-19 11:52:06 -0500 (Mon, 19 May 2008) | 22 lines

Merged revisions 117136 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r117136 | file | 2008-05-19 13:53:33 -0300 (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 ASTERISK-12029)
Reported by: tomo1657
Patches:
     res_smdi.c.patch uploaded by tomo1657 (license 484)

........

................

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

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