Hi Daniel<div><br></div><div>I completely reinstalled the OS and installed the latest kamailio git, but the problem persists, although no core is generated now. Apparently it does not depend on the db engine, same thing happens for mysql and postgres. You can see the full log here: <a href="http://pastebin.ca/2002031">http://pastebin.ca/2002031</a></div>
<div>The architechture details are:</div><div>Ubuntu 10.04.1 LTS \n \l</div><div><div>Linux kam-test 2.6.32-24-server #39-Ubuntu SMP Wed Jul 28 06:21:40 UTC 2010 x86_64 GNU/Linux</div></div><div><br></div><div>Regards</div>
<div><br></div><div>Javi</div><div><br></div><div><br><div class="gmail_quote">On Wed, Nov 24, 2010 at 11:18 PM, 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 text="#000000" bgcolor="#ffffff">
    Hello,<div class="im"><br>
    <br>
    On 11/23/10 12:36 PM, Javier Gallart wrote:
    <blockquote type="cite">Hi,
      <div><br>
      </div>
      <div>same result after adding a second row in the table.</div>
    </blockquote></div>
    I just did a configuration file with dialplan and a record like you
    showed and it started ok. My log messages are pasted next:<br>
    <br>
     0(10267) DEBUG: db_mysql [km_res.c:136]: use DB1_STRING result type<br>
     0(10267) DEBUG: db_mysql [km_dbase.c:354]: converting row 0 of 1
    count 1<br>
     0(10267) DEBUG: &lt;core&gt; [db_row.c:119]: allocate 160 bytes for
    row values at 0x82f53f4<br>
     0(10267) DEBUG: &lt;core&gt; [db_val.c:73]: converting INT [1]<br>
     0(10267) DEBUG: &lt;core&gt; [db_val.c:73]: converting INT [1]<br>
     0(10267) DEBUG: &lt;core&gt; [db_val.c:73]: converting INT [1]<br>
     0(10267) DEBUG: &lt;core&gt; [db_val.c:117]: converting STRING
    [^00]<br>
     0(10267) DEBUG: &lt;core&gt; [db_val.c:73]: converting INT [0]<br>
     0(10267) DEBUG: &lt;core&gt; [db_val.c:117]: converting STRING
    [^00]<br>
     0(10267) DEBUG: &lt;core&gt; [db_val.c:117]: converting STRING
    [011]<br>
     0(10267) DEBUG: &lt;core&gt; [db_val.c:117]: converting STRING
    [dp1]<br>
     0(10267) DEBUG: dialplan [dp_db.c:387]: build_rule<br>
     0(10267) DEBUG: dialplan [dp_db.c:447]: attrs are dp1<br>
     0(10267) DEBUG: dialplan [dp_db.c:493]: new dpl_id 1<br>
     0(10267) DEBUG: dialplan [dp_db.c:506]: new index , len 0<br>
     0(10267) DEBUG: dialplan [dp_db.c:542]: added the rule id 1 index 0
    pr 1 next (nil) to the index with 0 len<br>
     0(10267) DEBUG: &lt;core&gt; [db_res.c:54]: freeing 1 rows<br>
    <br>
    Is it a fresh installation or an update over an older installation?
    If is the second, can you doublecheck to see if all modules were
    compiled and installed at the same time and are no longer older
    versions?<br>
    <br>
    Also, what is your operating system and architecture type?<br>
    <br>
    I tried with both master/devel and 3.1 branches.<br>
    <br>
    Thanks,<br><font color="#888888">
    Daniel</font><div><div></div><div class="h5"><br>
    <br>
    <blockquote type="cite">
      <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" 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"> 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><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>
      <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>