Hi,<div><br></div><div>same result after adding a second row in the table.</div><div><br></div><div>Regards</div><div><br></div><div>Javier<br><br><div class="gmail_quote">On Tue, Nov 23, 2010 at 11:17 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

  
    
  
  <div bgcolor="#ffffff" text="#000000">
    Thanks, I will look over it and try to reproduce in the lab, it may
    take a bit since I am pretty much time offline these days.<br>
    <br>
    Can you add a second rule and see what happens? At the first sight
    of the debug messages, the result from database is ok, should not be
    a null value there.<br>
    <br>
    Cheers,<br><font color="#888888">
    Daniel</font><div><div></div><div class="h5"><br>
    <br>
    On 11/23/10 10:38 AM, Javier Gallart wrote:
    <blockquote type="cite">Thanks Daniel
      <div><br>
      </div>
      <div>you can find both the gdb and ./kamailio output at 
        
        <a href="http://pastebin.ca/1999786" target="_blank">http://pastebin.ca/1999786</a></div>
      <div><br>
      </div>
      <div>Regards</div>
      <div><br>
      </div>
      <div>Javier<br>
        <br>
        <div class="gmail_quote">On Mon, Nov 22, 2010 at 10:19 PM,
          Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
            <div bgcolor="#ffffff" text="#000000"> Hello,
              <div><br>
                <br>
                On 11/22/10 5:32 PM, Javier Gallart wrote:
                <blockquote type="cite">Hello
                  <div><br>
                  </div>
                  <div>I&#39;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&#39;s related with the way I&#39;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&#39;.</div>
                    <div>Program terminated with signal 11, Segmentation
                      fault.</div>
                    <div>#0  build_rule (values=0x0) at dp_db.c:439</div>
                    <div> 439<span style="white-space:pre-wrap"> </span>new_rule-&gt;dpid<span style="white-space:pre-wrap"> </span>=<span style="white-space:pre-wrap"> </span>VAL_INT(values);</div>
                  </div>
                </blockquote>
              </div>
              this looks a bit strange at first sight, &#39;values&#39;
              parameter is NULL and should not happen. Besides that, in
              build_rule() functions there are other uses of &#39;values&#39;
              before line 439, so the crash should have been earlier.<br>
              <br>
              Please send full backtrace of the core, in gdb, run &#39;bt&#39;
              command (or better &#39;bt full&#39;).<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 type="cite">
                <div>
                  <div>
                    <div> </div>
                    <div><br>
                    </div>
                    <div>This is the relevant config:</div>
                    <div><br>
                    </div>
                    <div>
                      <div>#----- dialplan params ---</div>
                      <div>modparam(&quot;dialplan&quot;, &quot;db_url&quot;,
                        &quot;mysql://xxxx:yyyyy@localhost/db&quot;)</div>
                      <div>modparam(&quot;dialplan&quot;, &quot;table_name&quot;,
                        &quot;dialplan&quot;)</div>
                      <div>modparam(&quot;dialplan&quot;, &quot;dpid_col&quot;, &quot;dpid&quot;)</div>
                      <div>modparam(&quot;dialplan&quot;, &quot;attrs_pvar&quot;,
                        &quot;$avp(s:dp_attrs)&quot;)</div>
                    </div>
                    <div><br>
                    </div>
                    <div>mysql&gt; describe dialplan;</div>
                    <div>
                      <div>+-----------+------------------+------+-----+---------+----------------+</div>
                      <div>| Field     | Type             | Null | Key |
                        Default | Extra          |</div>
                      <div>+-----------+------------------+------+-----+---------+----------------+</div>
                      <div>| id        | int(10) unsigned | NO   | PRI |
                        NULL    | auto_increment |</div>
                      <div>| dpid      | int(11)          | NO   |     |
                        NULL    |                |</div>
                      <div>| pr        | int(11)          | NO   |     |
                        NULL    |                |</div>
                      <div>| match_op  | int(11)          | NO   |     |
                        NULL    |                |</div>
                      <div>| match_exp | varchar(64)      | NO   |     |
                        NULL    |                |</div>
                      <div>| match_len | int(11)          | NO   |     |
                        NULL    |                |</div>
                      <div>| subst_exp | varchar(64)      | NO   |     |
                        NULL    |                |</div>
                      <div>| repl_exp  | varchar(32)      | NO   |     |
                        NULL    |                |</div>
                      <div>| attrs     | varchar(32)      | NO   |     |
                        NULL    |                |</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>|  1 |    1 |  1 |        1 | ^00       |    
                            0 | ^00       | 011      | dp1   |</div>
                      <div>+----+------+----+----------+-----------+-----------+-----------+----------+-------+</div>
                      <div>1 row in set (0.00 sec)</div>
                    </div>
                    <div><br>
                    </div>
                    <div>I&#39;m probably making some stupid mistake...any
                      clue?</div>
                    <div><br>
                    </div>
                    <div>Thanks in advance</div>
                    <div><br>
                    </div>
                    <div>Javier</div>
                  </div>
                </div>
                <pre><fieldset></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
              </blockquote>
              <br>
              <pre cols="72">-- 
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <pre><fieldset></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
  </div></div></div>

</blockquote></div><br></div>