[asterisk-bugs] [Asterisk 0013380]: [patch] pthread_cancel segmentation faults

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Aug 28 10:55:05 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13380 
====================================================================== 
Reported By:                Matti
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13380
Category:                   Channels/chan_h323
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.2.X 
SVN Branch (only for SVN checkouts, not tarball releases):  1.2  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-08-27 01:20 CDT
Last Modified:              2008-08-28 10:55 CDT
====================================================================== 
Summary:                    [patch] pthread_cancel segmentation faults
Description: 
pthread_cancel segmentation faults when the bind address in h323.conf is
not configured in Linux. A detached thread must not be cancelled.
====================================================================== 

---------------------------------------------------------------------- 
 (0091869) Corydon76 (administrator) - 2008-08-28 10:55
 http://bugs.digium.com/view.php?id=13380#c91869 
---------------------------------------------------------------------- 
Matti:  I can find no support whatsoever in the documentation that supports
your contention that we cannot cancel a detached thread.  The only
restriction on a detached thread is that it cannot be joined.

The patch I proposed only prevents the code from running when the value
passed in is the value AST_PTHREADT_NULL, which is what your backtrace
shows is the value that the module is trying to cancel.  My analysis is
that this could only happen if the "if" conditional failed to exclude the
value AST_PTHREADT_NULL, which is likely only because the compiler decided
that comparing a negative constant to an unsigned type was a non-starter. 
So by using a function to do the comparison, we can prevent the compiler
from overriding the (intentional) underflow. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-08-28 10:55 Corydon76      Note Added: 0091869                          
======================================================================




More information about the asterisk-bugs mailing list