<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi.</p>
<p><br>
</p>
<p>In addiction to my last message, the same problem also exists to the following configuration:</p>
<p><br>
</p>
<p></p>
<div>modparam(&quot;uri&quot;, &quot;use_uri_table&quot;, 0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>
modparam(&quot;uri&quot;, &quot;db_url&quot;, &quot;sqlite:///usr/local/opensips/db/sisc.sqlite&quot;) # CUSTOMIZE ME</div>
<p></p>
<p><br>
</p>
<p>If use_uri_table is equal to zero, we must comment the line that declare db_url.</p>
<p><br>
</p>
<p>But, what kind of side effect could I get with such decision?</p>
<p><br>
</p>
<p><br>
</p>
<p>Regards.<br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De:</b> sisc-request@listas.inatel.br &lt;sisc-request@listas.inatel.br&gt; em nome de Rodrigo Pimenta Carvalho &lt;pimenta@inatel.br&gt;<br>
<b>Enviado:</b> sexta-feira, 17 de junho de 2016 14:57<br>
<b>Para:</b> users@lists.opensips.org<br>
<b>Assunto:</b> [sisc] Parser memory Leak found.</font>
<div>&nbsp;</div>
</div>
<div>
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi.</p>
<p><br>
</p>
<p>Thanks Daniel Fússia, a coworker in my office, now I'm sending more details about the memory leak we saw in OpenSIPS 2.2 (newest commit from today):</p>
<p><br>
</p>
<p>The following configuration doesn't causes memory leaks:</p>
<p><br>
</p>
<p></p>
<div>modparam(&quot;dialog&quot;, &quot;db_mode&quot;, 1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
modparam(&quot;dialog&quot;, &quot;db_url&quot;,&nbsp; &quot;sqlite:///usr/local/opensips/db/sisc.sqlite&quot;)<br>
<br>
But, when db_mode is 0, it causes memory leak. The problem is that when using db_mode = 0 we can't declare db_url. That is, if db_mode is zero, we have to comment the line that declares db_url.<br>
<br>
See below the valgrind logs. One for the case without memory leak and another one with the issue.<br>
<br>
-----------------------------------------------------------------------------------------------------------------------------<br>
<br>
<div>==1792== &nbsp;<br>
==1792== HEAP SUMMARY: <br>
==1792==&nbsp;&nbsp;&nbsp;&nbsp; in use at exit: 3,142,778 bytes in 2,894 blocks <br>
==1792==&nbsp;&nbsp; total heap usage: 9,463 allocs, 6,569 frees, 4,960,116 bytes allocated
<br>
==1792== &nbsp;<br>
==1792== LEAK SUMMARY: <br>
==1792==&nbsp;&nbsp;&nbsp; definitely lost: 0 bytes in 0 blocks <br>
==1792==&nbsp;&nbsp;&nbsp; indirectly lost: 0 bytes in 0 blocks <br>
==1792==&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; possibly lost: 0 bytes in 0 blocks <br>
==1792==&nbsp;&nbsp;&nbsp; still reachable: 3,142,778 bytes in 2,894 blocks <br>
==1792==&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; suppressed: 0 bytes in 0 blocks <br>
==1792== Reachable blocks (those to which a pointer was found) are not shown. <br>
==1792== To see them, rerun with: --leak-check=full --show-leak-kinds=all <br>
==1792==&nbsp;</div>
------------------------------------------------------------------------------------------------------------------------------------<br>
<br>
Now with the isse:<br>
<br>
---------------------------------------------------------------------------------------------------------------------------------------<br>
<br>
<div>Thank you for flying opensips <br>
==1762== &nbsp;<br>
==1762== HEAP SUMMARY: <br>
==1762==&nbsp;&nbsp;&nbsp;&nbsp; in use at exit: 2,887,898 bytes in 2,193 blocks <br>
==1762==&nbsp;&nbsp; total heap usage: 7,991 allocs, 5,798 frees, 4,382,036 bytes allocated
<br>
==1762== &nbsp;<br>
==1762== 80 bytes in 1 blocks are definitely lost in loss record 31 of 100 <br>
==1762==&nbsp;&nbsp;&nbsp; at 0x4C2745D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
<br>
==1762==&nbsp;&nbsp;&nbsp; by 0x52D50B9: strdup (strdup.c:42) <br>
==1762==&nbsp;&nbsp;&nbsp; by 0x4DF87E: set_mod_param_regex (modparam.c:97) <br>
==1762==&nbsp;&nbsp;&nbsp; by 0x5AD2FB: yyparse (cfg.y:1085) <br>
==1762==&nbsp;&nbsp;&nbsp; by 0x4177DE: main (main.c:999) <br>
==1762== &nbsp;<br>
==1762== LEAK SUMMARY: <br>
==1762==&nbsp;&nbsp;&nbsp; definitely lost: 80 bytes in 1 blocks <br>
==1762==&nbsp;&nbsp;&nbsp; indirectly lost: 0 bytes in 0 blocks <br>
==1762==&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; possibly lost: 0 bytes in 0 blocks <br>
==1762==&nbsp;&nbsp;&nbsp; still reachable: 2,887,818 bytes in 2,192 blocks <br>
==1762==&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; suppressed: 0 bytes in 0 blocks <br>
==1762== Reachable blocks (those to which a pointer was found) are not shown. <br>
==1762== To see them, rerun with: --leak-check=full --show-leak-kinds=all <br>
==1762==&nbsp;</div>
-------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>
The problem rises in the yyparser. The parser causes a memory leak whenever db_mode is zero and we still declare db_url, just in dialog module.<br>
<br>
Regards.<br>
</div>
<br>
<p></p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De:</b> Daniel Lopes Fússia<br>
<b>Enviado:</b> sexta-feira, 17 de junho de 2016 14:41<br>
<b>Para:</b> Rodrigo Pimenta Carvalho<br>
<b>Assunto:</b> Leak no Parser</font>
<div>&nbsp;</div>
</div>
<div>
<div style="">
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">
Pimenta,</p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">
&nbsp;</p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">
Os logs e as configurações estão em anexo.</p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">
Qualquer dúvida me dá um tok.</p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">
&nbsp;</p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">
Att,</p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">
Daniel Fussia</p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">
&nbsp;</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>