[OpenSIPS-Devel] [ opensips-Bugs-3568872 ] Crash on force_tcp_conn_lifetime

SourceForge.net noreply at sourceforge.net
Wed Sep 19 10:20:36 CEST 2012


Bugs item #3568872, was opened at 2012-09-18 04:09
Message generated for change (Comment added) made by saghul
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3568872&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: 1.8.x
Status: Open
Resolution: None
Priority: 9
Private: No
Submitted By: saghul (saghul)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: Crash on force_tcp_conn_lifetime

Initial Comment:
After the patch proposed on issue #3546167 we are experiencing crashes with the following backtrace:

Program terminated with signal 11, Segmentation fault.
#0  force_tcp_conn_lifetime (rcv=0x8d1a814, timeout=3610) at tcp_main.c:1180
1180	tcp_main.c: No such file or directory.
	in tcp_main.c
(gdb) bt full
#0  force_tcp_conn_lifetime (rcv=0x8d1a814, timeout=3610) at tcp_main.c:1180
        con = 0x0
        lifetime = 18146
#1  0xb70f5bc4 in update_contacts (_m=0x8d1a720, forced_binding=0x0, _d=0xaf4f3538 "\370\064O\257", _f=0x0, _s=0x0) at save.c:645
        ci = <value optimized out>
        e_max = <value optimized out>
        tcp_check = 1
...

Apparently the connection is not found in the connections hash. Unfortunately I'm not all that familiar with that part of the code to provide a patch. What I did notice though is that all functions which operate on the connections hash hold a lock and this one doesn't. Could that explain this?

Thanks,


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

>Comment By: saghul (saghul)
Date: 2012-09-19 01:20

Message:
Since the proxy was crashing constantly I modified the code to look as
follows:

void force_tcp_conn_lifetime(struct receive_info *rcv, unsigned int
timeout)                                                                   
                                                                           
             
{
       struct tcp_connection* con = NULL;
      unsigned int lifetime = get_ticks() + timeout;

      con = tcpconn_id_hash[rcv->proto_reserved1];
     if (con) {
         con->lifetime = lifetime;
    } else {
        LM_CRIT("connection not found in force_tcp_conn_lifetime");
    }
}

I left it running for a few hours and this is the result:

$ grep CRITICAL /var/log/syslog.1 |grep "force_tcp_conn_lifetime" | wc -l
69

So seems to be quite easy to trigger this behavior though I don't know the
exact pattern.

Please let me know if I can do anything else to help.



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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3568872&group_id=232389



More information about the Devel mailing list