[asterisk-bugs] [Asterisk 0017255]: [patch] UDP ports not freed/ports leaking

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Feb 7 14:02:15 CST 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17255 
====================================================================== 
Reported By:                kvveltho
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17255
Category:                   Core/General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.6.2.7-rc2 
JIRA:                       SWP-1410 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-04-28 06:23 CDT
Last Modified:              2011-02-07 14:02 CST
====================================================================== 
Summary:                    [patch] UDP ports not freed/ports leaking
Description: 
The following is not fixed:

These release candidates resolve an issue with UDP ports not being freed,
per
issue https://issues.asterisk.org/view.php?id=16774
(https://issues.asterisk.org/view.php?id=16774)

======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0016774 [patch] [regression] 1.6.1.13 and 1.6.1...
related to          0018121 Early bind of UDPTL ports can create a ...
====================================================================== 

---------------------------------------------------------------------- 
 (0131604) rgagnon (reporter) - 2011-02-07 14:02
 https://issues.asterisk.org/view.php?id=17255#c131604 
---------------------------------------------------------------------- 
I think this is completely related to realtime (obviously)... I am working
on setting up a realtime environment so I can replicate this, but in the
meantime, I did find a line of code in sip_destroy_peer() that should
probably be changed.  This function is called whenever peer's are destroyed
(as in realtime operation), and it affects the reference counter on the
peer's related call (which is where you are crashing).

If you want to test before I get it my tests up and running, here's what
you can change (without me posting a patch that might not solve it
completely):

After applying the 1.6.2 patch to your 1.6.2.16.1 tarball, edit
chan_sip.c.

At line 4726 (inside sip_destroy_peer), you should see:
   /* Delete it, it needs to disappear */
   if (peer->call) {
      dialog_unlink_all(peer->call, TRUE, TRUE);
      peer->call = dialog_unref(peer->call, "peer->call is being unset");
   }

Change the order of the two lines in the if-statement to be:
   /* Delete it, it needs to disappear */
   if (peer->call) {
      dialog_unref(peer->call, "peer->call is being unset");
      peer->call = dialog_unlink_all(peer->call, TRUE, TRUE);
   }

I cannot say for certain this is 100% your issue, but I've had problems
that caused core dumps in two other areas with this same pattern of code. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-02-07 14:02 rgagnon        Note Added: 0131604                          
======================================================================




More information about the asterisk-bugs mailing list