[asterisk-bugs] [Zaptel 0010806]: Channel opening and unregistering race

noreply at bugs.digium.com noreply at bugs.digium.com
Sat Sep 29 23:10:24 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10806 
====================================================================== 
Reported By:                Matti
Assigned To:                
====================================================================== 
Project:                    Zaptel
Issue ID:                   10806
Category:                   zaptel (the module)
Reproducibility:            sometimes
Severity:                   crash
Priority:                   normal
Status:                     new
Zaptel Version:              SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 3052 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             09-23-2007 03:45 CDT
Last Modified:              09-29-2007 23:10 CDT
====================================================================== 
Summary:                    Channel opening and unregistering race
Description: 
Function zt_specchan_open can have a race condition with zt_chan_unreg
resulting in crashing of the program (Asterisk) or the whole computer
during the opening of a Zap device file.
====================================================================== 

---------------------------------------------------------------------- 
 Matti - 09-29-07 23:10  
---------------------------------------------------------------------- 
The main reason for a semaphore is that a zt_register_hdlc_device function
call can sleep while a Zaptel driver might unregister the channel, which
might lead to a crash. It is also generally recommended to use a semaphore
instead of a spinlock when only process context threads need to lock for
realtime latency reasons.

Getting a channels' lock is needed for checking spans[j] because a driver
might unregister the span after checking spans[j]. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-29-07 23:10  Matti          Note Added: 0071210                          
======================================================================




More information about the asterisk-bugs mailing list