<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    the values are invalid, probably the previous fragment was writing
    more.<br>
    <br>
    For now, can you give:<br>
    <br>
    p *(struct qm_frag_end*)((char*)frag-sizeof(struct qm_frag_end))<br>
    <br>
    I expect to be some invalid values as well.<br>
    <br>
    Later I will try to come up with a gdb script to spot the previous
    fragment.<br>
    <br>
    MEMDBG=1 will make it slightly slower and increases a bit the
    overhead. But I guess you don't run at the limits of CPU. In the
    past we used to have it for couple of releases on and nobody
    complained about performances.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 11/21/13 7:39 PM, Dragos Oancea
      wrote:<br>
    </div>
    <blockquote
      cite="mid:1385059171.40617.YahooMailNeo@web124904.mail.ne1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, sans-serif;font-size:10pt">
        <div><span>Hi</span></div>
        <div style="color: rgb(0, 0, 0); font-size: 13px; font-family:
          HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida
          Grande', sans-serif; background-color: transparent;
          font-style: normal;"><span><br>
          </span></div>
        <div style="color: rgb(0, 0, 0); font-size: 13px; font-family:
          HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida
          Grande', sans-serif; background-color: transparent;
          font-style: normal;"><span>Here is the output:</span></div>
        <div style="color: rgb(0, 0, 0); font-size: 13px; font-family:
          HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida
          Grande', sans-serif; background-color: transparent;
          font-style: normal;"><span><br>
          </span></div>
        <div style="background-color: transparent;">gdb) </div>
        <div style="background-color: transparent;">(gdb) frame 0</div>
        <div style="background-color: transparent;">#0  qm_detach_free
          (qm=0x7fd96175e010, size=112) at mem/q_malloc.c:266</div>
        <div style="background-color: transparent;">266<span
            class="Apple-tab-span" style="white-space:pre"> </span>in
          mem/q_malloc.c</div>
        <div style="background-color: transparent;">(gdb) </div>
        <div style="background-color: transparent;">#0  qm_detach_free
          (qm=0x7fd96175e010, size=112) at mem/q_malloc.c:266</div>
        <div style="background-color: transparent;">266<span
            class="Apple-tab-span" style="white-space:pre"> </span>in
          mem/q_malloc.c</div>
        <div style="background-color: transparent;">(gdb) p *frag</div>
        <div style="background-color: transparent;">$1 = {size =
          7599108840079127868, u = {nxt_free = 0x3965663931343a64,
          is_free = 4135824228634344036}}</div>
        <div style="background-color: transparent;">(gdb) </div>
        <div style="background-color: transparent;">$2 = {size =
          7599108840079127868, u = {nxt_free = 0x3965663931343a64,
          is_free = 4135824228634344036}}</div>
        <div style="background-color: transparent;">(gdb) </div>
        <div style="background-color: transparent;">$3 = {size =
          7599108840079127868, u = {nxt_free = 0x3965663931343a64,
          is_free = 4135824228634344036}}</div>
        <div style="background-color: transparent;">(gdb) p
          *((char*)frag + sizeof(struct qm_frag))</div>
        <div style="background-color: transparent;"><span></span></div>
        <div style="background-color: transparent;">$4 = 99 'c'</div>
        <div><br>
        </div>
        <div>Is it okay to run with <span style="font-family: 'Courier
            New'; white-space: pre; font-size: 10pt;">MEMDBG=1 in
            production ? Wouldn't it make it a little slow ?</span></div>
        <div><br>
        </div>
        <div>Just let me know if u want so see something else with gdb.
          Unfortunally  I do not have SIP traces, but I have the core
          file and some logs.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Dragos</div>
        <div class="yahoo_quoted" style="display: block;"> <br>
          <br>
          <div style="font-family: HelveticaNeue, 'Helvetica Neue',
            Helvetica, Arial, 'Lucida Grande', sans-serif; font-size:
            10pt;">
            <div style="font-family: HelveticaNeue, 'Helvetica Neue',
              Helvetica, Arial, 'Lucida Grande', sans-serif; font-size:
              12pt;">
              <div dir="ltr"> <font face="Arial" size="2"> On Thursday,
                  November 21, 2013 6:50 PM, Daniel-Constantin Mierla
                  <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com"><miconda@gmail.com></a> wrote:<br>
                </font> </div>
              <div class="y_msg_container">
                <div id="yiv1585723220">
                  <div>
                    <div class="yiv1585723220moz-cite-prefix">Hello,<br
                        clear="none">
                      <br clear="none">
                      can you provde the output in gdb for:<br
                        clear="none">
                      <br clear="none">
                    </div>
                  </div>
                  <div>
                    <pre class="yiv1585723220code">frame 0

