Hi Bogdan,<br><br>thanks a lot for the fix.<br><br>I confirm that the dispatcher module crashed if the modparam &quot;use_default&quot; is set to 1 instead of 0 when there&#39;s no default destination set.<br>If set to 0, no crash anymore.<br>

<br>I&#39;ll add the patch this afternoon and test it again, but I&#39;m sure it&#39;s fine ;)<br>have a good day !<br><br>best regards,<br><br>.Sam.<br><br>Samuel MULLER<br><br><br><div class="gmail_quote">On Tue, Mar 13, 2012 at 7:12 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

  
    
  
  <div bgcolor="#ffffff" text="#000000">
    Hi Samuel,<br>
    <br>
    The fix is on SVN - so just update your code.<br>
    <br>
    Many thanks for reporting and troubleshooting this with me.<br>
    <br>
    Regards,<br>
    Bogdan<div><div class="h5"><br>
    <br>
    On 03/13/2012 07:34 PM, Samuel Muller wrote:
    <blockquote type="cite">Yep, it&#39;s what I tried.<br>
      <br>
      Actually, it&#39;s in a lab version, so I do several tests with 2
      small servers.<br>
      <br>
      The big picture is :<br>
      <br>
      UA -&gt; stateless proxies (with dispatcher) -&gt;
      statefull+registrar proxy<br>
      <br>
      Later, the dispatcher will be used to send Register requests to 2
      different registrar servers, and Invite requests to 2 different
      statefull proxies.<br>
      <br>
      In this actual case, the dispatcher list file contains these lines
      :<br>
      <br>
      1 sip:<a href="http://1.2.3.4:5060" target="_blank">1.2.3.4:5060</a><br>
      2 sip:<a href="http://1.2.3.4:5060" target="_blank">1.2.3.4:5060</a><br>
      3 sip:<a href="http://1.2.3.4:5060" target="_blank">1.2.3.4:5060</a><br>
      4 sip:<a href="http://1.2.3.4:5060" target="_blank">1.2.3.4:5060</a><br>
      <br>
      In the opensips config :<br>
      <br>
