[asterisk-bugs] [Asterisk 0013009]: [patch] dynamic thread identifiers may be duplicated
noreply at bugs.digium.com
noreply at bugs.digium.com
Mon Jul 7 11:41:40 CDT 2008
A NOTE has been added to this issue.
======================================================================
http://bugs.digium.com/view.php?id=13009
======================================================================
Reported By: jpgrayson
Assigned To:
======================================================================
Project: Asterisk
Issue ID: 13009
Category: Channels/chan_iax2
Reproducibility: always
Severity: minor
Priority: normal
Status: new
Asterisk Version: SVN
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Disclaimer on File?: N/A
Request Review:
======================================================================
Date Submitted: 07-07-2008 10:58 CDT
Last Modified: 07-07-2008 11:41 CDT
======================================================================
Summary: [patch] dynamic thread identifiers may be duplicated
Description:
Currently in chan_iax2, the way that identifiers for dynamic threads
"threadnum" are assigned leads to cases where multiple co-existing threads
may have the same identifier.
When a dynamic thread is created, its threadnum identifier is set to the
global iaxdynamicthreadcount state. This iaxdynamicthreadcount is simply
the count of currently existing dynamic threads. Using
iaxdynamicthreadcount to assign threadnum provides no guarantee that each
thread will have a unique thread number.
It is actually possible to have the case where there are, for example, two
dynamic threads with threadnum => 6, four threads with dynamic threadnum =>
3, etc.
This problem does not yield any functional deficiencies, but it does
adversely impact debugging threads. It reduces the amount of information
provided by "iax2 show threads".
======================================================================
----------------------------------------------------------------------
jpgrayson - 07-07-08 11:41
----------------------------------------------------------------------
The new iaxdynamicthreadnum variable is implicitly protected by having the
dynamic_list lock. There is no actual chance of two threads manipulating
iaxdynamicthreadnum at the same time.
Also, iaxdynamicthreadcount similarly relies on the implicit serialization
from the dynamic_list lock. I would just assume leave both of these
variables alone. Otherwise I guess we'd really want to use
ast_atomic_fetchadd() for both.
Issue History
Date Modified Username Field Change
======================================================================
07-07-08 11:41 jpgrayson Note Added: 0089835
======================================================================
More information about the asterisk-bugs
mailing list