<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    <div class="moz-cite-prefix">On 9/10/12 2:33 PM, Carlos Ruiz D&iacute;az
      wrote:<br>
    </div>
    <blockquote
cite="mid:CA+3gBc=W6QYzvkbYzH9dOE2QpNQZ49BEBPQSBGxWhuMXx+U9iw@mail.gmail.com"
      type="cite">Hi Daniel,
      <div><br>
      </div>
      <div>no, it's just a plain make &amp;&amp; make install.&nbsp;</div>
      <div><br>
      </div>
      <div>I spent a few hours on debugging and I figured out that it
        was an off by one error on a memcpy() on certain exceptional
        conditions. I fixed that but then I found a memory leak that's
        causing the crash after 40k calls but I'm having a hard time
        interpreting the dump provided after sending the SIGUSR1 to the
        process. if I'm not mistaken, there are two pkg_str_dup() leaks
        per call but I'm still searching where I'm missing the
        pkg_free().&nbsp;</div>
      <div><br>
      </div>
      <div>Is there a way to know where in the code the pkg_str_dup was
        called?</div>
      <div><br>
      </div>
      <div>I tried with valgrind too, but after the macro expansion of
        the memory management functions, is very hard to find where it
        was called.</div>
    </blockquote>
    <br>
    here are some hints about troubleshooting memory:<br>
    <a class="moz-txt-link-freetext" href="http://www.asipto.com/pub/kamailio-devel-guide/#c04troubleshooting">http://www.asipto.com/pub/kamailio-devel-guide/#c04troubleshooting</a><br>
    <br>
    if you set memdbg and memlog lower than debug global parameter, then
    you get all memory operations in the syslog (be sure you compile
    with MEMDBG=1). Also look at mem_summary:<br>
    <a class="moz-txt-link-freetext" href="http://www.kamailio.org/wiki/cookbooks/3.3.x/core#mem_summary">http://www.kamailio.org/wiki/cookbooks/3.3.x/core#mem_summary</a><br>
    <br>
    and cfgutils module readme for some functions that can be used in
    config to dump the memory usage.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <br>
    <blockquote
cite="mid:CA+3gBc=W6QYzvkbYzH9dOE2QpNQZ49BEBPQSBGxWhuMXx+U9iw@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      <div>Regards.</div>
      <div><br>
      </div>
      <div>Carlos.</div>
      <div><br>
      </div>
      <div><br>
        <br>
        <div class="gmail_quote">On Mon, Sep 10, 2012 at 4:02 AM,
          Daniel-Constantin Mierla <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:miconda@gmail.com"
              target="_blank">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">
            <div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
              <br>
              yes, by default is with debug symbols on. Do you provide
              special flags or parameters to the make command?<br>
              <br>
              Cheers,<br>
              Daniel
              <div>
                <div class="h5"><br>
                  <br>
                  <div>On 9/8/12 9:39 PM, Carlos Ruiz D&iacute;az wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">Hello list,
                    <div><br>
                    </div>
                    <div>I'm trying to debug my module after it crashed
                      by SIGSEGV,&nbsp;but the problem is that I'm unable to
                      see the relevant data in the core file that's
                      being dumped after the crash.</div>
                    <div> <br>
                    </div>
                    <div>For example, if I do <i>bt full,&nbsp;</i>I get:</div>
                    <div><br>
                    </div>
                    <div>
                      <div>0 &nbsp;0x0ef0f494 in append_string () from
                        /opt/install/kamailio-3.2.3/lib/kamailio/modules_k/cnx3a.so</div>
                      <div>No symbol table info available.</div>
                      <div>#1 &nbsp;0x0eef9658 in build_message () from
                        /opt/install/kamailio-3.2.3/lib/kamailio/modules_k/cnx3a.so</div>
                      <div>No symbol table info available.</div>
                      <div>Backtrace stopped: frame did not save the PC</div>
                    </div>
                    <div><br>
                    </div>
                    <div>Only the functions that were called but no
                      parameter values.&nbsp;</div>
                    <div><br>
                    </div>
                    <div>AFAIK, if I compile kamailio from sources, it
                      is by default compiled with the -g option, so, it
                      looks like that I'm missing something else.</div>
                    <div><br>
                    </div>
                    <div>Regards.</div>
                    <div><br>
                    </div>
                    <div>Carlos.</div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <pre>_______________________________________________
sr-dev mailing list
<a moz-do-not-send="true" href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><span class="HOEnZb"><font color="#888888">
</font></span></pre>
                <span class="HOEnZb"><font color="#888888"> </font></span></blockquote>
              <span class="HOEnZb"><font color="#888888"> <br>
                  <pre cols="72">-- 
Daniel-Constantin Mierla - <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a moz-do-not-send="true" href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a>
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - <a moz-do-not-send="true" href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a></pre>
                </font></span></div>
          </blockquote>
        </div>
        <br>
      </div>
    </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://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - <a class="moz-txt-link-freetext" href="http://asipto.com/u/katu">http://asipto.com/u/katu</a></pre>
  </body>
</html>