modparam(&quot;dispatcher&quot;,&quot;list_file&quot;,&quot;/opt/opensips/etc/opensips/dispatcher.list&quot;)<br>
      modparam(&quot;dispatcher&quot;,&quot;use_default&quot;,1)<br>
      modparam(&quot;dispatcher&quot;,&quot;dst_avp&quot;,&quot;$avp(dp_dst)&quot;)<br>
      modparam(&quot;dispatcher&quot;,&quot;attrs_avp&quot;,&quot;$avp(dp_attrs)&quot;)<br>
      modparam(&quot;dispatcher&quot;,&quot;grp_avp&quot;,&quot;$avp(dp_grp)&quot;)<br>
      modparam(&quot;dispatcher&quot;,&quot;cnt_avp&quot;,&quot;$avp(dp_cnt)&quot;)<br>
      modparam(&quot;dispatcher&quot;,&quot;hash_pvar&quot;,&quot;$avp(dp_hash)&quot;)<br>
      modparam(&quot;dispatcher&quot;,&quot;setid_pvar&quot;,&quot;$avp(dp_setid)&quot;)<br>
      modparam(&quot;dispatcher&quot;,&quot;ds_ping_from&quot;,&quot;<a href="mailto:sip%3Asep1@lab.toto.com" target="_blank">sip:sep1@lab.toto.com</a>&quot;)<br>
      modparam(&quot;dispatcher&quot;,&quot;ds_ping_interval&quot;,15)<br>
      modparam(&quot;dispatcher&quot;,&quot;ds_probing_mode&quot;,1)<br>
      <br>
      In the opensips routing logic, I would like to separate register
      and invite requests :<br>
      <br>
      route {<br>
      ...<br>
          if (!is_method(&quot;REGISTER|MESSAGE&quot;)) {<br>
      <div>         record_route(&quot;;rr=edge&quot;);<br>
            }<br>
           if (is_method(&quot;REGISTER&quot;)) {<br>
                if (!ds_select_dst(&quot;1&quot;, &quot;0&quot;)) {<br>
                    ds_mark_dst(&quot;p&quot;);<br>
                    ds_select_dst(&quot;2&quot;, &quot;0&quot;);<br>
                }<br>
            }<br>
            if (is_method(&quot;INVITE&quot;)) {<br>
                if (!ds_select_dst(&quot;3&quot;, &quot;0&quot;)) {<br>
                    ds_mark_dst(&quot;p&quot;);<br>
                    ds_select_dst(&quot;4&quot;, &quot;0&quot;);<br>
                }<br>
            }<br>
            route(RELAY);<br>
            exit;<br>
        }</div>
      <br>
      But, even if I change the routing logic with :<br>
      ...<br>
          if (is_method(&quot;REGISTER&quot;)) {<br>
              ds_select_dst(&quot;1&quot;, &quot;0&quot;);<br>
          }<br>
          if (is_method(&quot;INVITE&quot;)) {<br>
              ds_select_dst(&quot;3&quot;, &quot;0&quot;);<br>
          }<br>
      ...<br>
      <br>
      It happens the same crash, same reason.<br>
      <br>
      I&#39;ll change the &quot;use_default&quot; param to 0 and re-do tests.<br>
      <br>
      <br clear="all">
      .Sam.<br>
      <br>
      Samuel MULLER<br>
      <br>
      <div class="gmail_quote">On Tue, Mar 13, 2012 at 6:14 PM,
        Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div bgcolor="#ffffff" text="#000000"> Ok, that&#39;s the info I
            was looking for :)..<br>
            <br>
            Looking at that group, should I understand you have only one
            destination in there, while having the  &quot;use_default&quot; on ?
            This makes a bit of none sense - the group has only the
            default destination (to be used in case of failure), but no
            regular destination ??<br>
            <br>
            Anyhow, there is a bug there, but I want to understand your
            setting, to be sure that the fix will be the right one ;)<br>
            <br>
            Thanks and regards,<br>
            Bogdan
            <div>
              <div><br>
                <br>
                On 03/13/2012 04:51 PM, Samuel Muller wrote:
                <blockquote type="cite">oups, sorry ...<br>
                  <br>
                  (gdb) p *idx<br>
                  $1 = {id = 1, nr = 1, last = 0, weight_sum = 0, dlist
                  = 0x7f867d60b458, next = 0x0}<br>
                  <br>
                  ;)<br>
                  <br>
                  .Sam.<br clear="all">
                  <br>
                  Samuel MULLER<br>
                  <br>
                  <br>
                  <div class="gmail_quote">On Tue, Mar 13, 2012 at 3:40
                    PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;</span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                      <div bgcolor="#ffffff" text="#000000"> Hi Samuel,<br>
                        <br>
                        Print please &quot;*idx&quot; and not only &quot;idx&quot; - I need
                        its content ;)<br>
                        <br>
                        Regards,<br>
                        Bogdan
                        <div>
                          <div><br>
                            <br>
                            On 03/13/2012 04:35 PM, Samuel Muller wrote:
                            <blockquote type="cite">Hello Bogdan,<br>
                              <br>
                              nice to see you again !<br clear="all">
                              <br>
                              here the stuff :<br>
                              <br>
                              [Thread debugging using libthread_db
                              enabled]<br>
                              Core was generated by
                              `/opt/opensips/sbin/opensips -P
                              /opt/opensips/var/run/opensips.pid -m 256
                              -u sam&#39;.<br>
                              Program terminated with signal 8,
                              Arithmetic exception.<br>
                              #0  0x00007f26f086c513 in ds_select_dst
                              (msg=0x80ebe8, set=&lt;optimized out&gt;,
                              alg=0, mode=&lt;optimized out&gt;, <br>
                                  max_results=&lt;optimized out&gt;) at
                              dispatch.c:1235<br>
                              1235                i =
                              (i+1)%(idx-&gt;nr-1);<br>
                              <br>
                              (gdb) p i<br>
                              $1 = 0<br>
                              <br>
                              (gdb) p idx<br>
                              $2 = (ds_set_p) 0x7f26dee90350<br>
                              <br>
                              (gdb) l<br>
                              1230    <br>
                              1231        i=ds_id;<br>
                              1232        while (
                              idx-&gt;dlist[i].flags&amp;(DS_INACTIVE_DST|DS_PROBING_DST)
                              )<br>
                              1233        {<br>
                              1234            if(ds_use_default!=0)<br>
                              1235                i =
                              (i+1)%(idx-&gt;nr-1);<br>
                              1236            else<br>
                              1237                i = (i+1)%idx-&gt;nr;<br>
                              1238            if(i==ds_id)<br>
                              1239            {<br>
                              <br>
                              <br>
                              I re-tested with a few modifications, like
                              changing IPs in the dispatcher list file,
                              or into the routing logic (&quot;do it simple
                              like in the docs examples&quot;), the same
                              problems still happens :/<br>
                              <br>
                              here&#39;s the corefile if needed : <a href="http://public.l33.fr/corefile.opensips.tar.gz" target="_blank">http://public.l33.fr/corefile.opensips.tar.gz</a><br>
                              <br>
                              <br>
                              Best regards,<br>
                              <br>
                              Samuel MULLER<br>
                              <br>
                              <br>
                              <br>
                              <div class="gmail_quote">On Tue, Mar 13,
                                2012 at 2:51 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;</span>
                                wrote:<br>
                                <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> Hello
                                  Samuel,<br>
                                  <br>
                                  In gdb, could you please print the
                                  &#39;*idx&#39; and &#39;i&#39; variables ?<br>
                                  <br>
                                  Thanks and regards,<br>
                                  Bogdan
                                  <div>
                                    <div><br>
                                      <br>
                                      <br>
                                      <br>
                                      On 03/07/2012 03:34 PM, Samuel
                                      Muller wrote:<br>
                                    </div>
                                  </div>
                                  <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                    <div>
                                      <div> Hey all,<br>
                                        <br>
                                        I got this crash when testing
                                        proxies availability with the
                                        dispatcher module :<br>
                                        <br>
                                        $ gdb
                                         /opt/opensips/sbin/opensips
                                        core<br>
                                        <br>
                                        GNU gdb (GDB) 7.3-debian<br>
                                        This GDB was configured as
                                        &quot;x86_64-linux-gnu&quot;.<br>
                                        Reading symbols from
                                        /opt/opensips/sbin/opensips...done.<br>
                                        [New LWP 11580]<br>
                                        <br>
                                        [Thread debugging using
                                        libthread_db enabled]<br>
                                        Core was generated by
                                        `/opt/opensips/sbin/opensips -P<br>
                                        /opt/opensips/var/run/opensips.pid
                                        -m 256 -u sam&#39;.<br>
                                        Program terminated with signal
                                        8, Arithmetic exception.<br>
                                        #0  0x00007f87b9b54513 in
                                        ds_select_dst (msg=0x80f988,
                                        set=&lt;optimized<br>
                                        out&gt;, alg=0,<br>
                                            mode=&lt;optimized out&gt;,
                                        max_results=&lt;optimized
                                        out&gt;) at dispatch.c:1235<br>
                                        1235                i =
                                        (i+1)%(idx-&gt;nr-1);<br>
                                        <br>
                                        <br>
                                        in the opensips.cfg :<br>
                                        <br>
