[Home]

Summary:ASTERISK-14119: [patch] ast_channel_free might double unlock channels lock
Reporter:Tim Ringenbach at Asteria Solutions Group (tim_ringenbach)Labels:
Date Opened:2009-05-13 12:54:02Date Closed:2009-05-13 14:51:15
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) remove_extra_unlock.diff
Description:ast_channel_free() might unlock the channels lock twice, once in the "if (!AST_LIST_REMOVE(&channels, chan, chan_list))" block and once more at the end.

I haven't actually run into this happening in the wild (that I know of anyway), I just noticed it in the code.
Comments:By: Digium Subversion (svnbot) 2009-05-13 14:41:50

Repository: asterisk
Revision: 194356

U   branches/1.4/main/channel.c

------------------------------------------------------------------------
r194356 | mmichelson | 2009-05-13 14:41:49 -0500 (Wed, 13 May 2009) | 13 lines

Remove an extraneous unlocking operation from ast_channel_free.

In the case that we could not remove the desired channel from the
list of channels, there was an extra call to unlock the channel list.
Since we unlock the list later on in the function anyway, this results
in the list being unlocked twice yet only being locked once.

(closes issue ASTERISK-14119)
Reported by: tim_ringenbach
Patches:
     remove_extra_unlock.diff uploaded by tim (license 540)


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

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

By: Digium Subversion (svnbot) 2009-05-13 14:42:57

Repository: asterisk
Revision: 194357

_U  trunk/

------------------------------------------------------------------------
r194357 | mmichelson | 2009-05-13 14:42:57 -0500 (Wed, 13 May 2009) | 18 lines

Blocked revisions 194356 via svnmerge

........
 r194356 | mmichelson | 2009-05-13 14:41:44 -0500 (Wed, 13 May 2009) | 13 lines
 
 Remove an extraneous unlocking operation from ast_channel_free.
 
 In the case that we could not remove the desired channel from the
 list of channels, there was an extra call to unlock the channel list.
 Since we unlock the list later on in the function anyway, this results
 in the list being unlocked twice yet only being locked once.
 
 (closes issue ASTERISK-14119)
 Reported by: tim_ringenbach
 Patches:
       remove_extra_unlock.diff uploaded by tim (license 540)
........

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

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

By: Digium Subversion (svnbot) 2009-05-13 14:50:10

Repository: asterisk
Revision: 194358

_U  branches/1.6.0/
U   branches/1.6.0/main/channel.c

------------------------------------------------------------------------
r194358 | mmichelson | 2009-05-13 14:50:10 -0500 (Wed, 13 May 2009) | 25 lines

Recorded merge of revisions 194357 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r194357 | mmichelson | 2009-05-13 14:42:51 -0500 (Wed, 13 May 2009) | 18 lines
 
 Blocked revisions 194356 via svnmerge
 
 ........
   r194356 | mmichelson | 2009-05-13 14:41:44 -0500 (Wed, 13 May 2009) | 13 lines
   
   Remove an extraneous unlocking operation from ast_channel_free.
   
   In the case that we could not remove the desired channel from the
   list of channels, there was an extra call to unlock the channel list.
   Since we unlock the list later on in the function anyway, this results
   in the list being unlocked twice yet only being locked once.
   
   (closes issue ASTERISK-14119)
   Reported by: tim_ringenbach
   Patches:
         remove_extra_unlock.diff uploaded by tim (license 540)
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-05-13 14:50:43

Repository: asterisk
Revision: 194359

_U  branches/1.6.1/
U   branches/1.6.1/main/channel.c

------------------------------------------------------------------------
r194359 | mmichelson | 2009-05-13 14:50:43 -0500 (Wed, 13 May 2009) | 25 lines

Recorded merge of revisions 194357 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r194357 | mmichelson | 2009-05-13 14:42:51 -0500 (Wed, 13 May 2009) | 18 lines
 
 Blocked revisions 194356 via svnmerge
 
 ........
   r194356 | mmichelson | 2009-05-13 14:41:44 -0500 (Wed, 13 May 2009) | 13 lines
   
   Remove an extraneous unlocking operation from ast_channel_free.
   
   In the case that we could not remove the desired channel from the
   list of channels, there was an extra call to unlock the channel list.
   Since we unlock the list later on in the function anyway, this results
   in the list being unlocked twice yet only being locked once.
   
   (closes issue ASTERISK-14119)
   Reported by: tim_ringenbach
   Patches:
         remove_extra_unlock.diff uploaded by tim (license 540)
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-05-13 14:51:14

Repository: asterisk
Revision: 194360

_U  branches/1.6.2/
U   branches/1.6.2/main/channel.c

------------------------------------------------------------------------
r194360 | mmichelson | 2009-05-13 14:51:14 -0500 (Wed, 13 May 2009) | 25 lines

Recorded merge of revisions 194357 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r194357 | mmichelson | 2009-05-13 14:42:51 -0500 (Wed, 13 May 2009) | 18 lines
 
 Blocked revisions 194356 via svnmerge
 
 ........
   r194356 | mmichelson | 2009-05-13 14:41:44 -0500 (Wed, 13 May 2009) | 13 lines
   
   Remove an extraneous unlocking operation from ast_channel_free.
   
   In the case that we could not remove the desired channel from the
   list of channels, there was an extra call to unlock the channel list.
   Since we unlock the list later on in the function anyway, this results
   in the list being unlocked twice yet only being locked once.
   
   (closes issue ASTERISK-14119)
   Reported by: tim_ringenbach
   Patches:
         remove_extra_unlock.diff uploaded by tim (license 540)
 ........
................

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

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