<div dir="ltr"><div>Hi,</div><div><br></div><div>I think I have this issue and I'm using 4.4 and I can't use master for now. I tried to cherry pick this 2 commits, but unfortunately it do not work.</div><div><br></div><div>For example commit 
<span class="gmail-sha-block"><span class="gmail-sha gmail-user-select-contain">5fe2a1a1c67b550431dcae3c98701073f7edd953 make changes in function </span></span>
<span class="gmail-blob-code-inner"><span class="gmail-pl-en">t_continue_helper</span></span>, but 4.4 do not has such function, it has with slightly different name - <span class="gmail-pl-k"></span><span class="gmail-pl-en">t_continue</span>. <br></div><div><br></div><div>Same commit add line 258 in 
src/modules/tm/t_suspend.c, but in 4.4 this part of code is slightly different. There is no "
<span class="gmail-blob-code-inner">t-><span class="gmail-pl-smi">flags</span> &= ~T_ASYNC_CONTINUE;</span>

" line in same if statement.</div><div><br></div><div>There is no way to remove line 390 from same file, cause in 4.4 that part of code differs quite a lot.</div><div><br></div><div>With second patch 72f5eaeeef0239ebd16a2d645b83e83eb1a2b506 there was much less problems, but still, there is big difference in part of code near line 592 of this commit, but probably in 4.4 i just need to update line 527 and change "<span class="gmail-pl-c1">UNREF_FREE</span>(new_cell);

" to "
<span class="gmail-blob-code-inner"><span class="gmail-pl-c1">UNREF_FREE</span>(new_cell<span class="gmail-x gmail-x-first">, </span><span class="gmail-pl-c1 gmail-x gmail-x-last">0</span>);</span>"</div><div><br></div><div><br></div><div>Is it a worth to try to cherry pick this 2 commits or there are too much changes between 4.4 and Master and no way to make this work properly?</div><div><br></div><div><br></div><div>Please advise.</div><div><br></div><div>Thank you!<br></div><div><br></div><div>With kind regards,<br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Jurijs<br></div></div></div>
<br><div class="gmail_quote">On Tue, Jun 12, 2018 at 3:25 PM, Ivaylo Markov <span dir="ltr"><<a href="mailto:ivo@schupen.net" target="_blank">ivo@schupen.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Just in case anyone runs into this kind of problem in the future
      - commits <span class="m_6890808686740793342sha-block"><span class="m_6890808686740793342sha m_6890808686740793342user-select-contain">72f5eaeeef0239ebd16a2d645b83e8<wbr>3eb1a2b506
          and </span></span><br>
      <span class="m_6890808686740793342sha-block"><span class="m_6890808686740793342sha m_6890808686740793342user-select-contain"><span class="m_6890808686740793342sha-block"><span class="m_6890808686740793342sha m_6890808686740793342user-select-contain">5fe2a1a1c67b550431dcae3c987010<wbr>73f7edd953
              (currently in the master branch only) seem to fix this.<br>
            </span></span></span></span></p><div><div class="h5">
    <br>
    <div class="m_6890808686740793342moz-cite-prefix">On 05/28/2018 06:01 PM, Ivaylo Markov
      wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>Hello,

I am trying to set up Kamailio as a push notifications proxy, closely
following the example in the "Kamailio in a Mobile World" presentation
(<a class="m_6890808686740793342moz-txt-link-freetext" href="https://www.slideshare.net/FedericoCabiddu/kamailioinamobileworld-51617342" target="_blank">https://www.slideshare.net/<wbr>FedericoCabiddu/<wbr>kamailioinamobileworld-<wbr>51617342</a>).
I am running Debian 9 and Kamailio 5.1.3 from the official Debian
repositories.
I believe the main modules involved in the issue below are tm, tmx, and
tsilo.

Every call passing through the proxy leads to a small memory leak in the tm
module - there is a large amount of "delayed free" memory cells from tm's
internal hash table. At some point the shared memory runs out and Kamailio
restarts. Using the "kamcmd corex.shm_summary" command I was able to see
that the top users of shared memory are "tm: h_table.c: build_cell" and
"core: core/sip_msg_clone.c: sip_msg_shm_clone" with the same allocation
count.

I experimented with removing different parts of the configuration and
noticed that commenting out the "t_continue(...)" call in the "PUSHJOIN"
route
(see slide #22) prevents the leak from happening. Maybe something in that
function is incrementing the reference counter to the hash table cell, but
it is not decrementing the counter when done?

I tried looking around the source code of the tm and tmx modules, but saw
nothing suspicious. I also tried using gdb with a breakpoint in
t_continue_helper (tm/t_suspend.c:166) hoping to see what else is accessing
the htable cell, but was unable to find anything of use.

Has someone encountered anything like this? Can you provide more directions
on debuggin this? I can provide some bits of configuration, but an entire
test setup would be rather difficult, unfortunately.

Thank you for your time,
Ivo


______________________________<wbr>_________________
Kamailio (SER) - Users Mailing List
<a class="m_6890808686740793342moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="m_6890808686740793342moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br></div>