<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    right, very dummy paste position for resetting the redis context,
    use the attached patch or exchange lines 228 and 229. in
    redis_client.c<br>
    <br>
    Thanks,<br>
    Daniel<br>
    <br>
    <br>
    On 2/17/12 1:13 PM, Javier Gallart wrote:
    <blockquote
cite="mid:CACviLGZn2uvve4Sf3g0+5N9+6fjH96s1T25bFeB1tcA+QGTW9A@mail.gmail.com"
      type="cite">Hi Daniel, Andrew
      <div><br>
      </div>
      <div>I've just tested the patch and kamailio crashes when the
        redis server is stopped. This is what I could get:</div>
      <div>-From the logs:</div>
      <div>
        <div>Feb 17 06:33:32 r-gate-test ./kamailio[23812]: ALERT:
          &lt;core&gt; [main.c:751]: child process 23819 exited by a
          signal 11</div>
        <div>Feb 17 06:33:32 r-gate-test ./kamailio[23812]: ALERT:
          &lt;core&gt; [main.c:754]: core was generated</div>
        <div>Feb 17 06:33:32 r-gate-test ./kamailio[23812]: INFO:
          &lt;core&gt; [main.c:766]: INFO: terminating due to SIGCHLD</div>
        <div><br>
        </div>
        <div>-An the backtrace:</div>
        <div>(...)</div>
        <div>
          <div>Core was generated by `./kamailio -f
            ../etc/kamailio/kamailio.cfg'.</div>
          <div>Program terminated with signal 11, Segmentation fault.</div>
          <div>#0 &nbsp;redisFree (c=0x0) at hiredis.c:817</div>
          <div>817<span class="Apple-tab-span" style="white-space:pre">
            </span> &nbsp; &nbsp;if (c-&gt;fd &gt; 0)</div>
          <div>(gdb) bt</div>
          <div>#0 &nbsp;redisFree (c=0x0) at hiredis.c:817</div>
          <div>#1 &nbsp;0x00007f726f035461 in redisc_reconnect_server
            (rsrv=0x7f7271c93ac0) at redis_client.c:229</div>
          <div>#2 &nbsp;0x00007f726f037240 in redisc_exec (srv=&lt;value
            optimized out&gt;, cmd=0x7fffe98c6090, argv1=&lt;value
            optimized out&gt;, argv2=&lt;value optimized out&gt;,
            argv3=&lt;value optimized out&gt;,&nbsp;</div>
          <div>&nbsp; &nbsp; res=&lt;value optimized out&gt;) at
            redis_client.c:298</div>
          <div>#3 &nbsp;0x00007f726f034f7d in w_redis_cmd3
            (msg=0x7f7271d7b018, ssrv=&lt;value optimized out&gt;,
            scmd=&lt;value optimized out&gt;, sres=0x7f7271d74b58
            "h\341\313qr\177") at ndb_redis_mod.c:156</div>
          <div>#4 &nbsp;0x0000000000417025 in do_action (h=0x7fffe98c6570,
            a=0x7f7271cc5248, msg=&lt;value optimized out&gt;) at
            action.c:1134</div>
          <div>#5 &nbsp;0x000000000041e58b in run_actions (h=&lt;value
            optimized out&gt;, a=&lt;value optimized out&gt;,
            msg=&lt;value optimized out&gt;) at action.c:1610</div>
          <div>#6 &nbsp;0x000000000041e8d4 in run_actions_safe
            (h=0x7fffe98c7610, a=0x7f7271c93781, msg=0x7f7271c93780) at
            action.c:1662</div>
          <div>#7 &nbsp;0x00000000004b731d in rval_get_int (h=0x7fffe98c7610,
            msg=0x0, i=0x7fffe98c6bd8, rv=0x3, cache=0x4) at
            rvalue.c:920</div>
          <div>#8 &nbsp;0x00000000004bb87c in rval_expr_eval_int
            (h=0x7fffe98c7610, msg=0x7f7271d7b018, res=0x7fffe98c6bd8,
            rve=0x7f7271cc6768) at rvalue.c:1914</div>
          <div>#9 &nbsp;0x0000000000417c7c in do_action (h=0x7fffe98c7610,
            a=0x7f7271ccb9d0, msg=&lt;value optimized out&gt;) at
            action.c:1092</div>
          <div>#10 0x000000000041e58b in run_actions (h=&lt;value
            optimized out&gt;, a=&lt;value optimized out&gt;,
            msg=&lt;value optimized out&gt;) at action.c:1610</div>
          <div>#11 0x0000000000417cd7 in do_action (h=0x7fffe98c7610,
            a=0x7f7271ccbb10, msg=&lt;value optimized out&gt;) at
            action.c:1111</div>
          <div>#12 0x000000000041e58b in run_actions (h=&lt;value
            optimized out&gt;, a=&lt;value optimized out&gt;,
            msg=&lt;value optimized out&gt;) at action.c:1610</div>
          <div>#13 0x000000000041795e in do_action (h=0x7fffe98c7610,
            a=&lt;value optimized out&gt;, msg=&lt;value optimized
            out&gt;) at action.c:732</div>
          <div>#14 0x000000000041e58b in run_actions (h=&lt;value
            optimized out&gt;, a=&lt;value optimized out&gt;,
            msg=&lt;value optimized out&gt;) at action.c:1610</div>
          <div>#15 0x000000000041e862 in run_top_route
            (a=0x7f7271c94888, msg=0x7f7271d7b018, c=&lt;value optimized
            out&gt;) at action.c:1683</div>
          <div>#16 0x0000000000498f36 in receive_msg (</div>
          <div>&nbsp; &nbsp; buf=0x8bb100 "INVITE <a moz-do-not-send="true"
              href="http://sip:34661574758@79.170.68.215:5060">sip:34661574758@79.170.68.215:5060</a>
            SIP/2.0\r\nVia: SIP/2.0/UDP
            79.170.68.214:5060;branch=z9hG4bK-9451-1-0\r\nFrom:
            34661574758 &lt;<a moz-do-not-send="true"
              href="http://sip:34661574758@79.170.68.214:5060">sip:34661574758@79.170.68.214:5060</a>&gt;;tag=9451SIPpTag001\r\nTo:
            sut &lt;sip:"..., len=&lt;value optimized out&gt;,
            rcv_info=0x7fffe98c7910) at receive.c:207</div>
          <div>#17 0x0000000000525987 in udp_rcv_loop () at
            udp_server.c:544</div>
          <div>#18 0x00000000004635f4 in main_loop () at main.c:1585</div>
          <div>#19 0x0000000000465e62 in main (argc=3,
            argv=0x7fffe98c7c08) at main.c:2475</div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Regards</div>
        <div><br>
        </div>
        <div>Javi</div>
        <br>
        <div class="gmail_quote">On Fri, Feb 17, 2012 at 11:39 AM,
          Daniel-Constantin Mierla <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
            <br>
            thanks for testing, indeed it was an extra declaration left
            over. Can you try with the new patch attached?<br>
            <br>
            Cheers,<br>
            Daniel
            <div>
              <div class="h5"><br>
                <br>
                On 2/17/12 11:10 AM, Andrew Pogrebennyk wrote:<br>
              </div>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div>
                <div class="h5">
                  Hi Daniel,<br>
                  <br>
                  On 02/17/2012 10:47 AM, Daniel-Constantin Mierla
                  wrote:<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    I made a patch for server reconnect -- I had no
                    access to a computer<br>
                    with redis lib installed for the moment, hopefully
                    it compiles. If you<br>
                    can try and tell the result, it would be great, I
                    can commit then.<br>
                  </blockquote>
                  I may be able to test this patch as well. Currently
                  compilations bails<br>
                  out on attempt to redeclare redisc_reconnect_server
                  function parameter:<br>
                  <br>
                  CC (gcc) [M ndb_redis.so] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                  ndb_redis_mod.o<br>
                  CC (gcc) [M ndb_redis.so] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; redis_client.o<br>
                  redis_client.c: In function &#8216;redisc_reconnect_server&#8217;:<br>
                  redis_client.c:206:19: error: &#8216;rsrv&#8217; redeclared as
                  different kind of symbol<br>
                  redis_client.c:202:46: note: previous definition of
                  &#8216;rsrv&#8217; was here<br>
                  make[1]: *** [redis_client.o] Error 1<br>
                  make: *** [modules] Error 1<br>
                  <br>
                </div>
              </div>
              <div class="im">
                _______________________________________________<br>
                SIP Express Router (SER) and Kamailio (OpenSER) -
                sr-users mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:sr-users@lists.sip-router.org"
                  target="_blank">sr-users@lists.sip-router.org</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
                  target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
              </div>
            </blockquote>
            <div class="HOEnZb">
              <div class="h5">
                <br>
                -- <br>
                Daniel-Constantin Mierla -- <a moz-do-not-send="true"
                  href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
                <a moz-do-not-send="true"
                  href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a>
                -- <a moz-do-not-send="true"
                  href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a><br>
                <br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
  </body>
</html>