p *frag


p *((char*)frag + sizeof(struct qm_frag))

</pre>
                    There were similar reports, so apparently there is a
                    buffer overflow somewhere.<br clear="none">
                    <br clear="none">
                    You should update to latest git branch 4.0, because
                    there were some other fixes from 4.0.3. With this
                    occasion, you should set MEMDBG=1 in Makefile.defs
                    before recompiling the new version to be able to
                    catch easier the overwrites of memory.<br
                      clear="none">
                    <br clear="none">
                    Cheers,<br clear="none">
                    Daniel<br clear="none">
                    <br clear="none">
                    On 11/21/13 6:36 PM, Dragos Oancea wrote:<br
                      clear="none">
                    <blockquote type="cite">
                      <div class="yiv1585723220yqt9292292783"
                        id="yiv1585723220yqt19129">
                        <div style="color: rgb(0, 0, 0);
                          background-color: rgb(255, 255, 255);
                          font-family: HelveticaNeue, 'Helvetica Neue',
                          Helvetica, Arial, 'Lucida Grande', sans-serif;
                          font-size: 10pt;">
                          <div>Hello</div>
                          <div><br clear="none">
                          </div>
                          <div style="color: rgb(0, 0, 0); font-size:
                            13px; font-family: HelveticaNeue, 'Helvetica
                            Neue', Helvetica, Arial, 'Lucida Grande',
                            sans-serif; background-color: transparent;
                            font-style: normal;">We had this crash today
                            with kamailio 4.0.3 .</div>
                          <div style="color: rgb(0, 0, 0); font-size:
                            13px; font-family: HelveticaNeue, 'Helvetica
                            Neue', Helvetica, Arial, 'Lucida Grande',
                            sans-serif; background-color: transparent;
                            font-style: normal;">It ran stable for few
                            weeks until this crash.</div>
                          <div style="color: rgb(0, 0, 0); font-size:
                            13px; font-family: HelveticaNeue, 'Helvetica
                            Neue', Helvetica, Arial, 'Lucida Grande',
                            sans-serif; background-color: transparent;
                            font-style: normal;"><br clear="none">
                          </div>
                          <div style="color: rgb(0, 0, 0); font-size:
                            13px; font-family: HelveticaNeue, 'Helvetica
                            Neue', Helvetica, Arial, 'Lucida Grande',
                            sans-serif; background-color: transparent;
                            font-style: normal;">GDB here:</div>
                          <div style="color: rgb(0, 0, 0); font-size:
                            13px; font-family: HelveticaNeue, 'Helvetica
                            Neue', Helvetica, Arial, 'Lucida Grande',
                            sans-serif; background-color: transparent;
                            font-style: normal;"><br clear="none">
                          </div>
                          <div style="background-color:transparent;"><a
                              moz-do-not-send="true" rel="nofollow"
                              shape="rect"
                              class="yiv1585723220moz-txt-link-freetext"
                              target="_blank"
                              href="http://pastebin.com/rACV31z8">http://pastebin.com/rACV31z8</a><br
                              clear="none">
                          </div>
                          <div style="background-color: transparent;
                            color: rgb(0, 0, 0); font-size: 13px;
                            font-family: HelveticaNeue, 'Helvetica
                            Neue', Helvetica, Arial, 'Lucida Grande',
                            sans-serif; font-style: normal;"><br
                              clear="none">
                          </div>
                          <div style="background-color: transparent;
                            color: rgb(0, 0, 0); font-size: 13px;
                            font-family: HelveticaNeue, 'Helvetica
                            Neue', Helvetica, Arial, 'Lucida Grande',
                            sans-serif; font-style: normal;"><br
                              clear="none">
                          </div>
                          <div style="background-color: transparent;
                            color: rgb(0, 0, 0); font-size: 13px;
                            font-family: HelveticaNeue, 'Helvetica
                            Neue', Helvetica, Arial, 'Lucida Grande',
                            sans-serif; font-style: normal;">Regards,</div>
                          <div style="background-color: transparent;
                            color: rgb(0, 0, 0); font-size: 13px;
                            font-family: HelveticaNeue, 'Helvetica
                            Neue', Helvetica, Arial, 'Lucida Grande',
                            sans-serif; font-style: normal;">Dragos</div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>