modparam(&quot;dispatcher&quot;,&quot;list_file&quot;,&quot;/opt/opensips/etc/opensips/dispatcher.list&quot;)<br>
modparam(&quot;dispatcher&quot;,&quot;use_default&quot;,1)<br>
modparam(&quot;dispatcher&quot;,&quot;dst_avp&quot;,&quot;$avp(dp_dst)&quot;)<br>
modparam(&quot;dispatcher&quot;,&quot;attrs_avp&quot;,&quot;$avp(dp_attrs)&quot;)<br>
modparam(&quot;dispatcher&quot;,&quot;grp_avp&quot;,&quot;$avp(dp_grp)&quot;)<br>
modparam(&quot;dispatcher&quot;,&quot;cnt_avp&quot;,&quot;$avp(dp_cnt)&quot;)<br>
modparam(&quot;dispatcher&quot;,&quot;hash_pvar&quot;,&quot;$avp(dp_hash)&quot;)<br>
modparam(&quot;dispatcher&quot;,&quot;setid_pvar&quot;,&quot;$avp(dp_setid)&quot;)<br>
modparam(&quot;dispatcher&quot;,&quot;ds_ping_from&quot;,&quot;<a href="mailto:sip%3Aedge@lab.com" target="_blank">sip:edge@lab.com</a>&quot;)<br>
modparam(&quot;dispatcher&quot;,&quot;ds_ping_interval&quot;,30)<br>
modparam(&quot;dispatcher&quot;,&quot;ds_probing_mode&quot;,1)<br>
                                        <br>
                                        route {<br>
                                        ...<br>
                                            if
                                        (!is_method(&quot;REGISTER|MESSAGE&quot;))
                                        {<br>
                                               
                                        record_route(&quot;;rr=edge&quot;);<br>
                                            }<br>
                                           if (is_method(&quot;REGISTER&quot;)) {<br>
                                                if (!ds_select_dst(&quot;1&quot;,
                                        &quot;0&quot;)) {<br>
                                                    ds_mark_dst(&quot;p&quot;);<br>
                                                    ds_select_dst(&quot;2&quot;,
                                        &quot;0&quot;);<br>
                                                }<br>
                                            }<br>
                                            if (is_method(&quot;INVITE&quot;)) {<br>
                                                if (!ds_select_dst(&quot;3&quot;,
                                        &quot;0&quot;)) {<br>
                                                    ds_mark_dst(&quot;p&quot;);<br>
                                                    ds_select_dst(&quot;4&quot;,
                                        &quot;0&quot;);<br>
                                                }<br>
                                            }<br>
                                            route(RELAY);<br>
                                            exit;<br>
                                        }<br>
                                        <br>
                                        <br>
                                        in the dispatcher.list :<br>
                                        <br>
                                        1 sip:<a href="http://1.2.3.4:5060" target="_blank">1.2.3.4:5060</a><br>
                                        2 sip:<a href="http://1.2.3.5:5060" target="_blank">1.2.3.5:5060</a><br>
                                        3 sip:<a href="http://1.2.3.6:5060" target="_blank">1.2.3.6:5060</a><br>
                                        4 sip:<a href="http://1.2.3.5:5060" target="_blank">1.2.3.5:5060</a><br>
                                        <br>
                                        all is running under Debian last
                                        stable release + backports.<br>
                                        <br>
                                        I would like to know if it&#39;s my
                                        dispatcher configuration routine<br>
                                        that&#39;s not correct, or if it&#39;s a
                                        module problem ?<br>
                                        <br>
                                        thank you,<br>
                                        <br>
                                        <br>
                                        Samuel MULLER<br>
                                        <br>
                                      </div>
                                    </div>
_______________________________________________<br>
                                    Users mailing list<br>
                                    <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
                                    <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                                    <br>
                                    <span><font color="#888888"> </font></span></blockquote>
                                  <span><font color="#888888"> <br>
                                      <br>
                                      -- <br>
                                      Bogdan-Andrei Iancu<br>
                                      OpenSIPS Founder and Developer<br>
                                      <a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a><br>
                                      <br>
                                    </font></span></blockquote>
                              </div>
                              <br>
                            </blockquote>
                            <br>
                            <br>
                            <pre cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </blockquote>
                <br>
                <br>
                <pre cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
              </div>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
    <br>
    <pre cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
  </div></div></div>

</blockquote></div><br>