[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openser-users
Subject:    Re: [SR-Users] Memory leak in Kamailio 4.4.4 TLS Module
From:       Daniel-Constantin Mierla <miconda () gmail ! com>
Date:       2016-12-22 8:54:03
Message-ID: f5990744-289d-34db-02d5-dfd9a9c148af () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

how much shared memory did you configure for kamailio (the value of -m
parameter)? There are safety checks to ensure that there are available
256 to 512KB of shm/kamailio process in order to have safe ssl
operations. If you don't allocate enough and you have a high value for
children global parameter, then you can run easily into this constraint.

You can provide the output of:

kamctl ps

kamctl stats

if you want us to check if you allocated enough resources.

Cheers,
Daniel

On 22/12/2016 08:26, raja raja wrote:
> Hi,
> shared memory not freed once TLS connection close means shm available
> memory decreasing for new connection that leads to the following error
> *tls: ssl bug #1491 workaround: not enough memory for safe operation
>
> *
> *TestCase:
> *
> 1. start kamailio
> 2. use sample program to establish tls connection and close imediately.
> 3. Kamailio Log is
>     For first TLS connection
>     tls [tls_server.c:189]: tls_complete_init(): tls: enough memory
> for safe operation: shm=63604096 threshold1=12058624
>     tls [tls_server.c:649]: tls_h_tcpconn_clean(): tls shm_available
> after shm_free: 63545192
>
>      For second TLS connection
>      tls [tls_server.c:189]: tls_complete_init(): tls: enough memory
> for safe operation: shm=63545192 threshold1=12058624
>      tls [tls_server.c:649]: tls_h_tcpconn_clean(): tls shm_available
> after shm_free: 63489352
> *
> *
> *Memory Leak:*
> for tls connection connection
> 63604096 - 63545192 = 58904 bytes not freed.
>
> for tls connection connection
> 63545192 - 63489352 = 55840 bytes not freed.
>
> I tested same scenario on kamailio - 4.2.4, 4.3.4 versions result is same.
>
> Could you please provide the fix?
>
> Thanks & Regards,
> Raja Chegondi.
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com


[Attachment #5 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>how much shared memory did you configure for kamailio (the value
      of -m parameter)? There are safety checks to ensure that there are
      available 256 to 512KB of shm/kamailio process in order to have
      safe ssl operations. If you don't allocate enough and you have a
      high value for children global parameter, then you can run easily
      into this constraint.</p>
    <p>You can provide the output of:</p>
    <p>kamctl ps</p>
    <p>kamctl stats</p>
    <p>if you want us to check if you allocated enough resources.<br>
    </p>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 22/12/2016 08:26, raja raja wrote:<br>
    </div>
    <blockquote
cite="mid:CACm4Fpmc8TAP+iaEscAAgqhpgEGsf8YFz2dBzT8F_ZP_N9eaWA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>Hi,<br>
                  </div>
                  shared memory not freed once TLS connection close
                  means shm available memory decreasing for new
                  connection that leads to the following error<br>
                  <b>tls: ssl bug #1491 workaround: not enough memory
                    for safe operation<br>
                    <br>
                  </b></div>
                <div><b>TestCase:<br>
                  </b></div>
                1. start kamailio<br>
              </div>
              2. use sample program to establish tls connection and
              close imediately.<br>
            </div>
            3. Kamailio Log is<br>
          </div>
              For first TLS connection<br>
              tls [tls_server.c:189]: tls_complete_init(): tls: enough
          memory for safe operation: shm=63604096 threshold1=12058624<br>
              tls [tls_server.c:649]: tls_h_tcpconn_clean(): tls
          shm_available after shm_free: 63545192<br>
          <br>
               For second TLS connection<br>
               tls [tls_server.c:189]: tls_complete_init(): tls: enough
          memory for safe operation: shm=63545192 threshold1=12058624<br>
               tls [tls_server.c:649]: tls_h_tcpconn_clean(): tls
          shm_available after shm_free: 63489352<br>
          <b><br>
          </b></div>
        <b>Memory Leak:</b><br>
        <div>for tls connection connection<br>
        </div>
        <div>63604096 - 63545192 = 58904 bytes not freed.<br>
          <br>
          <div>for tls connection connection<br>
          </div>
          63545192 - 63489352 = 55840 bytes not freed.<br>
        </div>
        <div><br>
        </div>
        <div>I tested same scenario on kamailio - 4.2.4, 4.3.4 versions
          result is same.<br>
          <br>
        </div>
        <div>Could you please provide the fix?<br>
        </div>
        <div><br>
        </div>
        <div>Thanks &amp; Regards,<br>
        </div>
        <div>Raja Chegondi.<br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" \
href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a> <a \
class="moz-txt-link-freetext" \
href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
 </pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" \
href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a \
class="moz-txt-link-abbreviated" \
href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a> Kamailio \
World Conference - May 8-10, 2017 - <a class="moz-txt-link-abbreviated" \
href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>  </body>
</html>


[Attachment #6 (text/plain)]

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic