Hi Bogdan,<div><br></div><div>Thanks for the quick patch. I&#39;ll try it out tomorrow and let you know the result at the end of the day.</div><div><br></div><div>Regards,</div><div>Ronald<br><br><div class="gmail_quote">On Tue, Jan 17, 2012 at 11:21 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 Ronald,<br>
    <br>
    Thanks for the useful information - find attached a patch that
    should fix the problem - please apply it, recompile and let me know
    if works ok - if yes, I will update on SVN.<br>
    <br>
    The crash seams to be triggered by a bogus SIP message where the
    parsing of the first line fails - and this message hits the pike
    route crashing in some parsing functions.<br>
    <br>
    Regards,<br>
    Bogdan<div><div class="h5"><br>
    <br>
    On 01/16/2012 06:08 AM, Ronald Cepres wrote:
    <blockquote type="cite">Hi Bogdan,
      <div><br>
      </div>
      <div>Thanks for your reply.</div>
      <div><br>
      </div>
      <div>The crash happened often (every less than hour) on live
        traffic, but I was not able to reproduce the bug on my own.</div>
      <div>Here&#39;s the last part of OpenSIPS logs that I saved after the
        crash:</div>
      <div><br>
      </div>
      <div>
        <div>Jan 13 09:31:39 ASTPROD-03 kernel: [25303999.864022]
          opensips[12133]: segfault at 0 ip 080f639c sp bfffc620 error 4
          in opensips[8048000+139000]</div>
        <div>Jan 13 09:31:39 ASTPROD-03 /sbin/opensips[12133]:
          INFO:core:parse_first_line: method not followed by SP</div>
        <div>Jan 13 09:31:39 ASTPROD-03 /sbin/opensips[12133]:
          INFO:core:parse_first_line: bad message</div>
        <div>Jan 13 09:31:39 ASTPROD-03 /sbin/opensips[12133]:
          ERROR:core:parse_msg: message=&lt;-15#015#012REGISTER sip:<a href="http://server.example.com" target="_blank">server.example.com</a>;transport=tcp
          SIP/2.0#015#012Via: SIP/2.0/TCP
          client.example.com:13851;rport;branch=z9hG4bKPj-HwYov6D5txKI6aVe5WxpubPXFTKtkHM#015#012Max-Forwards:
          70#015#012From: &lt;<a href="mailto:sip%3Auser@server.example.com" target="_blank">sip:user@server.example.com</a>&gt;;tag=e3o0uokXbnsOsn0HWFiw2Pn5D2TuAcmB#015#012To:
          &lt;<a href="mailto:sip%3Auser@server.example.com" target="_blank">sip:user@server.example.com</a>&gt;#015#012Call-ID:
          m2n.UnXe-HLK-XaiL0m6sWnOF1lQ71O.#015#012CSeq: 26361
          REGISTER#015#012User-Agent: 12Connect Lite SIP
          v3.0#015#012Contact:
          <a>&lt;sip:user@client.example.com:13851;transport=tcp;ob&gt;</a>#015#012Expires:
          300#015#012Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE,
          SUBSCRIBE, NOTIFY, REFER, MESSAGE,
          OPTIONS#015#012Content-Length:  0#015#012#015#012&gt;</div>
        <div>Jan 13 09:31:39 ASTPROD-03 /sbin/opensips[12133]:
          ERROR:core:receive_msg: parse_msg failed</div>
        <div>Jan 13 09:31:40 ASTPROD-03 /sbin/opensips[12145]:
          CRITICAL:core:receive_fd: EOF on 38</div>
        <div>Jan 13 09:31:40 ASTPROD-03 /sbin/opensips[12106]:
          INFO:core:handle_sigs: child process 12133 exited by a signal
          11</div>
        <div>Jan 13 09:31:40 ASTPROD-03 /sbin/opensips[12106]:
          INFO:core:handle_sigs: core was generated</div>
        <div>Jan 13 09:31:40 ASTPROD-03 /sbin/opensips[12106]:
          INFO:core:handle_sigs: terminating due to SIGCHLD</div>
        <br>
        <div class="gmail_quote">
          On Sun, Jan 15, 2012 at 8:45 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 Ronald,<br>
              <br>
              The crash happens on a reply and not a request - see the
              frame 14, where &quot;buf&quot; (the buffer containing the <br>
              sip message) shows a reply like text.<br>
              <br>
              But the is_method() should not crash at all....before
              diving into debugging:<br>
                  1) can you reproduce this crash ?<br>
                  2) before the crash, do you see any errors in the logs<br>
              <br>
              Regards,<br>
              Bogdan
              <div>
                <div><br>
                  <br>
                  On 01/13/2012 01:16 PM, Ronald Cepres wrote: </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div>Hi all,
                    <div><br>
                    </div>
                    <div>I&#39;m using OpenSIPS 1.7.1 and based from the
                      attached back trace, it crashed when it is trying
                      to parse the method of a REGISTER message received
                      by the server, triggered by pike route.</div>
                    <div> <br>
                    </div>
                    <div>Here is a snippet of my opensips.cfg:</div>
                    <div>...</div>
                    <div>
                      <div>loadmodule &quot;pike.so&quot;</div>
                      <div>modparam(&quot;pike&quot;, &quot;sampling_time_unit&quot;, 30)</div>
                      <div>modparam(&quot;pike&quot;, &quot;reqs_density_per_unit&quot;, 75)</div>
                      <div>modparam(&quot;pike&quot;, &quot;check_route&quot;, &quot;pike&quot;)</div>
                    </div>
                    <div>...</div>
                    <div>
                      <div>route[pike] {</div>
                      <div>        if (($si == $Ri) || ($si ==
                        &quot;192.168.1.60&quot;) || ($si == &quot; 192.168.1.61&quot;) ||
                        ($si == &quot; 192.168.1.65&quot;)) {</div>
                      <div>                        drop;</div>
                      <div>        }</div>
                      <div>        if (!is_method(&quot;REGISTER&quot;)) {</div>
                      <div>                drop;</div>
                      <div>        }</div>
                      <div>}</div>
                    </div>
                    <div> ...</div>
                    <div><br>
                    </div>
                    <div>Basically, I just want to check REGISTER
                      messages only on the pike route. Does anyone have
                      a workaround on this?</div>
                    <div><br>
                    </div>
                    <div>FWIW, should I also post this on the dev list?</div>
                    <div> <br>
                    </div>
                    <div>Thanks!</div>
                    <div><br>
                    </div>
                    <div>Regards,</div>
                    <div>Ronald</div>
                  </div>
                </div>
                <pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><span><font color="#888888">
</font></span></pre>
                <span><font color="#888888"> </font></span></blockquote>
              <span><font color="#888888"> <br>
                  <br>
                  <pre cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS solutions and &quot;know-how&quot;</pre>
                </font></span></div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <br>
    <pre cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS solutions and &quot;know-how&quot;</pre>
  </div></div></div>

</blockquote></div><br></div>