[asterisk-bugs] [Asterisk 0010392]: [Patch] Incorrect logic when creating and queuing dynamic threads in socket_read() and iax2_process_thread()

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Aug 6 15:26:38 CDT 2007


The following issue has been ASSIGNED. 
====================================================================== 
http://bugs.digium.com/view.php?id=10392 
====================================================================== 
Reported By:                mihai
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   10392
Category:                   Channels/chan_iax2
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     assigned
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 78227 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             08-06-2007 15:03 CDT
Last Modified:              08-06-2007 15:26 CDT
====================================================================== 
Summary:                    [Patch] Incorrect logic when creating and queuing
dynamic threads in socket_read() and iax2_process_thread()
Description: 
Consider the situation where socket_read() calls find_idle_thread() and
creates a new dynamic thread. If there is an error condition or if there is
a thread already processing a full frame for the current call, the current
thread gets put back into the dynamic thread list by a call to
insert_idle_thread().  However, with the current code, the thread will
conditionally wait on a signal which, in this case, will never come, so the
thread will timeout.  Since the thread was never used, put_into_idle is 0,
so the thread will exit its for loop and destroy itself without removing
its dynamic_list entry.  We end up with entries in dynamic_list that have
no corresponding thread and this situation can lead to crashes. 
The proposed patch changes socket_read and iax2_process_thread so that
insertion into dynamic_list queue happens only in the thread itself. We use
the thread->iostate == IAX_IOSTATE_IDLE to notify the thread to insert
itself into the list. 
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 08-06-07 15:26  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 78242

------------------------------------------------------------------------
r78242 | russell | 2007-08-06 15:26:36 -0500 (Mon, 06 Aug 2007) | 4 lines

Fix an issue where dynamic threads can get free'd, but still exist in the 
dynamic thread list.
(closes issue http://bugs.digium.com/view.php?id=10392, patch from Mihai, with
credit to his colleague,
Pete)

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

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-06-07 15:26  svnbot         Checkin                                      
08-06-07 15:26  svnbot         Note Added: 0068517                          
08-06-07 15:26  svnbot         Status                   new => assigned     
08-06-07 15:26  svnbot         Assigned To               => russell         
======================================================================




More information about the asterisk-bugs mailing list