[asterisk-bugs] [Asterisk 0015213]: [patch] asterisk lock in sipsock_read for several seconds and drop sip packets

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jun 22 09:36:27 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15213 
====================================================================== 
Reported By:                schmidts
Assigned To:                mmichelson
====================================================================== 
Project:                    Asterisk
Issue ID:                   15213
Category:                   Channels/chan_sip/General
Reproducibility:            random
Severity:                   block
Priority:                   normal
Status:                     closed
Asterisk Version:           1.4.25 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-05-28 09:47 CDT
Last Modified:              2009-06-22 09:36 CDT
====================================================================== 
Summary:                    [patch] asterisk lock in sipsock_read for several
seconds and drop sip packets
Description: 
i have around 1600 sip peers registered on this server with 2 sip trunks to
other asterisk server and after upgrading to 1.4 from 1.2 i had this
problem that the asterisk freeze for several seconds and drop all sip
packets.

with netstat -su i see that the amount of packet receive errors increase
by 800 pps while asterisk locks.

normal callflow actions like mysql and so on runs without any problem and
also active calls are not disconnected but new calls cant be opened.

i ve compiled with debug thread and dont optimize and see with core show
lock these lock helds:

=======================================================================
=== Currently Held Locks ==============================================
=======================================================================
===
=== <file> <line num> <function> <lock name> <lock addr> (times locked)
===
=== Thread ID: 1092675920 (do_monitor           started at [16595]
chan_sip.c restart_monitor())
=== ---> Lock https://issues.asterisk.org/view.php?id=0 (chan_sip.c): MUTEX
16264 sipsock_read &netlock
0x7f6d0e9d0700 (1)
=== -------------------------------------------------------------------
===
=======================================================================

and when it run again it show this: 

=======================================================================
=== Currently Held Locks ==============================================
=======================================================================
===
=== <file> <line num> <function> <lock name> <lock addr> (times locked)
===
=== Thread ID: 1092675920 (do_monitor           started at [16595]
chan_sip.c restart_monitor())
=== ---> Lock https://issues.asterisk.org/view.php?id=0 (chan_sip.c): MUTEX
16264 sipsock_read &netlock
0x7f6d0e9d0700 (1)
=== ---> Lock https://issues.asterisk.org/view.php?id=1 (chan_sip.c): MUTEX 4728
find_call &p->lock 0x374ffd0
(1)
=== ---> Lock https://issues.asterisk.org/view.php?id=2 (sched.c): MUTEX 220
ast_sched_add_variable &con->lock
0x1b2eee0 (1)
=== -------------------------------------------------------------------
===
=======================================================================

the system is a HP proliant DL 380 G5 2xXeon 2,3 Ghz with 6 GB Ram
OS: Debian Lenny v. 5.0.1 AMD 64 Bit Kernel 2.6.26-1
Asterisk version: 1.4.25
zaptel 1.4.12.1 is only need for meetme cause there is no isdn hardware in
this server.
libpri 1.4.10

i´ve allready tried to increase the linux udp buffer but without sucess.

======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0015345 [patch] SIP deadlock in 1.4 revision 19...
====================================================================== 

---------------------------------------------------------------------- 
 (0106806) svnbot (reporter) - 2009-06-22 09:36
 https://issues.asterisk.org/view.php?id=15213#c106806 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 202340

_U  branches/1.6.2/
U   branches/1.6.2/channels/chan_sip.c

------------------------------------------------------------------------
r202340 | mmichelson | 2009-06-22 09:36:26 -0500 (Mon, 22 Jun 2009) | 38
lines

Merged revisions 202337 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r202337 | mmichelson | 2009-06-22 09:35:09 -0500 (Mon, 22 Jun 2009) | 31
lines
  
  Merged revisions 202336 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r202336 | mmichelson | 2009-06-22 09:34:05 -0500 (Mon, 22 Jun 2009) |
25 lines
    
    Fix a possible infinite loop in SDP parsing during glare situation.
    
    There was a while loop in get_ip_and_port_from_sdp which was
controlled
    by a call to get_sdp_iterate. The loop would exit either if what we
were
    searching for was found or if the return was NULL. The problem is that
    get_sdp_iterate never returns NULL. This means that if what we were
searching
    for was not present, the loop would run infinitely. This modification
of the
    loop fixes the problem.
    
    (closes issue https://issues.asterisk.org/view.php?id=15213)
    Reported by: schmidts
    
    (closes issue https://issues.asterisk.org/view.php?id=15349)
    Reported by: samy
    
    (closes issue https://issues.asterisk.org/view.php?id=14464)
    Reported by: pj
    
    (closes issue https://issues.asterisk.org/view.php?id=15345)
    Reported by: aragon
    Patches:
          sip_inf_loop.patch uploaded by mmichelson (license 60)
    Tested by: aragon
  ........
................

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

http://svn.digium.com/view/asterisk?view=rev&revision=202340 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-06-22 09:36 svnbot         Checkin                                      
2009-06-22 09:36 svnbot         Note Added: 0106806                          
======================================================================




More information about the asterisk-bugs mailing list