<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi Grant,</p>
    <p>for clarification -- using the dedicated KEMI function is working
      fine? Only when using x.modf() is crashing?</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 12.05.19 10:23, Grant Bagdasarian
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CACK6f-rCf_5rfusBXZydzL=aw=WxrTrzNT+VvhNK81sd_XagKQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div>
        <div dir="auto">Hi Daniel,</div>
      </div>
      <div dir="auto"><br>
      </div>
      <div dir="auto">Yes, I’ve only been using the dedicated KEMI
        functions. This was just a simple try to see what would happen.</div>
      <div dir="auto">Anyways, thanks for the tip!</div>
      <div dir="auto"><br>
      </div>
      <div dir="auto">Regards,</div>
      <div dir="auto">Grant</div>
      <div><br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Sun, 12 May 2019 at
            09:42, Daniel-Constantin Mierla <<a
              href="mailto:miconda@gmail.com" moz-do-not-send="true">miconda@gmail.com</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
            <br>
            have you tried the dedicated KEMI functions?<br>
            <br>
              -<br>
            <a
href="http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#auth_ephemeral"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#auth_ephemeral</a><br>
            <br>
            KSR.x.modf() must be avoided as much as possible, because it
            is an<br>
            workaround which can also lead to memory leaks if the
            kamailio.cfg<br>
            functions don't have a free fixup function.<br>
            <br>
            Cheers,<br>
            Daniel<br>
            <br>
            On 12.05.19 00:16, Grant Bagdasarian wrote:<br>
            > Hi Daniel,<br>
            ><br>
            > FYI, the following also ends up in the stack smash
            error:<br>
            > _.x.modf("autheph_authenticate", "1576734089:grant",
            "1234")<br>
            ><br>
            > I also tried with the devel nightly deb package, which
            also resulted<br>
            > in the same error.<br>
            > I'm unsure if this error also happens when using the
            native Kamailio<br>
            > script, as my routing logic is built using the Python3
            module.<br>
            > Will give the native script a try soon, and report
            back.<br>
            ><br>
            > Regards,<br>
            ><br>
            > Grant<br>
            ><br>
            > On Tue, May 7, 2019 at 11:08 PM Grant Bagdasarian<br>
            > <<a href="mailto:grantbagdasarian@gmail.com"
              target="_blank" moz-do-not-send="true">grantbagdasarian@gmail.com</a>>
            wrote:<br>
            >> Hi Daniel,<br>
            >><br>
            >> I used the latest Docker image for Kamailio 5.2.2
            and then changed the<br>
            >> apt kamailio.list file to contain the nightly build
            and<br>
            >> updated/upgraded kamailio. Hope this is enough to
            target the latest<br>
            >> git 5.2 version.<br>
            >> If not, please let me know.<br>
            >><br>
            >> deb     <a
              href="http://deb.kamailio.org/kamailio52-nightly"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://deb.kamailio.org/kamailio52-nightly</a>
            stretch main<br>
            >> deb-src <a
              href="http://deb.kamailio.org/kamailio52-nightly"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://deb.kamailio.org/kamailio52-nightly</a>
            stretch main<br>
            >><br>
            >> <a href="https://pastebin.com/XHsFAiJp"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://pastebin.com/XHsFAiJp</a><br>
            >><br>
            >> It still ends in a stacksmash error.<br>
            >><br>
            >> Regards,<br>
            >><br>
            >> Grant<br>
            >><br>
            >> On Fri, May 3, 2019 at 11:56 AM Daniel-Constantin
            Mierla<br>
            >> <<a href="mailto:miconda@gmail.com"
              target="_blank" moz-do-not-send="true">miconda@gmail.com</a>>
            wrote:<br>
            >>> Hello,<br>
            >>><br>
            >>> can you try with latest git branch 5.2? I
            pushed a commit that<br>
            >>> eventually fixes it.<br>
            >>><br>
            >>> Cheers,<br>
            >>> Daniel<br>
            >>><br>
            >>> On 02.05.19 23:54, Grant Bagdasarian wrote:<br>
            >>>> Hi Daniel,<br>
            >>>><br>
            >>>> See pastebin url below for the backtrace.<br>
            >>>> <a href="https://pastebin.com/tTUUk4YH"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://pastebin.com/tTUUk4YH</a><br>
            >>>><br>
            >>>> Hopefully I did it the right way. Please
            let me know if you need anything else.<br>
            >>>> FYI, Kamailio is running inside of a docker
            container.<br>
            >>>><br>
            >>>> version: kamailio 5.2.1 (x86_64/linux)<br>
            >>>> flags: STATS: Off, USE_TCP, USE_TLS,
            USE_SCTP, TLS_HOOKS,<br>
            >>>> USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST,
            DNS_IP_HACK, SHM_MEM,<br>
            >>>> SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC,
            TLSF_MALLOC, DBG_SR_MEMORY,<br>
            >>>> USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT,
            USE_DNS_CACHE, USE_DNS_FAILOVER,<br>
            >>>> USE_NAPTR, USE_DST_BLACKLIST,
            HAVE_RESOLV_RES<br>
            >>>> ADAPTIVE_WAIT_LOOPS=1024,
            MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE<br>
            >>>> 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>
            >>>> poll method support: poll, epoll_lt,
            epoll_et, sigio_rt, select.<br>
            >>>> id: unknown<br>
            >>>> compiled with gcc 6.3.0<br>
            >>>><br>
            >>>> I can easily replicate this, but to be sure
            I've saved the core file<br>
            >>>> locally on my machine.<br>
            >>>><br>
            >>>> Regards,<br>
            >>>><br>
            >>>> Grant<br>
            >>>><br>
            >>>> On Thu, May 2, 2019 at 10:05 AM
            Daniel-Constantin Mierla<br>
            >>>> <<a href="mailto:miconda@gmail.com"
              target="_blank" moz-do-not-send="true">miconda@gmail.com</a>>
            wrote:<br>
            >>>>> Hello,<br>
            >>>>><br>
            >>>>> can you get a core file for this case?<br>
            >>>>><br>
            >>>>> Set `ulimit -c unlimited` before
            starting Kamailio as root and run again.<br>
            >>>>><br>
            >>>>> Once you have the core file, get the
            backtrace with gdb.<br>
            >>>>><br>
            >>>>> Cheers,<br>
            >>>>> Daniel<br>
            >>>>><br>
            >>>>> On 01.05.19 20:26, Grant Bagdasarian
            wrote:<br>
            >>>>>> Hello,<br>
            >>>>>><br>
            >>>>>> I was trying out the auth_ephemeral
            module inside the xhttp<br>
            >>>>>> event_route in Python KEMI, and
            discovered a possible bug.<br>
            >>>>>><br>
            >>>>>> <a
              href="https://pastebin.com/4Ghumfis" rel="noreferrer"
              target="_blank" moz-do-not-send="true">https://pastebin.com/4Ghumfis</a><br>
            >>>>>><br>
            >>>>>> The following will result in the
            stack smash error. Whenever I leave<br>
            >>>>>> out the unixtimestamp the<br>
            >>>>>> module will complain about not
            being able to convert to an int, which<br>
            >>>>>> make sense, but doesn't lead to a
            stack smash error and a complete<br>
            >>>>>> crash of Kamailio.<br>
            >>>>>><br>
            >>>>>>
            KSR.auth_ephemeral.autheph_authenticate("1576734089:grant",
            "1234").<br>
            >>>>>><br>
            >>>>>> According to the documentation this
            module can only be used in<br>
            >>>>>> REQUEST_ROUTE, but I found a
            presentation online which also used this<br>
            >>>>>> module and that particular function
            in event_route, which is what I<br>
            >>>>>> need for WebSocket authentication.<br>
            >>>>>><br>
            >>>>>> Hope this helps. Please let me know
            if you need more information.<br>
            >>>>>><br>
            >>>>>> Regards,<br>
            >>>>>><br>
            >>>>>> Grant<br>
            >>>>>><br>
            >>>>>>
            _______________________________________________<br>
            >>>>>> Kamailio (SER) - Users Mailing List<br>
            >>>>>> <a
              href="mailto:sr-users@lists.kamailio.org" target="_blank"
              moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
            >>>>>> <a
              href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            >>>>> --<br>
            >>>>> Daniel-Constantin Mierla -- <a
              href="http://www.asipto.com" rel="noreferrer"
              target="_blank" moz-do-not-send="true">www.asipto.com</a><br>
            >>>>> <a
              href="http://www.twitter.com/miconda" rel="noreferrer"
              target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a>
            -- <a href="http://www.linkedin.com/in/miconda"
              rel="noreferrer" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a><br>
            >>>>> Kamailio World Conference - May 6-8,
            2019 -- <a href="http://www.kamailioworld.com"
              rel="noreferrer" target="_blank" moz-do-not-send="true">www.kamailioworld.com</a><br>
            >>>>><br>
            >>>>
            _______________________________________________<br>
            >>>> Kamailio (SER) - Users Mailing List<br>
            >>>> <a
              href="mailto:sr-users@lists.kamailio.org" target="_blank"
              moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
            >>>> <a
              href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            >>> --<br>
            >>> Daniel-Constantin Mierla -- <a
              href="http://www.asipto.com" rel="noreferrer"
              target="_blank" moz-do-not-send="true">www.asipto.com</a><br>
            >>> <a href="http://www.twitter.com/miconda"
              rel="noreferrer" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a>
            -- <a href="http://www.linkedin.com/in/miconda"
              rel="noreferrer" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a><br>
            >>> Kamailio World Conference - May 6-8, 2019 -- <a
              href="http://www.kamailioworld.com" rel="noreferrer"
              target="_blank" moz-do-not-send="true">www.kamailioworld.com</a><br>
            >>><br>
            -- <br>
            Daniel-Constantin Mierla -- <a href="http://www.asipto.com"
              rel="noreferrer" target="_blank" moz-do-not-send="true">www.asipto.com</a><br>
            <a href="http://www.twitter.com/miconda" rel="noreferrer"
              target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a>
            -- <a href="http://www.linkedin.com/in/miconda"
              rel="noreferrer" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a><br>
            <br>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<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></pre>
  </body>
</html>