<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    On 11/22/10 5:32 PM, Javier Gallart wrote:
    <blockquote
      cite="mid:AANLkTi=azhJoBJ525dmQ6M_YLVs0X4awqTXknd=du4aw@mail.gmail.com"
      type="cite">Hello
      <div><br>
      </div>
      <div>I'd like to do some tests with the dialplan module, but
        Kamailio is crashing when it loads it. Actually the module is
        properly loaded if the table is empty, but it fails when a row
        is added; so I guess it's related with the way I've inserted the
        values. A core file is generated:</div>
      <div>
        <div><br>
        </div>
        <div>Core was generated by `./kamailio -f
          ../etc/kamailio/kamailio.cfg'.</div>
        <div>Program terminated with signal 11, Segmentation fault.</div>
        <div>#0 &nbsp;build_rule (values=0x0) at dp_db.c:439</div>
        <div>
          439<span class="Apple-tab-span" style="white-space: pre;"> </span>new_rule-&gt;dpid<span
            class="Apple-tab-span" style="white-space: pre;"> </span>=<span
            class="Apple-tab-span" style="white-space: pre;"> </span>VAL_INT(values);</div>
      </div>
    </blockquote>
    this looks a bit strange at first sight, 'values' parameter is NULL
    and should not happen. Besides that, in build_rule() functions there
    are other uses of 'values' before line 439, so the crash should have
    been earlier.<br>
    <br>
    Please send full backtrace of the core, in gdb, run 'bt' command (or
    better 'bt full').<br>
    <br>
    Also, if this reproducible, run:<br>
    <br>
    ./kamailio -f ../etc/kamailio/kamailio.cfg -E -dddd<br>
    <br>
    and send the output.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <blockquote
      cite="mid:AANLkTi=azhJoBJ525dmQ6M_YLVs0X4awqTXknd=du4aw@mail.gmail.com"
      type="cite">
      <div>
      </div>
      <div><br>
      </div>
      <div>This is the relevant config:</div>
      <div><br>
      </div>
      <div>
        <div>#----- dialplan params ---</div>
        <div>modparam("dialplan", "db_url",
          "mysql://xxxx:yyyyy@localhost/db")</div>
        <div>modparam("dialplan", "table_name", "dialplan")</div>
        <div>modparam("dialplan", "dpid_col", "dpid")</div>
        <div>modparam("dialplan", "attrs_pvar", "$avp(s:dp_attrs)")</div>
      </div>
      <div><br>
      </div>
      <div>mysql&gt; describe dialplan;</div>
      <div>
        <div>+-----------+------------------+------+-----+---------+----------------+</div>
        <div>| Field &nbsp; &nbsp; | Type &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Null | Key | Default |
          Extra &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
        <div>+-----------+------------------+------+-----+---------+----------------+</div>
        <div>| id &nbsp; &nbsp; &nbsp; &nbsp;| int(10) unsigned | NO &nbsp; | PRI | NULL &nbsp; &nbsp;|
          auto_increment |</div>
        <div>| dpid &nbsp; &nbsp; &nbsp;| int(11) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| NO &nbsp; | &nbsp; &nbsp; | NULL &nbsp; &nbsp;| &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
        <div>| pr &nbsp; &nbsp; &nbsp; &nbsp;| int(11) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| NO &nbsp; | &nbsp; &nbsp; | NULL &nbsp; &nbsp;| &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
        <div>| match_op &nbsp;| int(11) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| NO &nbsp; | &nbsp; &nbsp; | NULL &nbsp; &nbsp;| &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
        <div>| match_exp | varchar(64) &nbsp; &nbsp; &nbsp;| NO &nbsp; | &nbsp; &nbsp; | NULL &nbsp; &nbsp;| &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
        <div>| match_len | int(11) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| NO &nbsp; | &nbsp; &nbsp; | NULL &nbsp; &nbsp;| &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
        <div>| subst_exp | varchar(64) &nbsp; &nbsp; &nbsp;| NO &nbsp; | &nbsp; &nbsp; | NULL &nbsp; &nbsp;| &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
        <div>| repl_exp &nbsp;| varchar(32) &nbsp; &nbsp; &nbsp;| NO &nbsp; | &nbsp; &nbsp; | NULL &nbsp; &nbsp;| &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
        <div>| attrs &nbsp; &nbsp; | varchar(32) &nbsp; &nbsp; &nbsp;| NO &nbsp; | &nbsp; &nbsp; | NULL &nbsp; &nbsp;| &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
        <div>+-----------+------------------+------+-----+---------+----------------+</div>
        <div>9 rows in set (0.00 sec)</div>
      </div>
      <div>
        <div><br>
        </div>
        <div>mysql&gt; select * from dialplan;</div>
        <div>+----+------+----+----------+-----------+-----------+-----------+----------+-------+</div>
        <div>| id | dpid | pr | match_op | match_exp | match_len |
          subst_exp | repl_exp | attrs |</div>
        <div>+----+------+----+----------+-----------+-----------+-----------+----------+-------+</div>
        <div>| &nbsp;1 | &nbsp; &nbsp;1 | &nbsp;1 | &nbsp; &nbsp; &nbsp; &nbsp;1 | ^00 &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; 0 | ^00 &nbsp;
          &nbsp; &nbsp; | 011 &nbsp; &nbsp; &nbsp;| dp1 &nbsp; |</div>
        <div>+----+------+----+----------+-----------+-----------+-----------+----------+-------+</div>
        <div>1 row in set (0.00 sec)</div>
      </div>
      <div><br>
      </div>
      <div>I'm probably making some stupid mistake...any clue?</div>
      <div><br>
      </div>
      <div>Thanks in advance</div>
      <div><br>
      </div>
      <div>Javier</div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>